[Question]: How to enable vitepress support with LSP alone. #4655
-
It seems in #4321, the only way to enable vitepress is through config vscode extension, e.g. option So my question is currently is there a way to enable with LSP alone if I config vue LSP to attach to markdown files? Tried the steps in the PR description without vscode step as I am not using it, but does not work. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Setting
If you only use LSP (without hybrid mode), step 1 is not required. |
Beta Was this translation helpful? Give feedback.
-
@RayGuo-ergou Mind sharing your config? I am struggling with this; I did a little search on your dotfile repo but failed to find it. Does this require a tsconfig.json?(I don't have one) With the following config, volar can attach to markdown but no intellisense provided require('lspconfig').ts_ls.setup({
init_options = {
plugins = {
{
name = '@vue/typescript-plugin',
location = vim.fs.joinpath(
vim.fs.dirname(vim.fs.dirname(vim.fn.system('echo -n $(readlink -f $(which vue-language-server))'))),
'lib/node_modules/@vue/language-server'
),
languages = { 'vue', 'markdown' },
},
},
},
filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' },
})
require('lspconfig').volar.setup({
filetypes = { 'markdown' },
})
|
Beta Was this translation helpful? Give feedback.
Setting
vue.server.includeLanguages
in VSCode has two purposes:language-tools/extensions/vscode/src/nodeClientMain.ts
Line 154 in 923f835
LanguageClientOptions.documentSelector
of LanguageClient:language-tools/extensions/vscode/src/common.ts
Lines 217 to 222 in 923f835
If you only use LSP (without hybrid mode), step 1 is not required.