-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This also adds customization of markdown based validation.
- Loading branch information
1 parent
b508976
commit 46bfd50
Showing
10 changed files
with
165 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@mdx-js/language-server": minor | ||
"vscode-mdx": minor | ||
--- | ||
|
||
Add customization options for markdown validation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
--- | ||
|
||
Update to Volar 2.0.0-alpha.10. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,73 @@ | ||
#!/usr/bin/env node | ||
import assert from 'node:assert' | ||
import process from 'node:process' | ||
import { | ||
createMdxLanguagePlugin, | ||
createMdxServicePlugin | ||
} from '@mdx-js/language-service' | ||
import { | ||
createConnection, | ||
startTypeScriptServer | ||
createNodeServer, | ||
createTypeScriptProjectProvider | ||
} from '@volar/language-server/node.js' | ||
import {plugin} from './lib/language-server-plugin.js' | ||
import {create as createMarkdownServicePlugin} from 'volar-service-markdown' | ||
import {create as createTypeScriptServicePlugin} from 'volar-service-typescript' | ||
import {loadPlugins} from './lib/configuration.js' | ||
|
||
process.title = 'mdx-language-server' | ||
|
||
startTypeScriptServer(createConnection(), plugin) | ||
const connection = createConnection() | ||
const server = createNodeServer(connection) | ||
|
||
connection.onInitialize((parameters) => | ||
server.initialize(parameters, createTypeScriptProjectProvider, { | ||
watchFileExtensions: [ | ||
'cjs', | ||
'cts', | ||
'js', | ||
'jsx', | ||
'json', | ||
'mdx', | ||
'mjs', | ||
'mts', | ||
'ts', | ||
'tsx' | ||
], | ||
|
||
getServerCapabilitiesSetup() { | ||
assert(server.modules.typescript, 'TypeScript module is missing') | ||
|
||
return { | ||
servicePlugins: [ | ||
createMarkdownServicePlugin({configurationSection: 'mdx.validate'}), | ||
createMdxServicePlugin(), | ||
createTypeScriptServicePlugin(server.modules.typescript) | ||
] | ||
} | ||
}, | ||
|
||
async getProjectSetup(serviceEnvironment, projectContext) { | ||
assert(server.modules.typescript, 'TypeScript module is missing') | ||
|
||
const plugins = await loadPlugins( | ||
projectContext?.typescript?.configFileName, | ||
server.modules.typescript | ||
) | ||
|
||
return { | ||
languagePlugins: [createMdxLanguagePlugin(plugins)], | ||
servicePlugins: [ | ||
createMarkdownServicePlugin({configurationSection: 'mdx.validate'}), | ||
createMdxServicePlugin(), | ||
createTypeScriptServicePlugin(server.modules.typescript) | ||
] | ||
} | ||
} | ||
}) | ||
) | ||
|
||
connection.onInitialized(() => { | ||
server.initialized() | ||
}) | ||
|
||
connection.listen() |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters