Skip to content

Commit 77c7651

Browse files
committed
Support VFileMessageError source in parsing error
1 parent cd4a23e commit 77c7651

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/language-server/test/diagnostics.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ test('parse errors', async () => {
2828
kind: 'full',
2929
items: [
3030
{
31-
code: 'acorn',
31+
code: 'micromark-extension-mdxjs-esm:acorn',
3232
codeDescription: {
3333
href: 'https://github.com/micromark/micromark-extension-mdxjs-esm#could-not-parse-importexports-with-acorn'
3434
},

packages/language-service/lib/service-plugin.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ export function createMdxServicePlugin() {
2626
return [
2727
{
2828
message: error.message,
29-
code: error.ruleId,
29+
code: error.source
30+
? error.source + ':' + error.ruleId
31+
: error.ruleId,
3032
codeDescription: {
3133
href:
3234
error.url || 'https://mdxjs.com/docs/troubleshooting-mdx/'

0 commit comments

Comments
 (0)