Skip to content

Commit

Permalink
Update to Volar 2.0.0-alpha.7
Browse files Browse the repository at this point in the history
  • Loading branch information
remcohaszing committed Dec 17, 2023
1 parent d56db3d commit 5cd32d7
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 25 deletions.
8 changes: 4 additions & 4 deletions packages/language-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@
},
"dependencies": {
"@mdx-js/language-service": "0.3.0",
"@volar/language-server": "2.0.0-alpha.3",
"@volar/language-server": "2.0.0-alpha.7",
"load-plugin": "^5.0.0",
"remark-frontmatter": "^5.0.0",
"remark-gfm": "^4.0.0",
"volar-service-markdown": "0.0.20",
"volar-service-typescript": "0.0.20",
"volar-service-markdown": "0.0.22",
"volar-service-typescript": "0.0.22",
"vscode-uri": "^3.0.0"
},
"devDependencies": {
"@types/node": "^20.0.0",
"@types/normalize-path": "^3.0.0",
"@volar/test-utils": "2.0.0-alpha.3",
"@volar/test-utils": "2.0.0-alpha.7",
"normalize-path": "^3.0.0",
"unified": "^11.0.0"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/language-server/test/initialize.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ test('initialize', async () => {
},
serverInfo: {
name: '@volar/language-server',
version: '2.0.0-alpha.3'
version: '2.0.0-alpha.7'
}
})
})
2 changes: 1 addition & 1 deletion packages/language-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"dependencies": {
"@types/mdast": "^4.0.0",
"@types/unist": "^3.0.0",
"@volar/language-core": "2.0.0-alpha.3",
"@volar/language-core": "2.0.0-alpha.7",
"remark-mdx": "^3.0.0",
"remark-parse": "^11.0.0",
"unified": "^11.0.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/vscode-mdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
"@types/mdast": "^4.0.0",
"@types/node": "^20.0.0",
"@types/vscode": "^1.82.0",
"@volar/language-server": "2.0.0-alpha.3",
"@volar/vscode": "2.0.0-alpha.3",
"@volar/language-server": "2.0.0-alpha.7",
"@volar/vscode": "2.0.0-alpha.7",
"@vscode/vsce": "^2.0.0",
"esbuild": "^0.19.0",
"mdast-util-to-markdown": "^2.0.0",
Expand Down
21 changes: 4 additions & 17 deletions packages/vscode-mdx/src/extension.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* @typedef {import('@volar/vscode').ExportsInfoForLabs} ExportsInfoForLabs
* @typedef {import('vscode').ExtensionContext} ExtensionContext
* @typedef {import('vscode').TextDocument} TextDocument
*/

import * as languageServerProtocol from '@volar/language-server/protocol.js'
Expand Down Expand Up @@ -36,7 +35,7 @@ let disposable
*
* @param {ExtensionContext} context
* The extension context as given by VSCode.
* @returns {Promise<ExportsInfoForLabs | undefined>}
* @returns {Promise<ExportsInfoForLabs>}
* Info for the
* [Volar,js Labs](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volarjs-labs)
* extension.
Expand Down Expand Up @@ -71,7 +70,7 @@ export async function activate(context) {
return {
volarLabs: {
version: supportLabsVersion,
languageClients: [client],
languageClient: client,
languageServerProtocol
}
}
Expand Down Expand Up @@ -121,12 +120,12 @@ async function startServer(context) {
documentDropEditProvider
),
...(await Promise.all([
activateAutoInsertion([client], isMdxDocument),
activateAutoInsertion('mdx', client),
activateTsVersionStatusItem(
'mdx',
'mdx.selectTypescriptVersion',
context,
client,
isMdxDocument,
(text) => 'TS ' + text
)
]))
Expand All @@ -135,15 +134,3 @@ async function startServer(context) {
)
}
}

/**
* Check whether or not a text document is MDX.
*
* @param {TextDocument} document
* The text document to check.
* @returns {boolean}
* Whether or not the text document is MDX.
*/
function isMdxDocument(document) {
return document.languageId === 'mdx'
}

0 comments on commit 5cd32d7

Please sign in to comment.