Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using Volar in Neovim, it failed, with some failure logs #862

Closed
lqfxz520 opened this issue Jan 14, 2022 · 11 comments
Closed

When using Volar in Neovim, it failed, with some failure logs #862

lqfxz520 opened this issue Jan 14, 2022 · 11 comments

Comments

@lqfxz520
Copy link

I used Volar in two projects, one not running and the other running.
The difference between a project that does not run and a project that does run is larger.

[START][2022-01-14 15:31:34] LSP logging initiated
[INFO][2022-01-14 15:31:38] .../vim/lsp/rpc.lua:261	"Starting RPC client"	{  args = { "--stdio" },  cmd = "volar-server",  extra = {    cwd = "/home/kiteboy/erp.web.portal"  }}
[DEBUG][2022-01-14 15:31:38] .../vim/lsp/rpc.lua:347	"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 = true,            deprecatedSupport = true,            documentationFormat = { "markdown", "plaintext" },            insertReplaceSupport = true,            labelDetailsSupport = true,            preselectSupport = true,            resolveSupport = {              properties = { "documentation", "detail", "additionalTextEdits" }            },            snippetSupport = true,            tagSupport = {              valueSet = { 1 }            }          },          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.1"    },    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 = "/usr/local/lib/node_modules/typescript/lib/tsserverlibrary.js"      }    },    processId = 2797,    rootPath = "/home/kiteboy/erp.web.portal",    rootUri = "file:///home/kiteboy/erp.web.portal",    trace = "off",    workspaceFolders = { {        name = "/home/kiteboy/erp.web.portal",        uri = "file:///home/kiteboy/erp.web.portal"      } }  }}
[INFO][2022-01-14 15:31:38] .../vim/lsp/rpc.lua:261	"Starting RPC client"	{  args = { "--stdio" },  cmd = "diagnostic-languageserver",  extra = {    cwd = "/home/kiteboy/erp.web.portal"  }}
[DEBUG][2022-01-14 15:31:38] .../vim/lsp/rpc.lua:347	"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 = true,            deprecatedSupport = true,            documentationFormat = { "markdown", "plaintext" },            insertReplaceSupport = true,            labelDetailsSupport = true,            preselectSupport = true,            resolveSupport = {              properties = { "documentation", "detail", "additionalTextEdits" }            },            snippetSupport = true,            tagSupport = {              valueSet = { 1 }            }          },          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.1"    },    initializationOptions = {      filetypes = {        javascript = "eslint",        javascriptreact = "eslint",        typescript = "eslint",        typescriptreact = "eslint"      },      formatFiletypes = {        css = "prettier",        javascript = "prettier",        javascriptreact = "prettier",        json = "prettier",        less = "prettier",        markdown = "prettier",        scss = "prettier",        typescript = "prettier",        typescriptreact = "prettier"      },      formatters = {        eslint_d = {          args = { "--stdin", "--stdin-filename", "%filename", "--fix-to-stdout" },          command = "eslint_d",          rootPatterns = { ".git" }        },        prettier = {          args = { "--stdin", "--stdin-filepath", "%filename" },          command = "prettier_d_slim",          rootPatterns = { ".git" }        }      },      linters = {        eslint = {          args = { "--stdin", "--stdin-filename", "%filepath", "--format", "json" },          command = "eslint_d",          debounce = 100,          parseJson = {            column = "column",            endColumn = "endColumn",            endLine = "endLine",            errorsRoot = "[0].messages",            line = "line",            message = "[eslint] ${message} [${ruleId}]",            security = "severity"          },          rootPatterns = { ".git" },          securities = { "warning", "error" },          sourceName = "eslint_d"        }      }    },    processId = 2797,    rootPath = "/home/kiteboy/erp.web.portal",    rootUri = "file:///home/kiteboy/erp.web.portal",    trace = "off",    workspaceFolders = { {        name = "/home/kiteboy/erp.web.portal",        uri = "file:///home/kiteboy/erp.web.portal"      } }  }}
[DEBUG][2022-01-14 15:31:38] .../vim/lsp/rpc.lua:454	"rpc.receive"	{  id = 1,  jsonrpc = "2.0",  result = {    capabilities = {      documentFormattingProvider = true,      textDocumentSync = 2    }  }}
[DEBUG][2022-01-14 15:31:38] .../vim/lsp/rpc.lua:347	"rpc.send"	{  jsonrpc = "2.0",  method = "initialized",  params = vim.empty_dict()}
[DEBUG][2022-01-14 15:31:38] .../lua/vim/lsp.lua:921	"LSP[diagnosticls]"	"server_capabilities"	{  documentFormattingProvider = true,  textDocumentSync = 2}
[INFO][2022-01-14 15:31:38] .../lua/vim/lsp.lua:922	"LSP[diagnosticls]"	"initialized"	{  resolved_capabilities = {    call_hierarchy = false,    code_action = false,    code_lens = false,    code_lens_resolve = false,    completion = false,    declaration = false,    document_formatting = true,    document_highlight = false,    document_range_formatting = false,    document_symbol = false,    execute_command = false,    find_references = false,    goto_definition = false,    hover = false,    implementation = false,    rename = false,    signature_help = false,    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 = false,    workspace_folder_properties = {      changeNotifications = false,      supported = false    },    workspace_symbol = false  }}
[DEBUG][2022-01-14 15:31:39] .../vim/lsp/rpc.lua:347	"rpc.send"	{  jsonrpc = "2.0",  method = "textDocument/didOpen",  params = {    textDocument = {      languageId = "vue",      text = '<template>\n  <div class="error-page">\n      <div class="error-code">4<span>0</span>4</div>\n      <div class="error-desc">啊哦~ 你所访问的页面不存在</div>\n      <div class="error-handle">\n          <router-link to="/">\n            <el-button type="primary" size="large">返回首页</el-button>\n          </router-link>\n          <el-button class="error-btn" type="primary" size="large" @click="goBack">返回上一页</el-button>\n      </div>\n  </div>\n</template>\n\n<script>\nexport default {\nname:"404",\n  methods: {\n      goBack(){\n          this.$router.go(-1);\n      }\n  }\n}\n</script>\n\n\n<style scoped>\n    .error-page{\n        display: flex;\n        justify-content: center;\n        align-items: center;\n        flex-direction: column;\n        width: 100%;\n        height: 100%;\n        background: #f3f3f3;\n        box-sizing: border-box;\n    }\n    .error-code{\n        line-height: 1;\n        font-size: 250px;\n        font-weight: bolder;\n        color: #18A65E;\n    }\n    .error-code span{\n        color: #00a854;\n    }\n    .error-desc{\n        font-size: 30px;\n        color: #777;\n    }\n    .error-handle{\n        margin-top: 30px;\n        padding-bottom: 200px;\n    }\n    .error-btn{\n        margin-left: 100px;\n    }\n</style>\n',      uri = "file:///home/kiteboy/erp.web.portal/src/components/page/404.vue",      version = 0    }  }}
[DEBUG][2022-01-14 15:31:39] .../vim/lsp/rpc.lua:454	"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][2022-01-14 15:31:39] .../vim/lsp/rpc.lua:347	"rpc.send"	{  jsonrpc = "2.0",  method = "initialized",  params = vim.empty_dict()}
[DEBUG][2022-01-14 15:31:39] .../lua/vim/lsp.lua:921	"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][2022-01-14 15:31:39] .../lua/vim/lsp.lua:922	"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 = false,    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][2022-01-14 15:31:39] .../vim/lsp/rpc.lua:347	"rpc.send"	{  jsonrpc = "2.0",  method = "textDocument/didOpen",  params = {    textDocument = {      languageId = "vue",      text = '<template>\n  <div class="error-page">\n      <div class="error-code">4<span>0</span>4</div>\n      <div class="error-desc">啊哦~ 你所访问的页面不存在</div>\n      <div class="error-handle">\n          <router-link to="/">\n            <el-button type="primary" size="large">返回首页</el-button>\n          </router-link>\n          <el-button class="error-btn" type="primary" size="large" @click="goBack">返回上一页</el-button>\n      </div>\n  </div>\n</template>\n\n<script>\nexport default {\nname:"404",\n  methods: {\n      goBack(){\n          this.$router.go(-1);\n      }\n  }\n}\n</script>\n\n\n<style scoped>\n    .error-page{\n        display: flex;\n        justify-content: center;\n        align-items: center;\n        flex-direction: column;\n        width: 100%;\n        height: 100%;\n        background: #f3f3f3;\n        box-sizing: border-box;\n    }\n    .error-code{\n        line-height: 1;\n        font-size: 250px;\n        font-weight: bolder;\n        color: #18A65E;\n    }\n    .error-code span{\n        color: #00a854;\n    }\n    .error-desc{\n        font-size: 30px;\n        color: #777;\n    }\n    .error-handle{\n        margin-top: 30px;\n        padding-bottom: 200px;\n    }\n    .error-btn{\n        margin-left: 100px;\n    }\n</style>\n',      uri = "file:///home/kiteboy/erp.web.portal/src/components/page/404.vue",      version = 0    }  }}
[DEBUG][2022-01-14 15:31:39] .../vim/lsp/rpc.lua:454	"rpc.receive"	{  id = 0,  jsonrpc = "2.0",  method = "workspace/configuration",  params = {    items = { {        section = "js/ts.implicitProjectConfig"      }, {        section = "javascript.implicitProjectConfig"      } }  }}
[DEBUG][2022-01-14 15:31:39] .../vim/lsp/rpc.lua:464	"server_request: callback result"	{  result = { vim.NIL, vim.NIL },  status = true}
[DEBUG][2022-01-14 15:31:39] .../vim/lsp/rpc.lua:347	"rpc.send"	{  id = 0,  jsonrpc = "2.0",  result = { vim.NIL, vim.NIL }}
[DEBUG][2022-01-14 15:31:39] .../vim/lsp/rpc.lua:454	"rpc.receive"	{  id = 1,  jsonrpc = "2.0",  method = "window/workDoneProgress/create",  params = {    token = "9b81c915-568f-4c3d-85e6-2bee17800703"  }}
[DEBUG][2022-01-14 15:31:39] .../vim/lsp/rpc.lua:464	"server_request: callback result"	{  result = vim.NIL,  status = true}
[DEBUG][2022-01-14 15:31:39] .../vim/lsp/rpc.lua:347	"rpc.send"	{  id = 1,  jsonrpc = "2.0",  result = vim.NIL}
[DEBUG][2022-01-14 15:31:40] .../lua/vim/lsp.lua:962	"LSP[volar]"	"client.request"	1	"textDocument/documentHighlight"	{  position = {    character = 0,    line = 0  },  textDocument = {    uri = "file:///home/kiteboy/erp.web.portal/src/components/page/404.vue"  }}	<function 1>	1
[DEBUG][2022-01-14 15:31:40] .../vim/lsp/rpc.lua:347	"rpc.send"	{  id = 2,  jsonrpc = "2.0",  method = "textDocument/documentHighlight",  params = {    position = {      character = 0,      line = 0    },    textDocument = {      uri = "file:///home/kiteboy/erp.web.portal/src/components/page/404.vue"    }  }}
[DEBUG][2022-01-14 15:31:56] .../vim/lsp/rpc.lua:454	"rpc.receive"	{  id = 2,  jsonrpc = "2.0",  method = "workspace/configuration",  params = {    items = { {        section = "html.customData"      } }  }}
[DEBUG][2022-01-14 15:31:56] .../vim/lsp/rpc.lua:464	"server_request: callback result"	{  result = { vim.NIL },  status = true}
[DEBUG][2022-01-14 15:31:56] .../vim/lsp/rpc.lua:347	"rpc.send"	{  id = 2,  jsonrpc = "2.0",  result = { vim.NIL }}
[DEBUG][2022-01-14 15:31:56] .../vim/lsp/rpc.lua:454	"rpc.receive"	{  id = 2,  jsonrpc = "2.0"}
[DEBUG][2022-01-14 15:31:56] .../vim/lsp/rpc.lua:454	"rpc.receive"	{  id = 3,  jsonrpc = "2.0",  method = "workspace/configuration",  params = {    items = { {        section = "css.customData"      } }  }}
[DEBUG][2022-01-14 15:31:56] .../vim/lsp/rpc.lua:464	"server_request: callback result"	{  result = { vim.NIL },  status = true}
[DEBUG][2022-01-14 15:31:56] .../vim/lsp/rpc.lua:347	"rpc.send"	{  id = 3,  jsonrpc = "2.0",  result = { vim.NIL }}
[DEBUG][2022-01-14 15:31:56] .../vim/lsp/rpc.lua:454	"rpc.receive"	{  id = 4,  jsonrpc = "2.0",  method = "workspace/configuration",  params = {    items = { {        scopeUri = "file:///home/kiteboy/erp.web.portal/src/components/page/404.vue.template.css",        section = "css"      } }  }}
[DEBUG][2022-01-14 15:31:56] .../vim/lsp/rpc.lua:464	"server_request: callback result"	{  result = { vim.NIL },  status = true}
[DEBUG][2022-01-14 15:31:56] .../vim/lsp/rpc.lua:347	"rpc.send"	{  id = 4,  jsonrpc = "2.0",  result = { vim.NIL }}
[DEBUG][2022-01-14 15:31:56] .../vim/lsp/rpc.lua:454	"rpc.receive"	{  id = 5,  jsonrpc = "2.0",  method = "workspace/configuration",  params = {    items = { {        scopeUri = "file:///home/kiteboy/erp.web.portal/src/components/page/404.vue.0.css",        section = "css"      } }  }}
[DEBUG][2022-01-14 15:31:56] .../vim/lsp/rpc.lua:464	"server_request: callback result"	{  result = { vim.NIL },  status = true}
[DEBUG][2022-01-14 15:31:56] .../vim/lsp/rpc.lua:347	"rpc.send"	{  id = 5,  jsonrpc = "2.0",  result = { vim.NIL }}
[ERROR][2022-01-14 15:32:17] .../vim/lsp/rpc.lua:420	"rpc"	"volar-server"	"stderr"	"\n<--- Last few GCs --->\n\n[2813:0x510a380]    34862 ms: Mark-sweep (reduce) 2044.2 (2051.5) -> 2043.8 (2053.0) MB, 1536.6 / 0.0 ms  (average mu = 0.100, current mu = 0.009) allocation failure scavenge might not succeed\n[2813:0x510a380]    37190 ms: Mark-sweep (reduce) 2044.8 (2055.0) -> 2044.2 (2055.3) MB, 2316.4 / 0.0 ms  (average mu = 0.044, current mu = 0.005) allocation failure scavenge might not succeed\n\n\n<--- JS stacktrace --->\n\nFATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory\n"
[ERROR][2022-01-14 15:32:17] .../vim/lsp/rpc.lua:420	"rpc"	"volar-server"	"stderr"	" 1: 0x9fd5f0 node::Abort() [node]\n"
[ERROR][2022-01-14 15:32:17] .../vim/lsp/rpc.lua:420	"rpc"	"volar-server"	"stderr"	" 2: 0x94a45d node::FatalError(char const*, char const*) [node]\n"
[ERROR][2022-01-14 15:32:17] .../vim/lsp/rpc.lua:420	"rpc"	"volar-server"	"stderr"	" 3: 0xb7099e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]\n"
[ERROR][2022-01-14 15:32:17] .../vim/lsp/rpc.lua:420	"rpc"	"volar-server"	"stderr"	" 4: 0xb70d17 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]\n"
[ERROR][2022-01-14 15:32:17] .../vim/lsp/rpc.lua:420	"rpc"	"volar-server"	"stderr"	" 5: 0xd1a905  [node]\n"
[ERROR][2022-01-14 15:32:17] .../vim/lsp/rpc.lua:420	"rpc"	"volar-server"	"stderr"	" 6: 0xd1b48f  [node]\n"
[ERROR][2022-01-14 15:32:17] .../vim/lsp/rpc.lua:420	"rpc"	"volar-server"	"stderr"	" 7: 0xd294fb v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]\n"
[ERROR][2022-01-14 15:32:17] .../vim/lsp/rpc.lua:420	"rpc"	"volar-server"	"stderr"	" 8: 0xd2d0bc v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]\n"
[ERROR][2022-01-14 15:32:17] .../vim/lsp/rpc.lua:420	"rpc"	"volar-server"	"stderr"	" 9: 0xcfb7bb v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]\n"
[ERROR][2022-01-14 15:32:17] .../vim/lsp/rpc.lua:420	"rpc"	"volar-server"	"stderr"	"10: 0x1040c4f v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]\n"
[ERROR][2022-01-14 15:32:17] .../vim/lsp/rpc.lua:420	"rpc"	"volar-server"	"stderr"	"11: 0x13cc8f9  [node]\n"

