language-tools: Volar crashes shortly after after startup
Volar seems to start fine, shows a few diagnostics, and then dies after a second or two.
I’m running it containerised (via podman
). I looked at #514, but I’m not convinced I’m seeing the same issue.
This is all of neovim’s debug output for the LSP:
[START][2021-11-17 18:23:37] LSP logging initiated
[INFO][2021-11-17 18:23:37] .../vim/lsp/rpc.lua:258 "Starting RPC client" { args = { "container", "run", "--interactive", "--network=none", "--workdir=/home/hugo/clones/gitlab.com/fotus/photostore/vue3", "--volume=/home/hugo/clones/gitlab.com/fotus/photostore/vue3:/home/hugo/clones/gitlab.com/fotus/photostore/vue3:ro", "volar" }, cmd = "podman", extra = {}}
[DEBUG][2021-11-17 18:23:37] .../vim/lsp/rpc.lua:339 "rpc.send" { id = 1, jsonrpc = "2.0", method = "initialize", params = { capabilities = { callHierarchy = { dynamicRegistration = false }, textDocument = { codeAction = { codeActionLiteralSupport = { codeActionKind = { valueSet = { "", "Empty", "QuickFix", "Refactor", "RefactorExtract", "RefactorInline", "RefactorRewrite", "Source", "SourceOrganizeImports", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" } } }, dataSupport = true, dynamicRegistration = false, resolveSupport = { properties = { "edit" } } }, completion = { completionItem = { commitCharactersSupport = false, deprecatedSupport = false, documentationFormat = { "markdown", "plaintext" }, preselectSupport = false, snippetSupport = false }, completionItemKind = { valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 } }, contextSupport = false, dynamicRegistration = false }, declaration = { linkSupport = true }, definition = { linkSupport = true }, documentHighlight = { dynamicRegistration = false }, documentSymbol = { dynamicRegistration = false, hierarchicalDocumentSymbolSupport = true, symbolKind = { valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 } } }, hover = { contentFormat = { "markdown", "plaintext" }, dynamicRegistration = false }, implementation = { linkSupport = true }, publishDiagnostics = { relatedInformation = true, tagSupport = { valueSet = { 1, 2 } } }, references = { dynamicRegistration = false }, rename = { dynamicRegistration = false, prepareSupport = true }, signatureHelp = { dynamicRegistration = false, signatureInformation = { activeParameterSupport = true, documentationFormat = { "markdown", "plaintext" }, parameterInformation = { labelOffsetSupport = true } } }, synchronization = { didSave = true, dynamicRegistration = false, willSave = false, willSaveWaitUntil = false }, typeDefinition = { linkSupport = true } }, window = { showDocument = { support = false }, showMessage = { messageActionItem = { additionalPropertiesSupport = false } }, workDoneProgress = true }, workspace = { applyEdit = true, configuration = true, symbol = { dynamicRegistration = false, hierarchicalWorkspaceSymbolSupport = true, symbolKind = { valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 } } }, workspaceEdit = { resourceOperations = { "rename", "create", "delete" } }, workspaceFolders = true } }, clientInfo = { name = "Neovim", version = "0.6.0" }, initializationOptions = { documentFeatures = { documentColor = false, documentFormatting = { defaultPrintWidth = 100 }, documentSymbol = true, foldingRange = true, linkedEditingRange = true, selectionRange = true }, languageFeatures = { callHierarchy = true, codeAction = true, codeLens = true, completion = { defaultAttrNameCase = "kebabCase", defaultTagNameCase = "both" }, definition = true, diagnostics = true, documentHighlight = true, documentLink = true, hover = true, references = true, rename = true, renameFileRefactoring = true, schemaRequestService = true, semanticTokens = false, signatureHelp = true, typeDefinition = true }, typescript = { serverPath = "/home/hugo/clones/gitlab.com/fotus/photostore/vue3/node_modules/typescript/lib/tsserverlibrary.js" } }, processId = 1117809, rootPath = "/home/hugo/clones/gitlab.com/fotus/photostore/vue3", rootUri = "file:///home/hugo/clones/gitlab.com/fotus/photostore/vue3", trace = "off", workspaceFolders = { { name = "/home/hugo/clones/gitlab.com/fotus/photostore/vue3", uri = "file:///home/hugo/clones/gitlab.com/fotus/photostore/vue3" } } }}
[DEBUG][2021-11-17 18:23:37] .../lua/vim/lsp.lua:871 "LSP[null-ls]" "server_capabilities" { codeActionProvider = true, completionProvider = { allCommitCharacters = {}, completionItem = { labelDetailsSupport = true }, resolveProvider = false, triggerCharacters = { ".", ":", "-" } }, documentFormattingProvider = true, documentRangeFormattingProvider = true, executeCommandProvider = true, textDocumentSync = { change = 1, openClose = true, save = true }}
[INFO][2021-11-17 18:23:37] .../lua/vim/lsp.lua:872 "LSP[null-ls]" "initialized" { resolved_capabilities = { call_hierarchy = false, code_action = true, code_lens = false, code_lens_resolve = false, completion = true, declaration = false, document_formatting = true, document_highlight = false, document_range_formatting = true, document_symbol = false, execute_command = true, find_references = false, goto_definition = false, hover = false, implementation = false, rename = false, signature_help = false, signature_help_trigger_characters = {}, text_document_did_change = 1, text_document_open_close = true, text_document_save = true, text_document_save_include_text = false, text_document_will_save = false, text_document_will_save_wait_until = false, type_definition = false, workspace_folder_properties = { changeNotifications = false, supported = false }, workspace_symbol = false }}
[DEBUG][2021-11-17 18:23:39] .../vim/lsp/rpc.lua:446 "rpc.receive" { id = 1, jsonrpc = "2.0", result = { capabilities = { callHierarchyProvider = true, codeActionProvider = { codeActionKinds = { "", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.fixAll", "source.organizeImports" }, resolveProvider = true }, codeLensProvider = { resolveProvider = true }, completionProvider = { resolveProvider = true, triggerCharacters = { ".", '"', "'", "`", "/", "<", "@", "#", " ", "<", ":", "@", ".", "/", ".", "@", "/", '"', ":" } }, definitionProvider = true, documentFormattingProvider = true, documentHighlightProvider = true, documentLinkProvider = { resolveProvider = false }, documentSymbolProvider = true, executeCommandProvider = { commands = { "volar.server.executeConvertToKebabCase", "volar.server.executeConvertToPascalCase", "volar.html-to-pug", "volar.pug-to-html", "volar.use-setup-sugar", "volar.unuse-setup-sugar", "volar.use-ref-sugar", "volar.unuse-ref-sugar", "volar.show-references" } }, foldingRangeProvider = true, hoverProvider = true, linkedEditingRangeProvider = true, referencesProvider = true, renameProvider = { prepareProvider = true }, selectionRangeProvider = true, signatureHelpProvider = { retriggerCharacters = { ")" }, triggerCharacters = { "(", ",", "<" } }, textDocumentSync = 2, typeDefinitionProvider = true, workspace = { fileOperations = { willRename = { filters = { { pattern = { glob = "**/*.vue" } }, { pattern = { glob = "**/*.js" } }, { pattern = { glob = "**/*.ts" } }, { pattern = { glob = "**/*.jsx" } }, { pattern = { glob = "**/*.tsx" } }, { pattern = { glob = "**/*.json" } } } } } } } }}
[DEBUG][2021-11-17 18:23:39] .../vim/lsp/rpc.lua:339 "rpc.send" { jsonrpc = "2.0", method = "initialized", params = vim.empty_dict()}
[DEBUG][2021-11-17 18:23:39] .../lua/vim/lsp.lua:871 "LSP[volar]" "server_capabilities" { callHierarchyProvider = true, codeActionProvider = { codeActionKinds = { "", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.fixAll", "source.organizeImports" }, resolveProvider = true }, codeLensProvider = { resolveProvider = true }, completionProvider = { resolveProvider = true, triggerCharacters = { ".", '"', "'", "`", "/", "<", "@", "#", " ", "<", ":", "@", ".", "/", ".", "@", "/", '"', ":" } }, definitionProvider = true, documentFormattingProvider = true, documentHighlightProvider = true, documentLinkProvider = { resolveProvider = false }, documentSymbolProvider = true, executeCommandProvider = { commands = { "volar.server.executeConvertToKebabCase", "volar.server.executeConvertToPascalCase", "volar.html-to-pug", "volar.pug-to-html", "volar.use-setup-sugar", "volar.unuse-setup-sugar", "volar.use-ref-sugar", "volar.unuse-ref-sugar", "volar.show-references" } }, foldingRangeProvider = true, hoverProvider = true, linkedEditingRangeProvider = true, referencesProvider = true, renameProvider = { prepareProvider = true }, selectionRangeProvider = true, signatureHelpProvider = { retriggerCharacters = { ")" }, triggerCharacters = { "(", ",", "<" } }, textDocumentSync = 2, typeDefinitionProvider = true, workspace = { fileOperations = { willRename = { filters = { { pattern = { glob = "**/*.vue" } }, { pattern = { glob = "**/*.js" } }, { pattern = { glob = "**/*.ts" } }, { pattern = { glob = "**/*.jsx" } }, { pattern = { glob = "**/*.tsx" } }, { pattern = { glob = "**/*.json" } } } } } }}
[INFO][2021-11-17 18:23:39] .../lua/vim/lsp.lua:872 "LSP[volar]" "initialized" { resolved_capabilities = { call_hierarchy = true, code_action = { codeActionKinds = { "", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.fixAll", "source.organizeImports" }, resolveProvider = true }, code_lens = true, code_lens_resolve = true, completion = true, declaration = false, document_formatting = true, document_highlight = true, document_range_formatting = false, document_symbol = true, execute_command = true, find_references = true, goto_definition = true, hover = true, implementation = false, rename = true, signature_help = true, signature_help_trigger_characters = { "(", ",", "<" }, text_document_did_change = 2, text_document_open_close = true, text_document_save = true, text_document_save_include_text = false, text_document_will_save = false, text_document_will_save_wait_until = false, type_definition = true, workspace_folder_properties = { changeNotifications = false, supported = false }, workspace_symbol = false }}
[DEBUG][2021-11-17 18:23:39] .../vim/lsp/rpc.lua:339 "rpc.send" { jsonrpc = "2.0", method = "textDocument/didOpen", params = { textDocument = { languageId = "vue", text = "<script setup lang=\"ts\">\n// This starter template is using Vue 3 <script setup> SFCs\n// Check out https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup\nimport HelloWorld from './components/HelloWorld.vue'\n</script>\n\n<template>\n <img alt=\"Vue logo\" src=\"./assets/logo.png\" />\n <HelloWorld msg=\"Hello Vue 3 + TypeScript + Vite\" />\n</template>\n\n<style>\n#app {\n font-family: Avenir, Helvetica, Arial, sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n text-align: center;\n color: #2c3e50;\n margin-top: 60px;\n}\n</style>\n", uri = "file:///home/hugo/clones/gitlab.com/fotus/photostore/vue3/src/App.vue", version = 0 } }}
[DEBUG][2021-11-17 18:23:39] .../vim/lsp/rpc.lua:446 "rpc.receive" { id = 0, jsonrpc = "2.0", method = "workspace/configuration", params = { items = { { section = "js/ts.implicitProjectConfig" }, { section = "javascript.implicitProjectConfig" } } }}
[DEBUG][2021-11-17 18:23:39] .../vim/lsp/rpc.lua:456 "server_request: callback result" { result = { vim.NIL, vim.NIL }, status = true}
[DEBUG][2021-11-17 18:23:39] .../vim/lsp/rpc.lua:339 "rpc.send" { id = 0, jsonrpc = "2.0", result = { vim.NIL, vim.NIL }}
[DEBUG][2021-11-17 18:23:39] .../vim/lsp/rpc.lua:446 "rpc.receive" { id = 1, jsonrpc = "2.0", method = "window/workDoneProgress/create", params = { token = "0c7a079c-9559-4888-8bdd-a05231f1655d" }}
[DEBUG][2021-11-17 18:23:39] .../vim/lsp/rpc.lua:456 "server_request: callback result" { result = vim.NIL, status = true}
[DEBUG][2021-11-17 18:23:39] .../vim/lsp/rpc.lua:339 "rpc.send" { id = 1, jsonrpc = "2.0", result = vim.NIL}
[DEBUG][2021-11-17 18:23:39] .../vim/lsp/rpc.lua:446 "rpc.receive" { id = 2, jsonrpc = "2.0", method = "workspace/configuration", params = { items = { { scopeUri = "file:///home/hugo/clones/gitlab.com/fotus/photostore/vue3/src/App.vue.template.css", section = "css" } } }}
[DEBUG][2021-11-17 18:23:39] .../vim/lsp/rpc.lua:456 "server_request: callback result" { result = { vim.NIL }, status = true}
[DEBUG][2021-11-17 18:23:39] .../vim/lsp/rpc.lua:339 "rpc.send" { id = 2, jsonrpc = "2.0", result = { vim.NIL }}
[DEBUG][2021-11-17 18:23:39] .../vim/lsp/rpc.lua:446 "rpc.receive" { id = 3, jsonrpc = "2.0", method = "workspace/configuration", params = { items = { { scopeUri = "file:///home/hugo/clones/gitlab.com/fotus/photostore/vue3/src/App.vue.0.css", section = "css" } } }}
[DEBUG][2021-11-17 18:23:39] .../vim/lsp/rpc.lua:456 "server_request: callback result" { result = { vim.NIL }, status = true}
[DEBUG][2021-11-17 18:23:39] .../vim/lsp/rpc.lua:339 "rpc.send" { id = 3, jsonrpc = "2.0", result = { vim.NIL }}
[INFO][2021-11-17 18:23:44] .../lua/vim/lsp.lua:1236 "exit_handler" { { _null_ls_setup = true, _on_attach = <function 1>, attached_buffers = { true }, cancel_request = <function 2>, config = { _on_attach = <function 3>, autostart = false, capabilities = { callHierarchy = { dynamicRegistration = false }, textDocument = { codeAction = { codeActionLiteralSupport = { codeActionKind = { valueSet = { "", "Empty", "QuickFix", "Refactor", "RefactorExtract", "RefactorInline", "RefactorRewrite", "Source", "SourceOrganizeImports", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" } } }, dataSupport = true, dynamicRegistration = false, resolveSupport = { properties = { "edit" } } }, completion = { completionItem = { commitCharactersSupport = false, deprecatedSupport = false, documentationFormat = { "markdown", "plaintext" }, preselectSupport = false, snippetSupport = false }, completionItemKind = { valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 } }, contextSupport = false, dynamicRegistration = false }, declaration = { linkSupport = true }, definition = { linkSupport = true }, documentHighlight = { dynamicRegistration = false }, documentSymbol = { dynamicRegistration = false, hierarchicalDocumentSymbolSupport = true, symbolKind = { valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 } } }, hover = { contentFormat = { "markdown", "plaintext" }, dynamicRegistration = false }, implementation = { linkSupport = true }, publishDiagnostics = { relatedInformation = true, tagSupport = { valueSet = { 1, 2 } } }, references = { dynamicRegistration = false }, rename = { dynamicRegistration = false, prepareSupport = true }, signatureHelp = { dynamicRegistration = false, signatureInformation = { activeParameterSupport = true, documentationFormat = { "markdown", "plaintext" }, parameterInformation = { labelOffsetSupport = true } } }, synchronization = { didSave = true, dynamicRegistration = false, willSave = false, willSaveWaitUntil = false }, typeDefinition = { linkSupport = true } }, window = { showDocument = { support = false }, showMessage = { messageActionItem = { additionalPropertiesSupport = false } }, workDoneProgress = true }, workspace = { applyEdit = true, configuration = true, symbol = { dynamicRegistration = false, hierarchicalWorkspaceSymbolSupport = true, symbolKind = { valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 } } }, workspaceEdit = { resourceOperations = { "rename", "create", "delete" } }, workspaceFolders = true } }, cmd = { "nvim" }, cwd = "/home/hugo/clones/gitlab.com/fotus/photostore", filetypes = { "javascript", "typescript", "typescriptreact", "javascriptreact", "vue", "python", "sh", "zsh", "html", "scss", "json", "graphql", "less", "markdown", "yaml", "css", "lua" }, flags = { debounce_text_changes = 250 }, get_language_id = <function 4>, handlers = <1>{}, init_options = vim.empty_dict(), log_level = 2, message_level = 2, name = "null-ls", on_attach = <function 5>, on_exit = <function 6>, on_init = <function 7>, root_dir = "/home/hugo/clones/gitlab.com/fotus/photostore", settings = vim.empty_dict(), workspace_folders = <2>{ { name = "/home/hugo/clones/gitlab.com/fotus/photostore", uri = "file:///home/hugo/clones/gitlab.com/fotus/photostore" } }, <metatable> = <3>{ __tostring = <function 8> } }, handlers = <table 1>, id = 1, initialized = true, is_stopped = <function 9>, messages = { messages = {}, name = "null-ls", progress = {}, status = {} }, name = "null-ls", notify = <function 10>, offset_encoding = "utf-16", request = <function 11>, request_sync = <function 12>, requests = {}, resolved_capabilities = { call_hierarchy = false, code_action = true, code_lens = false, code_lens_resolve = false, completion = true, declaration = false, document_formatting = true, document_highlight = false, document_range_formatting = true, document_symbol = false, execute_command = true, find_references = false, goto_definition = false, hover = false, implementation = false, rename = false, signature_help = false, signature_help_trigger_characters = {}, text_document_did_change = 1, text_document_open_close = true, text_document_save = true, text_document_save_include_text = false, text_document_will_save = false, text_document_will_save_wait_until = false, type_definition = false, workspace_folder_properties = { changeNotifications = false, supported = false }, workspace_symbol = false }, rpc = { handle = { is_closing = <function 13>, kill = <function 14> }, notify = <function 15>, pid = 5001, request = <function 16> }, server_capabilities = { codeActionProvider = true, completionProvider = { allCommitCharacters = {}, completionItem = { labelDetailsSupport = true }, resolveProvider = false, triggerCharacters = { ".", ":", "-" } }, documentFormattingProvider = true, documentRangeFormattingProvider = true, executeCommandProvider = true, textDocumentSync = { change = 1, openClose = true, save = true } }, stop = <function 17>, supports_method = <function 18>, workspaceFolders = <table 2>, workspace_did_change_configuration = <function 19> } }
I’m actualy just using the same project generated via npm init vite@latest
, and the picking vue-ts
. I haven’t made any changes to it.
This is the Dockerfile
for the container I’m using:
FROM alpine:3.13.5
RUN apk add --no-cache nodejs npm
RUN npm install -g @volar/server
CMD [ "volar-server", "--stdio" ]
Any hints on what could be up?
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 20 (15 by maintainers)
Oh, actually, that feature can be disabled by using:
I guess there’s not much to be done here. https://github.com/microsoft/vscode-languageserver-node/issues/857 should suffice for improving the experience when other hit this same issue. Feel free to close this.
Can you try with the podman/docker arg
--pid=host
?@sethidden Thank you for your efforts!
Nice, yes, this works!
I wonder if this auto-detection can be disabled for the LSP through some flag. Other LSPs don’t have this detection-of-parent (at least I assume they don’t or they’d exit immediately), and this check assumes that the server is running on the same host as the client which isn’t always the case.
I appreciate the help debugging this, I don’t think I would have ever figured it out.
Generally you probably want to do this for containerizing language servers as many servers check the PID of the client that spawned them for self-termination, I think omnisharp does this as well.
See also https://github.com/neovim/nvim-lspconfig/issues/1436