Skip to content

Commit

Permalink
Support formatting of MDX ESM
Browse files Browse the repository at this point in the history
  • Loading branch information
remcohaszing committed Feb 22, 2024
1 parent 5249d77 commit c1277b2
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 17 deletions.
7 changes: 7 additions & 0 deletions .changeset/sour-pandas-arrive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@mdx-js/language-service": patch
"@mdx-js/language-server": patch
"vscode-mdx": patch
---

Support formatting of MDX ESM
2 changes: 1 addition & 1 deletion packages/language-service/lib/virtual-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ function getEmbeddedCodes(mdx, ast, checkMdx, jsxImportSource) {
lengths: [],
data: {
completion: true,
format: false,
format: true,
navigation: true,
semantic: true,
structure: true,
Expand Down
32 changes: 16 additions & 16 deletions packages/language-service/test/language-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ test('create virtual code w/ mdxjsEsm', () => {
lengths: [35],
data: {
completion: true,
format: false,
format: true,
navigation: true,
semantic: true,
structure: true,
Expand Down Expand Up @@ -165,7 +165,7 @@ test('create virtual code w/o MDX layout in case of named re-export', () => {
lengths: [34],
data: {
completion: true,
format: false,
format: true,
navigation: true,
semantic: true,
structure: true,
Expand Down Expand Up @@ -278,7 +278,7 @@ test('create virtual code w/ MDX layout in case of default re-export', () => {
lengths: [8, 21],
data: {
completion: true,
format: false,
format: true,
navigation: true,
semantic: true,
structure: true,
Expand Down Expand Up @@ -395,7 +395,7 @@ test('create virtual code w/ MDX layout in case of named and default re-export',
lengths: [15, 21],
data: {
completion: true,
format: false,
format: true,
navigation: true,
semantic: true,
structure: true,
Expand Down Expand Up @@ -512,7 +512,7 @@ test('create virtual code w/ MDX layout in case of default and named re-export',
lengths: [8, 27],
data: {
completion: true,
format: false,
format: true,
navigation: true,
semantic: true,
structure: true,
Expand Down Expand Up @@ -626,7 +626,7 @@ test('create virtual code w/ MDX layout in case of a default exported arrow func
lengths: [9],
data: {
completion: true,
format: false,
format: true,
navigation: true,
semantic: true,
structure: true,
Expand Down Expand Up @@ -756,7 +756,7 @@ test('create virtual code w/ MDX layout in case of a default exported function d
lengths: [24],
data: {
completion: true,
format: false,
format: true,
navigation: true,
semantic: true,
structure: true,
Expand Down Expand Up @@ -885,7 +885,7 @@ test('create virtual code w/ MDX layout in case of a default exported constant',
lengths: [7],
data: {
completion: true,
format: false,
format: true,
navigation: true,
semantic: true,
structure: true,
Expand Down Expand Up @@ -1002,7 +1002,7 @@ test('create virtual code w/ MDX layout and matching argument name', () => {
lengths: [34],
data: {
completion: true,
format: false,
format: true,
navigation: true,
semantic: true,
structure: true,
Expand Down Expand Up @@ -1135,7 +1135,7 @@ test('create virtual code w/ MDX layout in case of a default export followed by
lengths: [51],
data: {
completion: true,
format: false,
format: true,
navigation: true,
semantic: true,
structure: true,
Expand Down Expand Up @@ -1271,7 +1271,7 @@ test('create virtual code w/ MDX layout in case of a default export preceded by
lengths: [27, 24],
data: {
completion: true,
format: false,
format: true,
navigation: true,
semantic: true,
structure: true,
Expand Down Expand Up @@ -1524,7 +1524,7 @@ test('create virtual code w/ prefixed JSX expressions for mdxFlowExpression', ()
lengths: [27],
data: {
completion: true,
format: false,
format: true,
navigation: true,
semantic: true,
structure: true,
Expand Down Expand Up @@ -1675,7 +1675,7 @@ test('create virtual code w/ prefixed JSX expressions in attributes', () => {
lengths: [27],
data: {
completion: true,
format: false,
format: true,
navigation: true,
semantic: true,
structure: true,
Expand Down Expand Up @@ -1836,7 +1836,7 @@ test('create virtual code w/ mdxJsxFlowElement w/ children', () => {
lengths: [27],
data: {
completion: true,
format: false,
format: true,
navigation: true,
semantic: true,
structure: true,
Expand Down Expand Up @@ -2005,7 +2005,7 @@ test('create virtual code w/ mdxJsxFlowElement w/o children', () => {
lengths: [27],
data: {
completion: true,
format: false,
format: true,
navigation: true,
semantic: true,
structure: true,
Expand Down Expand Up @@ -2143,7 +2143,7 @@ test('create virtual code w/ mdxJsxTextElement', () => {
lengths: [27],
data: {
completion: true,
format: false,
format: true,
navigation: true,
semantic: true,
structure: true,
Expand Down

0 comments on commit c1277b2

Please sign in to comment.