Please let me know if you need me to provide other information. I don't know what kind of information is helpful to you

@johnsoncodehk
Copy link
Member

I'm not sure if memory usage is too high in large projects causing your problem (#531), can you try setting "volar.lowPowerMode": true?

@lqfxz520
Copy link
Author

It is still useless to try to settings volar.lowPowerMode: true

log result:

[START][2022-01-16 15:39:11] LSP logging initiated
[INFO][2022-01-16 15:39:11] .../vim/lsp/rpc.lua:261	"Starting RPC client"	{
  args = { "--stdio" },
  cmd = "volar-server",
  extra = {
    cwd = "/home/kiteboy/erp.web.portal"
  }
}
[DEBUG][2022-01-16 15:39:11] .../vim/lsp/rpc.lua:347	"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 = true,
            deprecatedSupport = true,
            documentationFormat = { "markdown", "plaintext" },
            insertReplaceSupport = true,
            labelDetailsSupport = true,
            preselectSupport = true,
            resolveSupport = {
              properties = { "documentation", "detail", "additionalTextEdits" }
            },
            snippetSupport = true,
            tagSupport = {
              valueSet = { 1 }
            }
          },
          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.1"
    },
    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 = "/usr/local/lib/node_modules/typescript/lib/tsserverlibrary.js"
      }
    },
    processId = 14954,
    rootPath = "/home/kiteboy/erp.web.portal",
    rootUri = "file:///home/kiteboy/erp.web.portal",
    trace = "off",
    workspaceFolders = { {
        name = "/home/kiteboy/erp.web.portal",
        uri = "file:///home/kiteboy/erp.web.portal"
      } }
  }
}
[DEBUG][2022-01-16 15:39:12] .../vim/lsp/rpc.lua:454	"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][2022-01-16 15:39:12] .../vim/lsp/rpc.lua:347	"rpc.send"	{
  jsonrpc = "2.0",
  method = "initialized",
  params = vim.empty_dict()
}
[DEBUG][2022-01-16 15:39:12] .../vim/lsp/rpc.lua:347	"rpc.send"	{
  jsonrpc = "2.0",
  method = "workspace/didChangeConfiguration",
  params = {
    settings = {
      volar = {
        lowPowerMode = true
      }
    }
  }
}
[DEBUG][2022-01-16 15:39:12] .../lua/vim/lsp.lua:921	"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][2022-01-16 15:39:12] .../lua/vim/lsp.lua:922	"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 = false,
    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][2022-01-16 15:39:12] .../vim/lsp/rpc.lua:347	"rpc.send"	{
  jsonrpc = "2.0",
  method = "textDocument/didOpen",
  params = {
    textDocument = {
      languageId = "vue",
      text = "<template>\n    <div id=\"app\">\n        <router-view></router-view>\n    </div>\n</template>\n\n<script>\nexport default {\n    mounted() {\n        window.onbeforeunload = function(e) {\n            let arr = [\n                'tenantId',\n                'token',\n                'companyData',\n                'branchData',\n                'companyDataNow',\n                'userId',\n                'storeData',\n                'allArea',\n                'tags',\n                'user',\n                'pass',\n                'activeMenuCategoryId',\n                'erpCurrentPath', // 记录当前路径\n                'examId', // 考试系统专用\n                'saleListAttr',//二手房列表\n                'rentListAttr',//租房列表\n            ]\n            let reg = /^__IM__/\n            let storage = window.localStorage\n            for (let item in storage) {\n                if (reg.test(item)) {\n                    // 模糊匹配 __IM__xxxxxx\n                    continue\n                }\n                if (arr.indexOf(item) === -1) {\n                    storage.removeItem(item)\n                }\n            }\n        }\n    }\n}\n</script>\n",
      uri = "file:///home/kiteboy/erp.web.portal/src/App.vue",
      version = 0
    }
  }
}
[DEBUG][2022-01-16 15:39:12] .../vim/lsp/rpc.lua:454	"rpc.receive"	{
  id = 0,
  jsonrpc = "2.0",
  method = "workspace/configuration",
  params = {
    items = { {
        section = "js/ts.implicitProjectConfig"
      }, {
        section = "javascript.implicitProjectConfig"
      } }
  }
}
[DEBUG][2022-01-16 15:39:12] .../vim/lsp/rpc.lua:464	"server_request: callback result"	{
  result = { vim.NIL, vim.NIL },
  status = true
}
[DEBUG][2022-01-16 15:39:12] .../vim/lsp/rpc.lua:347	"rpc.send"	{
  id = 0,
  jsonrpc = "2.0",
  result = { vim.NIL, vim.NIL }
}
[DEBUG][2022-01-16 15:39:12] .../vim/lsp/rpc.lua:454	"rpc.receive"	{
  id = 1,
  jsonrpc = "2.0",
  method = "window/workDoneProgress/create",
  params = {
    token = "55829034-2be4-49bb-bcf8-4bee0d365c65"
  }
}
[DEBUG][2022-01-16 15:39:12] .../vim/lsp/rpc.lua:464	"server_request: callback result"	{
  result = vim.NIL,
  status = true
}
[DEBUG][2022-01-16 15:39:12] .../vim/lsp/rpc.lua:347	"rpc.send"	{
  id = 1,
  jsonrpc = "2.0",
  result = vim.NIL
}
[DEBUG][2022-01-16 15:39:12] .../lua/vim/lsp.lua:962	"LSP[volar]"	"client.request"	1	"textDocument/documentHighlight"	{
  position = {
    character = 0,
    line = 0
  },
  textDocument = {
    uri = "file:///home/kiteboy/erp.web.portal/src/App.vue"
  }
}	<function 1>	1
[DEBUG][2022-01-16 15:39:12] .../vim/lsp/rpc.lua:347	"rpc.send"	{
  id = 2,
  jsonrpc = "2.0",
  method = "textDocument/documentHighlight",
  params = {
    position = {
      character = 0,
      line = 0
    },
    textDocument = {
      uri = "file:///home/kiteboy/erp.web.portal/src/App.vue"
    }
  }
}
[DEBUG][2022-01-16 15:39:28] .../vim/lsp/rpc.lua:454	"rpc.receive"	{
  id = 2,
  jsonrpc = "2.0",
  method = "workspace/configuration",
  params = {
    items = { {
        section = "html.customData"
      } }
  }
}
[DEBUG][2022-01-16 15:39:28] .../vim/lsp/rpc.lua:464	"server_request: callback result"	{
  result = { vim.NIL },
  status = true
}
[DEBUG][2022-01-16 15:39:28] .../vim/lsp/rpc.lua:347	"rpc.send"	{
  id = 2,
  jsonrpc = "2.0",
  result = { vim.NIL }
}
[DEBUG][2022-01-16 15:39:28] .../vim/lsp/rpc.lua:454	"rpc.receive"	{
  id = 2,
  jsonrpc = "2.0"
}
[DEBUG][2022-01-16 15:39:28] .../vim/lsp/rpc.lua:454	"rpc.receive"	{
  id = 3,
  jsonrpc = "2.0",
  method = "workspace/configuration",
  params = {
    items = { {
        section = "css.customData"
      } }
  }
}
[DEBUG][2022-01-16 15:39:28] .../vim/lsp/rpc.lua:464	"server_request: callback result"	{
  result = { vim.NIL },
  status = true
}
[DEBUG][2022-01-16 15:39:28] .../vim/lsp/rpc.lua:347	"rpc.send"	{
  id = 3,
  jsonrpc = "2.0",
  result = { vim.NIL }
}
[DEBUG][2022-01-16 15:39:28] .../vim/lsp/rpc.lua:454	"rpc.receive"	{
  id = 4,
  jsonrpc = "2.0",
  method = "workspace/configuration",
  params = {
    items = { {
        scopeUri = "file:///home/kiteboy/erp.web.portal/src/App.vue.template.css",
        section = "css"
      } }
  }
}
[DEBUG][2022-01-16 15:39:28] .../vim/lsp/rpc.lua:464	"server_request: callback result"	{
  result = { vim.NIL },
  status = true
}
[DEBUG][2022-01-16 15:39:28] .../vim/lsp/rpc.lua:347	"rpc.send"	{
  id = 4,
  jsonrpc = "2.0",
  result = { vim.NIL }
}
[ERROR][2022-01-16 15:39:48] .../vim/lsp/rpc.lua:420	"rpc"	"volar-server"	"stderr"	"\n<--- Last few GCs --->\n\n[14956:0x516d380]    32905 ms: Mark-sweep (reduce) 2043.7 (2051.0) -> 2043.4 (2052.8) MB, 1418.7 / 0.0 ms  (average mu = 0.106, current mu = 0.008) allocation failure scavenge might not succeed\n[14956:0x516d380]    34352 ms: Mark-sweep (reduce) 2044.4 (2054.8) -> 2043.9 (2055.5) MB, 1440.2 / 0.0 ms  (average mu = 0.057, current mu = 0.005) allocation failure scavenge might not succeed\n\n\n<--- JS stacktrace --->\n\nFATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory\n"
[ERROR][2022-01-16 15:39:48] .../vim/lsp/rpc.lua:420	"rpc"	"volar-server"	"stderr"	" 1: 0x9fd5f0 node::Abort() [node]\n"
[ERROR][2022-01-16 15:39:48] .../vim/lsp/rpc.lua:420	"rpc"	"volar-server"	"stderr"	" 2: 0x94a45d node::FatalError(char const*, char const*) [node]\n"
[ERROR][2022-01-16 15:39:48] .../vim/lsp/rpc.lua:420	"rpc"	"volar-server"	"stderr"	" 3: 0xb7099e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]\n"
[ERROR][2022-01-16 15:39:48] .../vim/lsp/rpc.lua:420	"rpc"	"volar-server"	"stderr"	" 4: 0xb70d17 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]\n"
[ERROR][2022-01-16 15:39:48] .../vim/lsp/rpc.lua:420	"rpc"	"volar-server"	"stderr"	" 5: 0xd1a905  [node]\n"
[ERROR][2022-01-16 15:39:48] .../vim/lsp/rpc.lua:420	"rpc"	"volar-server"	"stderr"	" 6: 0xd1b48f  [node]\n"
[ERROR][2022-01-16 15:39:48] .../vim/lsp/rpc.lua:420	"rpc"	"volar-server"	"stderr"	" 7: 0xd294fb v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]\n"
[ERROR][2022-01-16 15:39:48] .../vim/lsp/rpc.lua:420	"rpc"	"volar-server"	"stderr"	" 8: 0xd2d0bc v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]\n"
[ERROR][2022-01-16 15:39:48] .../vim/lsp/rpc.lua:420	"rpc"	"volar-server"	"stderr"	" 9: 0xcfb7bb v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]\n"
[ERROR][2022-01-16 15:39:48] .../vim/lsp/rpc.lua:420	"rpc"	"volar-server"	"stderr"	"10: 0x1040c4f v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]\n"
[ERROR][2022-01-16 15:39:48] .../vim/lsp/rpc.lua:420	"rpc"	"volar-server"	"stderr"	"11: 0x13cc8f9  [node]\n"
[INFO][2022-01-16 15:39:59] .../lua/vim/lsp.lua:1329	"exit_handler"	{}

@johnsoncodehk
Copy link
Member

Sorry my mistake, volar.lowPowerMode is option for vscode but not for neovim.

Check the logs, seems your already using single language server (equal to low power mode in vscode), and log message show JavaScript heap out of memory at [2022-01-16 15:39:48], Here are some possible reasons:

  • project is too lager
  • tsconfig include too many source due to exclude option have not setup correctly in tsconfig
  • Project include some very lager vue file lead to volar memory leak (Happened before, but should be already fixed)

I'm not sure if neovim can set the upper limit of the language server's memory, you can refer to https://stackoverflow.com/questions/38558989/node-js-heap-out-of-memory.
If you can share the project, I would able to check if any setup issue from project side.

@lqfxz520
Copy link
Author

Yes, the project is very large. When I execute the command find -name "*.vue" | wc -l. the result is 1697. node_modules is not included.
file: jsconfig.json

{
    "compilerOptions": {
        //"target": "esnext", // define to your liking
        "baseUrl": "./",
        "paths": {
            "@/*": ["src/*"],
            "base": ["baseConfig"],
            "public": ["public"]
        }
    },
    "exclude": ["node_modules"] // Optional
}

Looks like a memory problem, but don't know how to set it up.

@sethidden
Copy link
Contributor

Can you try if it crashes if you open the project in VS Code with the VS Code Volar extension installed? Since you're using Neovim you either have your own bespoke config or you're using nvim-lspconfig, and in either case there could be some mix of language server launch settings that cause the crash.

