Skip to content

Commit

Permalink
Integrate Volar (#340)
Browse files Browse the repository at this point in the history
- Volar handles the mapping between TypeScript and LSP.
- Volar handles the mapping between TypeScript and Monaco editor.
- Volar manages virtual files.
- Volar imports TypeScript directly. As a result, the Monaco editor integration now requires `path` to be polyfilled.
- `@mdx-js/monaco` is deprecated and removed.
- This adds `remark-frontmatter` with TOML and YAML support as well as `remark-gfm` by default unless specified otherwise in `tsconfig.json`.
- The language server now requires `typescript.tsdk` to be passed via initialization options.
- This adds support for debugging virtual documents using Volar labs.

Closes #168
Closes #284
Closes #295
Closes #298
Closes #301

Co-authored-by: Christian Murphy <christian.murphy.42@gmail.com>
Co-authored-by: Johnson Chu <johnsoncodehk@gmail.com>
  • Loading branch information
3 people committed Oct 23, 2023
1 parent 4dbf0ec commit 045458d
Show file tree
Hide file tree
Showing 73 changed files with 1,885 additions and 4,652 deletions.
6 changes: 6 additions & 0 deletions .changeset/get-language-module.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@mdx-js/language-service': minor
---

Add function `getLanguageModule`.
This function returns a [Volar](https://volarjs.dev) language module,
6 changes: 6 additions & 0 deletions .changeset/language-server.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@mdx-js/language-server': minor---
'vscode-mdx': minor
---

The language server and Visual Studio Code extension are now based on [Volar](https://volarjs.dev).
6 changes: 6 additions & 0 deletions .changeset/monaco.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@mdx-js/monaco': minor
---

Remove `@mdx-js/monaco`.
Use [`@volar/monaco`](https://github.com/volarjs/volar.js/tree/master/packages/monaco) and `@mdx-js/language-service` instead.
5 changes: 5 additions & 0 deletions .changeset/pretty-files-sell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@mdx-js/language-service': minor
---

Remove `createMdxLanguageService`.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* text eol=lf
*.png binary diff=image
6 changes: 1 addition & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,11 @@ jobs:
with:
node-version: ${{matrix.node}}
- run: npm install
- run: npx playwright install --with-deps
- run: npm test
strategy:
matrix:
os:
- ubuntu-latest
# We should test on Windows, because the language server deals with
# the file system.
# Currently blocked by https://github.com/remcohaszing/playwright-monaco/issues/1
# - windows-latest
- windows-latest
node:
- 18
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ It contains the following workspaces:
can handle MDX files.
* [`@mdx-js/language-server`][] provides MDX IntelliSense using the
[Language Server Protocol][].
* [`@mdx-js/monaco`][] provides MDX IntelliSense for [Monaco editor][].
* [`vscode-mdx`][] provides MDX IntelliSense and basic language support for
[Visual Studio Code][].

Expand Down Expand Up @@ -92,8 +91,6 @@ See [§ Sponsor][sponsor] on our site for how to help financially.

[MIT][] © [JounQin][]@[1stG.me][]

[`@mdx-js/monaco`]: https://github.com/mdx-js/mdx-analyzer/tree/main/packages/monaco

[`@mdx-js/language-server`]: https://github.com/mdx-js/mdx-analyzer/tree/main/packages/language-server

[`@mdx-js/language-service`]: https://github.com/mdx-js/mdx-analyzer/tree/main/packages/language-service
Expand All @@ -108,8 +105,6 @@ See [§ Sponsor][sponsor] on our site for how to help financially.

[mdx]: https://github.com/mdx-js/mdx

[monaco editor]: https://microsoft.github.io/monaco-editor/

[mit]: http://opensource.org/licenses/MIT

[sponsor]: https://mdxjs.com/community/sponsor/
Expand Down
21 changes: 0 additions & 21 deletions demo/LICENSE

This file was deleted.

52 changes: 0 additions & 52 deletions demo/README.md

This file was deleted.

23 changes: 0 additions & 23 deletions demo/package.json

This file was deleted.

160 changes: 0 additions & 160 deletions demo/src/index.css

This file was deleted.

28 changes: 0 additions & 28 deletions demo/src/index.ejs

This file was deleted.

0 comments on commit 045458d

Please sign in to comment.