vuejs / vetur

Vue tooling for VS Code.
https://vuejs.github.io/vetur/
MIT License
5.75k stars 593 forks source link

Trying to configure kakoune editor with it's kak-lsp to work with VLS and I'm getting some weird errors #2648

Open Niedzwiedzw opened 3 years ago

Niedzwiedzw commented 3 years ago

Info

Problem

Jan 25 19:50:00.976 DEBG To server: {"jsonrpc":"2.0","method":"textDocument/formatting","params":{"options":{"insertSpaces":true,"tabSize":8},"textDocument":{"uri":"file:///home/niedzwiedz/mcgluszak/minerwa-front/src/App.vue"}},"id":2}, module: kak_lsp::language_server_transport:183 Jan 25 19:50:00.976 DEBG From server: {"jsonrpc":"2.0","id":2,"error":{"code":-32601,"message":"Unhandled method textDocument/formatting"}}, module: kak_lsp::language_server_transport:157

Reproducible Case

entry in kak-lsp.toml:

[language.html]
filetypes = ["html"]
roots = ["package.json"]
command = "vls"
args = ["--stdio"]
Niedzwiedzw commented 3 years ago

some more logs

Jan 25 22:13:54.124 INFO Starting main event loop, module: kak_lsp::session:29
Jan 25 22:13:54.124 DEBG Searching for vars starting with KAK_LSP_PROJECT_ROOT_HTML, module: kak_lsp::project_root:46
Jan 25 22:13:54.124 DEBG Routing editor request to Route { session: "241865", language: "html", root: "/home/niedzwiedz/mcgluszak/minerwa-front" }, module: kak_lsp::session:95
Jan 25 22:13:54.124 DEBG Spawning a new controller for Route { session: "241865", language: "html", root: "/home/niedzwiedz/mcgluszak/minerwa-front" }, module: kak_lsp::session:117
Jan 25 22:13:54.124 INFO Starting Language server `vls --stdio`, module: kak_lsp::language_server_transport:21
Jan 25 22:13:54.125 DEBG To editor `241865`: eval -client client0 -verbatim -- lsp-get-server-initialization-options '/tmp/kak-lsp/niedzwiedz/7df2987a0c88d7ad', module: kak_lsp::editor_transport:84
Jan 25 22:13:54.130 DEBG lsp_server_initialization_options:
, module: kak_lsp::general:419
Jan 25 22:13:54.130 DEBG To server: {"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{"textDocument":{"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"dynamicRegistration":false,"isPreferredSupport":false},"codeLens":{"dynamicRegistration":false},"colorProvider":{"dynamicRegistration":false},"completion":{"completionItem":{"commitCharactersSupport":false,"deprecatedSupport":false,"documentationFormat":["plaintext"],"preselectSupport":false,"snippetSupport":true},"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":{"dynamicRegistration":false,"linkSupport":false},"definition":{"dynamicRegistration":false,"linkSupport":false},"documentHighlight":{"dynamicRegistration":false},"documentLink":{"dynamicRegistration":false,"tooltipSupport":false},"documentSymbol":{"dynamicRegistration":false},"formatting":{"dynamicRegistration":false},"hover":{"contentFormat":["plaintext"],"dynamicRegistration":false},"implementation":{"dynamicRegistration":false,"linkSupport":false},"onTypeFormatting":{"dynamicRegistration":false},"publishDiagnostics":{"relatedInformation":false},"rangeFormatting":{"dynamicRegistration":false},"references":{"dynamicRegistration":false},"rename":{"dynamicRegistration":false,"prepareSupport":false},"semanticHighlightingCapabilities":{"semanticHighlighting":true},"semanticTokens":{"dynamicRegistration":false,"formats":["relative"],"requests":{"full":true,"range":false},"tokenModifiers":["documentation","readonly"],"tokenTypes":["keyword","comment","string","namespace","type","variable","operator","function"]},"signatureHelp":{"contextSupport":false,"dynamicRegistration":false,"signatureInformation":{"documentationFormat":["plaintext"],"parameterInformation":{"labelOffsetSupport":false}}},"synchronization":{"didSave":true,"dynamicRegistration":false,"willSave":false,"willSaveWaitUntil":false},"typeDefinition":{"dynamicRegistration":false,"linkSupport":false}},"window":{"workDoneProgress":false},"workspace":{"applyEdit":false,"configuration":false,"didChangeConfiguration":{"dynamicRegistration":false},"executeCommand":{"dynamicRegistration":false},"symbol":{"dynamicRegistration":false,"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":{"documentChanges":true,"failureHandling":"abort","resourceOperations":["create","delete","rename"]},"workspaceFolders":false}},"clientInfo":{"name":"kak-lsp","version":"8.0.0-snapshot"},"processId":242043,"rootUri":"file:///home/niedzwiedz/mcgluszak/minerwa-front","trace":"off"},"id":0}, module: kak_lsp::language_server_transport:183
Jan 25 22:13:54.139 DEBG From editor:
session  = "241865"
client   = "client0"
buffile  = "/home/niedzwiedz/mcgluszak/minerwa-front/src/App.vue"
filetype = "html"
version  = 4
method   = "workspace/symbol"
[params]
query    = "NavBar"
, module: kak_lsp::editor_transport:122
Jan 25 22:13:54.139 DEBG Searching for vars starting with KAK_LSP_PROJECT_ROOT_HTML, module: kak_lsp::project_root:46
Jan 25 22:13:54.139 DEBG Routing editor request to Route { session: "241865", language: "html", root: "/home/niedzwiedz/mcgluszak/minerwa-front" }, module: kak_lsp::session:95
Jan 25 22:13:54.139 DEBG Language server is not initialized, parking request, module: kak_lsp::controller:94
Jan 25 22:13:54.139 DEBG To editor `241865`: eval -client client0 -verbatim -- lsp-show-error 'Language server is not initialized, parking request', module: kak_lsp::editor_transport:84
Jan 25 22:13:54.779 DEBG From server: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":1,"message":"No workspace path found. Vetur initialization failed."}}, module: kak_lsp::language_server_transport:157
Jan 25 22:13:54.779 DEBG From server: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":4,"message":"Vetur initialized"}}, module: kak_lsp::language_server_transport:157
Jan 25 22:13:54.779 DEBG From server: {"jsonrpc":"2.0","id":0,"result":{"capabilities":{"textDocumentSync":2,"workspace":{"workspaceFolders":{"supported":true,"changeNotifications":true}},"completionProvider":{"resolveProvider":true,"triggerCharacters":[".",":","<","\"","'","/","@","*"," "]},"signatureHelpProvider":{"triggerCharacters":["("]},"documentFormattingProvider":false,"hoverProvider":true,"documentHighlightProvider":true,"documentLinkProvider":{"resolveProvider":false},"documentSymbolProvider":true,"definitionProvider":true,"referencesProvider":true,"codeActionProvider":{"codeActionKinds":["quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"],"resolveProvider":true},"colorProvider":true,"executeCommandProvider":{"commands":[]},"foldingRangeProvider":true}}}, module: kak_lsp::language_server_transport:157
Jan 25 22:13:54.779 DEBG To server: {"jsonrpc":"2.0","method":"initialized","params":{}}, module: kak_lsp::language_server_transport:183
Jan 25 22:13:54.779 DEBG To server: {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"languageId":"html","text":"<template>\n  <NavBar></NavBar>\n  <router-view class=\"current-view\" />\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent } from \"vue\";\nimport NavBar from \"@/components/NavBar.vue\";\nimport {EXAMPLE_CONFIG} from \"@/blackspot\";\nexport default defineComponent({\n    name: \"App\",\n    components: {\n        NavBar,\n    },\n    props: {},\n    setup() {\n        console.log({EXAMPLE_CONFIG});\n        return {};\n    },\n});\n</script>\n\n<style lang=\"scss\">\n@import '@/styles/main.scss';\nbody {\n    background-color:$color-background;\n    margin: 0;\n    font-size: 16px;\n    overflow-x: hidden;\n}\n\n$content-height: calc(100vh - #{$navbar-height});\n#app {\n    font-family: Montserrat, Helvetica, Arial, sans-serif;\n    \n    -webkit-font-smoothing: antialiased;\n    -moz-osx-font-smoothing: grayscale;\n    text-align: center;\n    color: $primary-dark;\n    height: 100vh;\n    @include grid-center;\n    grid-template-rows: $navbar-height 1fr;\n    .current-view {\n        @include grid-center;\n        height: $content-height;\n    }\n}\n\n</style>\n","uri":"file:///home/niedzwiedz/mcgluszak/minerwa-front/src/App.vue","version":4}}}, module: kak_lsp::language_server_transport:183
Jan 25 22:13:54.779 DEBG To server: {"jsonrpc":"2.0","method":"workspace/symbol","params":{"query":"NavBar"},"id":1}, module: kak_lsp::language_server_transport:183
Jan 25 22:13:54.780 DEBG To editor `241865`: echo -debug LSP: 'No workspace path found. Vetur initialization failed.', module: kak_lsp::editor_transport:84
Jan 25 22:13:54.780 DEBG From server: {"jsonrpc":"2.0","id":1,"error":{"code":-32601,"message":"Unhandled method workspace/symbol"}}, module: kak_lsp::language_server_transport:157
Jan 25 22:13:54.780 ERRO Error response from server: Failure { jsonrpc: Some(V2), error: Error { code: MethodNotFound, message: "Unhandled method workspace/symbol", data: None }, id: Num(1) }, module: kak_lsp::controller:155
Jan 25 22:13:54.782 DEBG To editor `241865`: echo -debug LSP: 'Vetur initialized', module: kak_lsp::editor_transport:84
Jan 25 22:13:54.784 DEBG To editor `241865`: eval -client client0 -verbatim -- lsp-show-error 'html language server doesn''t support method workspace/symbol', module: kak_lsp::editor_transport:84

maybe someone can make sense of this

krobelus commented 3 years ago

To narrow this down, maybe try if it works in a different editor.

Niedzwiedzw commented 3 years ago

it does work in spacemacs with no extra hacking it seems

yoyo930021 commented 3 years ago

Vetur don't support single file. You need to open a project in Vetur.

LSP client must to send params.workspaceFolders in initialize request. If you don't send any project path, vetur will print No workspace path found. Vetur initialization failed.. Ref: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#initialize