VS Code extension should be more stable since Johnson (maintainer) created it, whereas when I PR'ed the volar config to nvim-lspconfig I was eyeballing a lot.

@sethidden
Copy link
Contributor

sethidden commented Jan 17, 2022

EDIT: I explained it after only reading the first answer to the stackoverflow issue, but the second one is kinda much more straightforward. Try https://stackoverflow.com/a/53443394


I'm not sure if neovim can set the upper limit of the language server's memory, you can refer to https://stackoverflow.com/questions/38558989/node-js-heap-out-of-memory.

You can also try Johnson's suggestion from above.
In your dotfiles UNDER this line can you add something like

cmd = {'node', '/path/to/your/globally/installed/volar/executable', '--stdio', '--max-old-space-size=4096'}

The path to your globlaly ... on my computer is ~/.npm-global/lib/node_modules/@volar/server/out/index.js, but I have a custom folder for global installs so yours will probably be just ~/.npm or something

So in your dotfiles in the end it'll be like volar = { cmd = { 'node', and so on} }


EDIT2: As noted below, --max-old-space-size=4096 should come immediately after node, not at the very end.

@lqfxz520
Copy link
Author

@sethidden

So in your dotfiles in the end it'll be like volar = { cmd = { 'node', and so on} }

I edit my dotfiles under this line

