Repository: mdx-js/mdx-analyzer (js)

Issue:
Last error does not disappear from MDX VS Code extension after fixed
### Initial checklist

- [X] I read the [support docs](https://mdxjs.com/community/support/)
- [X] I read the [contributing guide](https://mdxjs.com/community/contribute/)
- [X] I agree to follow the [code of conduct](https://github.com/mdx-js/.github/blob/HEAD/code-of-conduct.md)
- [X] I searched [issues](https://github.com/search?q=user%3Amdx-js&type=Issues) and couldn’t find anything (or linked relevant results below)

### Affected packages and versions

MDX VS Code Extension v1.7.2

### Link to runnable example

_No response_

### Steps to reproduce

1. Add an MDX document with the following (should show 2 errors with [the MDX VS Code Extension](https://marketplace.visualstudio.com/items?itemName=unifiedjs.vscode-mdx) v1.7.2):
   ```mdx
   - <component name>.module.scss filenames
   - <componentx name>.module.scss filenames
   ```
2. Resolve both errors by adding a backslash before the opening `<`
3. Observe that the last resolved error remains 💥
4. Confirm that it is not actually an error by reloading VS Code

https://github.com/mdx-js/mdx-analyzer/assets/1935696/d551595e-399b-4194-8f1e-a493d345b914

### Expected behavior

After the last error is resolved, there should no longer be any errors visible anywhere

### Actual behavior

After the last error is resolved, the last error remains

### Runtime

Node v20

### Package manager

pnpm

### OS

macOS

### Build and bundle tools

_No response_

cc @remcohaszing 

Pull request:
Update to Volar 2.1
### Initial checklist

*   [x] I read the support docs <!-- https://github.com/unifiedjs/.github/blob/main/support.md -->
*   [x] I read the contributing guide <!-- https://github.com/unifiedjs/.github/blob/main/contributing.md -->
*   [x] I agree to follow the code of conduct <!-- https://github.com/unifiedjs/.github/blob/main/code-of-conduct.md -->
*   [x] I searched issues and couldn’t find anything (or linked relevant results below) <!-- https://github.com/search?q=user%3Aunifiedjs&type=Issues -->
*   [x] If applicable, I’ve added docs and tests

### Description of changes

Closes #400

<!--do not edit: pr-->


Patch:
diff --git a/packages/language-server/index.js b/packages/language-server/index.js
index ec96a16..51ff700 100755
--- a/packages/language-server/index.js
+++ b/packages/language-server/index.js
@@ -17,7 +17,8 @@ import {
 import {
   createConnection,
   createServer,
-  createTypeScriptProjectProvider
+  createTypeScriptProjectProviderFactory,
+  loadTsdkByPath
 } from '@volar/language-server/node.js'
 import {loadPlugin} from 'load-plugin'
 import remarkFrontmatter from 'remark-frontmatter'
@@ -32,76 +33,91 @@ const defaultPlugins = [[remarkFrontmatter, ['toml', 'yaml']], remarkGfm]
 const connection = createConnection()
 const server = createServer(connection)
 
-connection.onInitialize((parameters) =>
-  server.initialize(parameters, createTypeScriptProjectProvider, {
-    watchFileExtensions: [
-      'cjs',
-      'cts',
-      'js',
-      'jsx',
-      'json',
-      'mdx',
-      'mjs',
-      'mts',
-      'ts',
-      'tsx'
-    ],
-
-    getServicePlugins() {
-      assert(server.modules.typescript, 'TypeScript module is missing')
-
-      return [
-        createMarkdownServicePlugin({configurationSection: 'mdx.validate'}),
-        createMdxServicePlugin(),
-        createTypeScriptServicePlugin(server.modules.typescript)
-      ]
-    },
-
-    async getLanguagePlugins(serviceEnvironment, projectContext) {
-      const ts = server.modules.typescript
-      assert(ts, 'TypeScript module is missing')
-
-      const configFileName = projectContext?.typescript?.configFileName
-
-      /** @type {PluggableList | undefined} */
-      let plugins
-      let checkMdx = false
-      let jsxImportSource = 'react'
-
-      if (configFileName) {
-        const cwd = path.dirname(configFileName)
-        const configSourceFile = ts.readJsonConfigFile(
-          configFileName,
-          ts.sys.readFile
-        )
-        const commandLine = ts.parseJsonSourceFileConfigFileContent(
-          configSourceFile,
-          ts.sys,
-          cwd,
-          undefined,
-          configFileName
-        )
-        plugins = await resolveRemarkPlugins(
-          commandLine.raw?.mdx,
-          (name) =>
-            /** @type {Promise<Plugin>} */ (
-              loadPlugin(name, {prefix: 'remark', cwd})
-            )
-        )
-        checkMdx = Boolean(commandLine.raw?.mdx?.checkMdx)
-        jsxImportSource = commandLine.options.jsxImportSource || jsxImportSource
+connection.onInitialize((parameters) => {
+  const tsdk = parameters.initializationOptions?.typescript?.tsdk
+  assert(
+    typeof tsdk === 'string',
+    'Missing initialization option typescript.tsdk'
+  )
+
+  const {diagnosticMessages, typescript} = loadTsdkByPath(
+    tsdk,
+    parameters.locale
+  )
+
+  return server.initialize(
+    parameters,
+    createTypeScriptProjectProviderFactory(typescript, diagnosticMessages),
+    {
+      watchFileExtensions: [
+        'cjs',
+        'cts',
+        'js',
+        'jsx',
+        'json',
+        'mdx',
+        'mjs',
+        'mts',
+        'ts',
+        'tsx'
+      ],
+
+      getServicePlugins() {
+        return [
+          createMarkdownServicePlugin({
+            getDiagnosticOptions(document, context) {
+              return context.env.getConfiguration?.('mdx.validate')
+            }
+          }),
+          createMdxServicePlugin(),
+          createTypeScriptServicePlugin(typescript)
+        ]
+      },
+
+      async getLanguagePlugins(serviceEnvironment, projectContext) {
+        const configFileName = projectContext?.typescript?.configFileName
+
+        /** @type {PluggableList | undefined} */
+        let plugins
+        let checkMdx = false
+        let jsxImportSource = 'react'
+
+        if (configFileName) {
+          const cwd = path.dirname(configFileName)
+          const configSourceFile = typescript.readJsonConfigFile(
+            configFileName,
+            typescript.sys.readFile
+          )
+          const commandLine = typescript.parseJsonSourceFileConfigFileContent(
+            configSourceFile,
+            typescript.sys,
+            cwd,
+            undefined,
+            configFileName
+          )
+          plugins = await resolveRemarkPlugins(
+            commandLine.raw?.mdx,
+            (name) =>
+              /** @type {Promise<Plugin>} */ (
+                loadPlugin(name, {prefix: 'remark', cwd})
+              )
+          )
+          checkMdx = Boolean(commandLine.raw?.mdx?.checkMdx)
+          jsxImportSource =
+            commandLine.options.jsxImportSource || jsxImportSource
+        }
+
+        return [
+          createMdxLanguagePlugin(
+            plugins || defaultPlugins,
+            checkMdx,
+            jsxImportSource
+          )
+        ]
       }
-
-      return [
-        createMdxLanguagePlugin(
-          plugins || defaultPlugins,
-          checkMdx,
-          jsxImportSource
-        )
-      ]
     }
-  })
-)
+  )
+})
 
 connection.onRequest('mdx/toggleDelete', async (parameters) => {
   const commands = await getCommands(parameters.uri)
diff --git a/packages/language-server/package.json b/packages/language-server/package.json
index 50af8e0..fbb915d 100644
--- a/packages/language-server/package.json
+++ b/packages/language-server/package.json
@@ -33,17 +33,17 @@
   },
   "dependencies": {
     "@mdx-js/language-service": "0.5.2",
-    "@volar/language-server": "~2.0.0",
+    "@volar/language-server": "~2.1.0",
     "load-plugin": "^5.0.0",
     "remark-frontmatter": "^5.0.0",
     "remark-gfm": "^4.0.0",
-    "volar-service-markdown": "0.0.30",
-    "volar-service-typescript": "0.0.30",
+    "volar-service-markdown": "0.0.31",
+    "volar-service-typescript": "0.0.31",
     "vscode-uri": "^3.0.0"
   },
   "devDependencies": {
     "@types/node": "^20.0.0",
-    "@volar/test-utils": "~2.0.0",
+    "@volar/test-utils": "~2.1.0",
     "unified": "^11.0.0"
   }
 }
diff --git a/packages/language-service/lib/virtual-code.js b/packages/language-service/lib/virtual-code.js
index 97953ad..2fd750b 100644
--- a/packages/language-service/lib/virtual-code.js
+++ b/packages/language-service/lib/virtual-code.js
@@ -522,7 +522,6 @@ function getEmbeddedCodes(mdx, ast, checkMdx, jsxImportSource) {
           const frontmatterWithFences = mdx.slice(start, end)
           const frontmatterStart = frontmatterWithFences.indexOf(node.value)
           virtualCodes.push({
-            embeddedCodes: [],
             id: node.type,
             languageId: node.type,
             mappings: [
@@ -697,14 +696,12 @@ function getEmbeddedCodes(mdx, ast, checkMdx, jsxImportSource) {
 
   virtualCodes.unshift(
     {
-      embeddedCodes: [],
       id: 'jsx',
       languageId: 'javascriptreact',
       mappings: jsMappings,
       snapshot: new ScriptSnapshot(esm)
     },
     {
-      embeddedCodes: [],
       id: 'md',
       languageId: 'markdown',
       mappings: [markdownMapping],
@@ -824,14 +821,12 @@ export class VirtualMdxCode {
       this.ast = undefined
       this.embeddedCodes = [
         {
-          embeddedCodes: [],
           id: 'jsx',
           languageId: 'javascriptreact',
           mappings: [],
           snapshot: new ScriptSnapshot(fallback)
         },
         {
-          embeddedCodes: [],
           id: 'md',
           languageId: 'markdown',
           mappings: [],
diff --git a/packages/language-service/package.json b/packages/language-service/package.json
index 46b074a..e60595d 100644
--- a/packages/language-service/package.json
+++ b/packages/language-service/package.json
@@ -34,7 +34,7 @@
     "@types/estree": "^1.0.0",
     "@types/mdast": "^4.0.0",
     "@types/unist": "^3.0.0",
-    "@volar/language-service": "~2.0.0",
+    "@volar/language-service": "~2.1.0",
     "estree-walker": "^3.0.0",
     "mdast-util-mdxjs-esm": "^2.0.0",
     "mdast-util-to-markdown": "^2.0.0",
diff --git a/packages/vscode-mdx/package.json b/packages/vscode-mdx/package.json
index 54bc1cf..735a0fa 100644
--- a/packages/vscode-mdx/package.json
+++ b/packages/vscode-mdx/package.json
@@ -45,8 +45,8 @@
   },
   "devDependencies": {
     "@types/vscode": "^1.82.0",
-    "@volar/language-server": "~2.0.0",
-    "@volar/vscode": "~2.0.0",
+    "@volar/language-server": "~2.1.0",
+    "@volar/vscode": "~2.1.0",
     "@vscode/vsce": "2.22.0",
     "esbuild": "^0.20.0",
     "ovsx": "^0.8.0"


Test patch:
diff --git a/packages/language-server/test/completion.test.js b/packages/language-server/test/completion.test.js
index 29160c9..0d7a52f 100644
--- a/packages/language-server/test/completion.test.js
+++ b/packages/language-server/test/completion.test.js
@@ -11,6 +11,7 @@ let serverHandle
 
 beforeEach(async () => {
   serverHandle = createServer()
+  // @ts-expect-error https://github.com/volarjs/volar.js/pull/142
   await serverHandle.initialize(fixtureUri('node16'), {typescript: {tsdk}})
 })
 
diff --git a/packages/language-server/test/definitions.test.js b/packages/language-server/test/definitions.test.js
index a3fb01d..e6239b5 100644
--- a/packages/language-server/test/definitions.test.js
+++ b/packages/language-server/test/definitions.test.js
@@ -10,6 +10,7 @@ let serverHandle
 
 beforeEach(async () => {
   serverHandle = createServer()
+  // @ts-expect-error https://github.com/volarjs/volar.js/pull/142
   await serverHandle.initialize(fixtureUri('node16'), {typescript: {tsdk}})
 })
 
diff --git a/packages/language-server/test/diagnostics.test.js b/packages/language-server/test/diagnostics.test.js
index 76d5195..470ecda 100644
--- a/packages/language-server/test/diagnostics.test.js
+++ b/packages/language-server/test/diagnostics.test.js
@@ -10,6 +10,7 @@ let serverHandle
 
 beforeEach(async () => {
   serverHandle = createServer()
+  // @ts-expect-error https://github.com/volarjs/volar.js/pull/142
   await serverHandle.initialize(fixtureUri('node16'), {typescript: {tsdk}})
 })
 
diff --git a/packages/language-server/test/document-link.test.js b/packages/language-server/test/document-link.test.js
index dee5b35..f3a7f94 100644
--- a/packages/language-server/test/document-link.test.js
+++ b/packages/language-server/test/document-link.test.js
@@ -10,6 +10,7 @@ let serverHandle
 
 beforeEach(async () => {
   serverHandle = createServer()
+  // @ts-expect-error https://github.com/volarjs/volar.js/pull/142
   await serverHandle.initialize(fixtureUri('node16'), {typescript: {tsdk}})
 })
 
diff --git a/packages/language-server/test/document-symbols.test.js b/packages/language-server/test/document-symbols.test.js
index efef68f..0f3843c 100644
--- a/packages/language-server/test/document-symbols.test.js
+++ b/packages/language-server/test/document-symbols.test.js
@@ -11,6 +11,7 @@ let serverHandle
 
 beforeEach(async () => {
   serverHandle = createServer()
+  // @ts-expect-error https://github.com/volarjs/volar.js/pull/142
   await serverHandle.initialize(fixtureUri('node16'), {typescript: {tsdk}})
 })
 
diff --git a/packages/language-server/test/folding-ranges.test.js b/packages/language-server/test/folding-ranges.test.js
index e274ace..c87e47e 100644
--- a/packages/language-server/test/folding-ranges.test.js
+++ b/packages/language-server/test/folding-ranges.test.js
@@ -10,6 +10,7 @@ let serverHandle
 
 beforeEach(async () => {
   serverHandle = createServer()
+  // @ts-expect-error https://github.com/volarjs/volar.js/pull/142
   await serverHandle.initialize(fixtureUri('node16'), {typescript: {tsdk}})
 })
 
diff --git a/packages/language-server/test/hover.test.js b/packages/language-server/test/hover.test.js
index 017f5cd..5c5f2cb 100644
--- a/packages/language-server/test/hover.test.js
+++ b/packages/language-server/test/hover.test.js
@@ -10,6 +10,7 @@ let serverHandle
 
 beforeEach(async () => {
   serverHandle = createServer()
+  // @ts-expect-error https://github.com/volarjs/volar.js/pull/142
   await serverHandle.initialize(fixtureUri('node16'), {typescript: {tsdk}})
 })
 
diff --git a/packages/language-server/test/initialize.test.js b/packages/language-server/test/initialize.test.js
index e60a213..dc3a4e7 100644
--- a/packages/language-server/test/initialize.test.js
+++ b/packages/language-server/test/initialize.test.js
@@ -19,6 +19,7 @@ afterEach(() => {
 test('initialize', async () => {
   const {serverInfo, ...initializeResponse} = await serverHandle.initialize(
     fixtureUri('node16'),
+    // @ts-expect-error https://github.com/volarjs/volar.js/pull/142
     {typescript: {tsdk}}
   )
   assert.deepEqual(initializeResponse, {
diff --git a/packages/language-server/test/no-tsconfig.test.js b/packages/language-server/test/no-tsconfig.test.js
index 4572f6b..d21bce5 100644
--- a/packages/language-server/test/no-tsconfig.test.js
+++ b/packages/language-server/test/no-tsconfig.test.js
@@ -10,6 +10,7 @@ let serverHandle
 
 beforeEach(async () => {
   serverHandle = createServer()
+  // @ts-expect-error https://github.com/volarjs/volar.js/pull/142
   await serverHandle.initialize(fixtureUri('no-tsconfig'), {typescript: {tsdk}})
 })
 
diff --git a/packages/language-server/test/prepare-rename.test.js b/packages/language-server/test/prepare-rename.test.js
index 9980dc1..b81a471 100644
--- a/packages/language-server/test/prepare-rename.test.js
+++ b/packages/language-server/test/prepare-rename.test.js
@@ -10,6 +10,7 @@ let serverHandle
 
 beforeEach(async () => {
   serverHandle = createServer()
+  // @ts-expect-error https://github.com/volarjs/volar.js/pull/142
   await serverHandle.initialize(fixtureUri('node16'), {typescript: {tsdk}})
 })
 
diff --git a/packages/language-server/test/rename.test.js b/packages/language-server/test/rename.test.js
index f312eda..18c7600 100644
--- a/packages/language-server/test/rename.test.js
+++ b/packages/language-server/test/rename.test.js
@@ -10,6 +10,7 @@ let serverHandle
 
 beforeEach(async () => {
   serverHandle = createServer()
+  // @ts-expect-error https://github.com/volarjs/volar.js/pull/142
   await serverHandle.initialize(fixtureUri('node16'), {typescript: {tsdk}})
 })
 
diff --git a/packages/language-service/test/language-module.js b/packages/language-service/test/language-module.js
index 9b23c51..1048ddb 100644
--- a/packages/language-service/test/language-module.js
+++ b/packages/language-service/test/language-module.js
@@ -40,7 +40,6 @@ test('create virtual code w/ mdxjsEsm', () => {
   ])
   assert.deepEqual(code.embeddedCodes, [
     {
-      embeddedCodes: [],
       id: 'jsx',
       languageId: 'javascriptreact',
       mappings: [
@@ -103,7 +102,6 @@ test('create virtual code w/ mdxjsEsm', () => {
       )
     },
     {
-      embeddedCodes: [],
       id: 'md',
       languageId: 'markdown',
       mappings: [
@@ -155,7 +153,6 @@ test('create virtual code w/o MDX layout in case of named re-export', () => {
   ])
   assert.deepEqual(code.embeddedCodes, [
     {
-      embeddedCodes: [],
       id: 'jsx',
       languageId: 'javascriptreact',
       mappings: [
@@ -216,7 +213,6 @@ test('create virtual code w/o MDX layout in case of named re-export', () => {
       )
     },
     {
-      embeddedCodes: [],
       id: 'md',
       languageId: 'markdown',
       mappings: [
@@ -268,7 +264,6 @@ test('create virtual code w/ MDX layout in case of default re-export', () => {
   ])
   assert.deepEqual(code.embeddedCodes, [
     {
-      embeddedCodes: [],
       id: 'jsx',
       languageId: 'javascriptreact',
       mappings: [
@@ -330,7 +325,6 @@ test('create virtual code w/ MDX layout in case of default re-export', () => {
       )
     },
     {
-      embeddedCodes: [],
       id: 'md',
       languageId: 'markdown',
       mappings: [
@@ -385,7 +379,6 @@ test('create virtual code w/ MDX layout in case of named and default re-export',
   ])
   assert.deepEqual(code.embeddedCodes, [
     {
-      embeddedCodes: [],
       id: 'jsx',
       languageId: 'javascriptreact',
       mappings: [
@@ -447,7 +440,6 @@ test('create virtual code w/ MDX layout in case of named and default re-export',
       )
     },
     {
-      embeddedCodes: [],
       id: 'md',
       languageId: 'markdown',
       mappings: [
@@ -502,7 +494,6 @@ test('create virtual code w/ MDX layout in case of default and named re-export',
   ])
   assert.deepEqual(code.embeddedCodes, [
     {
-      embeddedCodes: [],
       id: 'jsx',
       languageId: 'javascriptreact',
       mappings: [
@@ -564,7 +555,6 @@ test('create virtual code w/ MDX layout in case of default and named re-export',
       )
     },
     {
-      embeddedCodes: [],
       id: 'md',
       languageId: 'markdown',
       mappings: [
@@ -616,7 +606,6 @@ test('create virtual code w/ MDX layout in case of a default exported arrow func
   ])
   assert.deepEqual(code.embeddedCodes, [
     {
-      embeddedCodes: [],
       id: 'jsx',
       languageId: 'javascriptreact',
       mappings: [
@@ -691,7 +680,6 @@ test('create virtual code w/ MDX layout in case of a default exported arrow func
       )
     },
     {
-      embeddedCodes: [],
       id: 'md',
       languageId: 'markdown',
       mappings: [
@@ -746,7 +734,6 @@ test('create virtual code w/ MDX layout in case of a default exported function d
   ])
   assert.deepEqual(code.embeddedCodes, [
     {
-      embeddedCodes: [],
       id: 'jsx',
       languageId: 'javascriptreact',
       mappings: [
@@ -823,7 +810,6 @@ test('create virtual code w/ MDX layout in case of a default exported function d
       )
     },
     {
-      embeddedCodes: [],
       id: 'md',
       languageId: 'markdown',
       mappings: [
@@ -875,7 +861,6 @@ test('create virtual code w/ MDX layout in case of a default exported constant',
   ])
   assert.deepEqual(code.embeddedCodes, [
     {
-      embeddedCodes: [],
       id: 'jsx',
       languageId: 'javascriptreact',
       mappings: [
@@ -937,7 +922,6 @@ test('create virtual code w/ MDX layout in case of a default exported constant',
       )
     },
     {
-      embeddedCodes: [],
       id: 'md',
       languageId: 'markdown',
       mappings: [
@@ -992,7 +976,6 @@ test('create virtual code w/ MDX layout and matching argument name', () => {
   ])
   assert.deepEqual(code.embeddedCodes, [
     {
-      embeddedCodes: [],
       id: 'jsx',
       languageId: 'javascriptreact',
       mappings: [
@@ -1069,7 +1052,6 @@ test('create virtual code w/ MDX layout and matching argument name', () => {
       )
     },
     {
-      embeddedCodes: [],
       id: 'md',
       languageId: 'markdown',
       mappings: [
@@ -1125,7 +1107,6 @@ test('create virtual code w/ MDX layout in case of a default export followed by
   ])
   assert.deepEqual(code.embeddedCodes, [
     {
-      embeddedCodes: [],
       id: 'jsx',
       languageId: 'javascriptreact',
       mappings: [
@@ -1205,7 +1186,6 @@ test('create virtual code w/ MDX layout in case of a default export followed by
       )
     },
     {
-      embeddedCodes: [],
       id: 'md',
       languageId: 'markdown',
       mappings: [
@@ -1261,7 +1241,6 @@ test('create virtual code w/ MDX layout in case of a default export preceded by
   ])
   assert.deepEqual(code.embeddedCodes, [
     {
-      embeddedCodes: [],
       id: 'jsx',
       languageId: 'javascriptreact',
       mappings: [
@@ -1341,7 +1320,6 @@ test('create virtual code w/ MDX layout in case of a default export preceded by
       )
     },
     {
-      embeddedCodes: [],
       id: 'md',
       languageId: 'markdown',
       mappings: [
@@ -1393,7 +1371,6 @@ test('create virtual code w/ mdxFlowExpression', () => {
   ])
   assert.deepEqual(code.embeddedCodes, [
     {
-      embeddedCodes: [],
       id: 'jsx',
       languageId: 'javascriptreact',
       mappings: [
@@ -1453,7 +1430,6 @@ test('create virtual code w/ mdxFlowExpression', () => {
       )
     },
     {
-      embeddedCodes: [],
       id: 'md',
       languageId: 'markdown',
       mappings: [
@@ -1514,7 +1490,6 @@ test('create virtual code w/ prefixed JSX expressions for mdxFlowExpression', ()
   ])
   assert.deepEqual(code.embeddedCodes, [
     {
-      embeddedCodes: [],
       id: 'jsx',
       languageId: 'javascriptreact',
       mappings: [
@@ -1596,7 +1571,6 @@ test('create virtual code w/ prefixed JSX expressions for mdxFlowExpression', ()
       )
     },
     {
-      embeddedCodes: [],
       id: 'md',
       languageId: 'markdown',
       mappings: [
@@ -1665,7 +1639,6 @@ test('create virtual code w/ prefixed JSX expressions in attributes', () => {
   ])
   assert.deepEqual(code.embeddedCodes, [
     {
-      embeddedCodes: [],
       id: 'jsx',
       languageId: 'javascriptreact',
       mappings: [
@@ -1747,7 +1720,6 @@ test('create virtual code w/ prefixed JSX expressions in attributes', () => {
       )
     },
     {
-      embeddedCodes: [],
       id: 'md',
       languageId: 'markdown',
       mappings: [
@@ -1826,7 +1798,6 @@ test('create virtual code w/ mdxJsxFlowElement w/ children', () => {
   ])
   assert.deepEqual(code.embeddedCodes, [
     {
-      embeddedCodes: [],
       id: 'jsx',
       languageId: 'javascriptreact',
       mappings: [
@@ -1917,7 +1888,6 @@ test('create virtual code w/ mdxJsxFlowElement w/ children', () => {
       )
     },
     {
-      embeddedCodes: [],
       id: 'md',
       languageId: 'markdown',
       mappings: [
@@ -1995,7 +1965,6 @@ test('create virtual code w/ mdxJsxFlowElement w/o children', () => {
   ])
   assert.deepEqual(code.embeddedCodes, [
     {
-      embeddedCodes: [],
       id: 'jsx',
       languageId: 'javascriptreact',
       mappings: [
@@ -2074,7 +2043,6 @@ test('create virtual code w/ mdxJsxFlowElement w/o children', () => {
       )
     },
     {
-      embeddedCodes: [],
       id: 'md',
       languageId: 'markdown',
       mappings: [
@@ -2133,7 +2101,6 @@ test('create virtual code w/ mdxJsxTextElement', () => {
   ])
   assert.deepEqual(code.embeddedCodes, [
     {
-      embeddedCodes: [],
       id: 'jsx',
       languageId: 'javascriptreact',
       mappings: [
@@ -2217,7 +2184,6 @@ test('create virtual code w/ mdxJsxTextElement', () => {
       )
     },
     {
-      embeddedCodes: [],
       id: 'md',
       languageId: 'markdown',
       mappings: [
@@ -2276,7 +2242,6 @@ test('create virtual code w/ mdxTextExpression', () => {
   ])
   assert.deepEqual(code.embeddedCodes, [
     {
-      embeddedCodes: [],
       id: 'jsx',
       languageId: 'javascriptreact',
       mappings: [
@@ -2340,7 +2305,6 @@ test('create virtual code w/ mdxTextExpression', () => {
       )
     },
     {
-      embeddedCodes: [],
       id: 'md',
       languageId: 'markdown',
       mappings: [
@@ -2395,7 +2359,6 @@ test('create virtual code w/ async mdxTextExpression', () => {
   ])
   assert.deepEqual(code.embeddedCodes, [
     {
-      embeddedCodes: [],
       id: 'jsx',
       languageId: 'javascriptreact',
       mappings: [
@@ -2459,7 +2422,6 @@ test('create virtual code w/ async mdxTextExpression', () => {
       )
     },
     {
-      embeddedCodes: [],
       id: 'md',
       languageId: 'markdown',
       mappings: [
@@ -2517,7 +2479,6 @@ test('create virtual code w/ dedented markdown content', () => {
   ])
   assert.deepEqual(code.embeddedCodes, [
     {
-      embeddedCodes: [],
       id: 'jsx',
       languageId: 'javascriptreact',
       mappings: [],
@@ -2565,7 +2526,6 @@ test('create virtual code w/ dedented markdown content', () => {
       )
     },
     {
-      embeddedCodes: [],
       id: 'md',
       languageId: 'markdown',
       mappings: [
@@ -2623,7 +2583,6 @@ test('create virtual code w/ syntax error', () => {
   ])
   assert.deepEqual(code.embeddedCodes, [
     {
-      embeddedCodes: [],
       id: 'jsx',
       languageId: 'javascriptreact',
       mappings: [],
@@ -2668,7 +2627,6 @@ test('create virtual code w/ syntax error', () => {
       )
     },
     {
-      embeddedCodes: [],
       id: 'md',
       languageId: 'markdown',
       mappings: [],
@@ -2706,7 +2664,6 @@ test('create virtual code w/ yaml frontmatter', () => {
   ])
   assert.deepEqual(code.embeddedCodes, [
     {
-      embeddedCodes: [],
       id: 'jsx',
       languageId: 'javascriptreact',
       mappings: [],
@@ -2751,7 +2708,6 @@ test('create virtual code w/ yaml frontmatter', () => {
       )
     },
     {
-      embeddedCodes: [],
       id: 'md',
       languageId: 'markdown',
       mappings: [
@@ -2772,7 +2728,6 @@ test('create virtual code w/ yaml frontmatter', () => {
       snapshot: snapshotFromLines('---', 'hello: frontmatter', '---', '')
     },
     {
-      embeddedCodes: [],
       id: 'yaml',
       languageId: 'yaml',
       mappings: [
@@ -2830,7 +2785,6 @@ test('update virtual code', () => {
   ])
   assert.deepEqual(code.embeddedCodes, [
     {
-      embeddedCodes: [],
       id: 'jsx',
       languageId: 'javascriptreact',
       mappings: [],
@@ -2878,7 +2832,6 @@ test('update virtual code', () => {
       )
     },
     {
-      embeddedCodes: [],
       id: 'md',
       languageId: 'markdown',
       mappings: [
@@ -2970,7 +2923,6 @@ test('support checkMdx', () => {
   ])
   assert.deepEqual(code.embeddedCodes, [
     {
-      embeddedCodes: [],
       id: 'jsx',
       languageId: 'javascriptreact',
       mappings: [],
@@ -3016,7 +2968,6 @@ test('support checkMdx', () => {
       )
     },
     {
-      embeddedCodes: [],
       id: 'md',
       languageId: 'markdown',
       mappings: [
@@ -3068,7 +3019,6 @@ test('support custom jsxImportSource', () => {
   ])
   assert.deepEqual(code.embeddedCodes, [
     {
-      embeddedCodes: [],
       id: 'jsx',
       languageId: 'javascriptreact',
       mappings: [],
@@ -3113,7 +3063,6 @@ test('support custom jsxImportSource', () => {
       )
     },
     {
-      embeddedCodes: [],
       id: 'md',
       languageId: 'markdown',
       mappings: [