cmd = { 'node', '/usr/local/lib/node_modules/@volar/server/out/index.js', '--stdio', '--max_old_space_size=4096' }

It's still wrong, log message:

[ERROR][2022-01-18 11:30:23] .../vim/lsp/rpc.lua:420	"rpc"	"node"	"stderr"	"\n<--- Last few GCs --->\n\n[22811:0x495d450]    35417 ms: Mark-sweep (reduce) 2044.1 (2054.5) -> 2043.8 (2055.0) MB, 1570.8 / 0.0 ms  (average mu = 0.099, current mu = 0.006) allocation failure scavenge might not succeed\n[22811:0x495d450]    37707 ms: Mark-sweep (reduce) 2044.8 (2052.0) -> 2044.3 (2053.5) MB, 2282.7 / 0.0 ms  (average mu = 0.043, current mu = 0.003) allocation failure scavenge might not succeed\n\n\n<--- JS stacktrace --->\n\nFATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory\n"
[ERROR][2022-01-18 11:30:23] .../vim/lsp/rpc.lua:420	"rpc"	"node"	"stderr"	" 1: 0x9fd5f0 node::Abort() [node]\n"
[ERROR][2022-01-18 11:30:23] .../vim/lsp/rpc.lua:420	"rpc"	"node"	"stderr"	" 2: 0x94a45d node::FatalError(char const*, char const*) [node]\n"
[ERROR][2022-01-18 11:30:23] .../vim/lsp/rpc.lua:420	"rpc"	"node"	"stderr"	" 3: 0xb7099e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]\n"
[ERROR][2022-01-18 11:30:23] .../vim/lsp/rpc.lua:420	"rpc"	"node"	"stderr"	" 4: 0xb70d17 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]\n"
[ERROR][2022-01-18 11:30:23] .../vim/lsp/rpc.lua:420	"rpc"	"node"	"stderr"	" 5: 0xd1a905  [node]\n"
[ERROR][2022-01-18 11:30:23] .../vim/lsp/rpc.lua:420	"rpc"	"node"	"stderr"	" 6: 0xd1b48f  [node]\n"
[ERROR][2022-01-18 11:30:23] .../vim/lsp/rpc.lua:420	"rpc"	"node"	"stderr"	" 7: 0xd294fb v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]\n"
[ERROR][2022-01-18 11:30:23] .../vim/lsp/rpc.lua:420	"rpc"	"node"	"stderr"	" 8: 0xd2d0bc v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]\n"
[ERROR][2022-01-18 11:30:23] .../vim/lsp/rpc.lua:420	"rpc"	"node"	"stderr"	" 9: 0xcfb7bb v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]\n"
[ERROR][2022-01-18 11:30:23] .../vim/lsp/rpc.lua:420	"rpc"	"node"	"stderr"	"10: 0x1040c4f v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]\n"
[ERROR][2022-01-18 11:30:23] .../vim/lsp/rpc.lua:420	"rpc"	"node"	"stderr"	"11: 0x13cc8f9  [node]\n"

Can you try if it crashes if you open the project in VS Code with the VS Code Volar extension installed? Since you're using Neovim you either have your own bespoke config or you're using nvim-lspconfig, and in either case there could be some mix of language server launch settings that cause the crash.

1642477444167_DCC8EA5D-ED7F-417b-A369-FDDD074A31DF

@johnsoncodehk
Copy link
Member

@lqfxz520 just to confirm the reason. Can this problem fix by reduce project files?

@yaegassy
Copy link
Collaborator

@lqfxz520 Does changing --max-old-space-size to a smaller value change the crash situation? What if you change it to 1024 or 512?

@lqfxz520
Copy link
Author

lqfxz520 commented Jan 18, 2022

the command under line is invalid.

cmd = { 'node', '/usr/local/lib/node_modules/@volar/server/out/index.js', '--stdio', '--max_old_space_size=4096' }

I reconfigured the memory

cmd = { 'node', '--max-old-space-size=6144',  '/usr/local/lib/node_modules/@volar/server/out/index.js', '--stdio' }

and log message:

[ERROR][2022-01-18 14:58:02] .../vim/lsp/rpc.lua:420	"rpc"	"node"	"stderr"	"\n<--- Last few GCs --->\n\n[3419:0x5ce54f0]   205082 ms: Mark-sweep (reduce) 6072.6 (6152.5) -> 6071.6 (6153.5) MB, 4496.3 / 0.0 ms  (average mu = 0.102, current mu = 0.003) allocation failure scavenge might not succeed\n[3419:0x5ce54f0]   209548 ms: Mark-sweep (reduce) 6072.6 (6152.5) -> 6071.7 (6153.8) MB, 4451.4 / 0.0 ms  (average mu = 0.055, current mu = 0.003) allocation failure scavenge might not succeed\n\n\n<--- JS stacktrace --->\n\nFATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory\n"

@lqfxz520 Does changing --max-old-space-size to a smaller value change the crash situation? What if you change it to 1024 or 512?

Obviously, 6GB is still not enough. smaller value not change the crash situation

@lqfxz520 just to confirm the reason. Can this problem fix by reduce project files?

And then I delete some files, It works. I execute the command find -name "*.vue" | wc -l.the result is 752

@johnsoncodehk
Copy link
Member

Since this issue is caused by the project size being too large, I can't check if this is a volar bug without a repo case, this issue will be close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants