helix
helix copied to clipboard
Tailwind language server shows errors
Helix showing me this:
Async job failed: protocol error: Method not found: Unhandled method textDocument/completion
And there is my languages.toml
[[language]]
name = "tailwind"
scope = "source.svelte"
roots = [".npmrc"]
file-types = ["svelte"]
language-server = { command = "/home/yura/.local/share/nvim/lsp_servers/tailwindcss_npm/node_modules/@tailwindcss/language-server/bin/tailwindcss-language-server", args = ["--stdio"] }
It looks like the tailwind LS has a troubleshooting section here: https://github.com/tailwindlabs/tailwindcss-intellisense#troubleshooting and some available configuration above. You can also run in verbose mode with the -v
flags (up to three of them) and check what messages are passed between the LS and helix https://github.com/helix-editor/helix/wiki/FAQ#access-the-log-file
I got the same error
My
language.toml
[[language]]
name = "tailwindcss"
scope = "source.css"
injection-regex = "(postcss|css)"
file-types = ["css"]
roots = ["tailwind.config.js","tailwind.config.cjs"]
comment-token = "//"
language-server = { command = "tailwindcss-language-server", args = ["--stdio"] }
indent = { tab-width = 2, unit = " " }
Log
2022-05-29T11:10:20.964 helix_lsp::transport [ERROR] <- Method not found: Unhandled method textDocument/completion
2022-05-29T11:10:38.529 helix_lsp::transport [ERROR] <- Method not found: Unhandled method textDocument/completion
2022-05-29T11:10:43.390 helix_lsp::transport [ERROR] <- Method not found: Unhandled method textDocument/completion
2022-05-29T11:10:45.230 helix_lsp::transport [ERROR] <- Method not found: Unhandled method textDocument/completion
2022-05-29T11:13:25.795 helix_view::theme [WARN] Theme: malformed hexcode: delta
2022-05-29T11:13:25.795 helix_view::theme [WARN] Theme: malformed hexcode: lightning
2022-05-29T11:13:25.795 helix_view::theme [WARN] Theme: malformed hexcode: apricot
2022-05-29T11:13:25.795 helix_view::theme [WARN] Theme: malformed hexcode: silver
2022-05-29T11:13:35.898 helix_lsp::transport [ERROR] <- Method not found: Unhandled method textDocument/completion
2022-05-29T11:13:39.860 helix_lsp::transport [ERROR] <- Method not found: Unhandled method textDocument/completion
2022-05-29T11:13:39.872 helix_lsp::transport [ERROR] <- Method not found: Unhandled method textDocument/completion
2022-05-29T11:13:43.597 helix_lsp::transport [ERROR] <- Method not found: Unhandled method textDocument/completion
2022-05-29T11:13:44.103 helix_lsp::transport [ERROR] <- Method not found: Unhandled method textDocument/completion
2022-05-29T11:14:33.681 helix_lsp::transport [ERROR] <- Method not found: Unhandled method textDocument/completion
2022-05-29T11:14:43.788 helix_view::theme [WARN] Theme: malformed hexcode: delta
2022-05-29T11:14:43.788 helix_view::theme [WARN] Theme: malformed hexcode: silver
2022-05-29T11:14:43.788 helix_view::theme [WARN] Theme: malformed hexcode: apricot
2022-05-29T11:14:43.788 helix_view::theme [WARN] Theme: malformed hexcode: lightning
2022-05-29T11:14:43.794 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{"textDocument":{"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"completion":{"completionItem":{"resolveSupport":{"properties":["documentation","detail","additionalTextEdits"]},"snippetSupport":false},"completionItemKind":{}},"hover":{"contentFormat":["markdown"]},"publishDiagnostics":{},"rename":{"dynamicRegistration":false,"honorsChangeAnnotations":false,"prepareSupport":false}},"window":{"workDoneProgress":true},"workspace":{"configuration":true,"didChangeConfiguration":{"dynamicRegistration":false},"workspaceFolders":true}},"processId":26443,"rootPath":"/home/hucancode/Documents/unagi-store/web","rootUri":"file:///home/hucancode/Documents/unagi-store/web","workspaceFolders":[{"name":"web","uri":"file:///home/hucancode/Documents/unagi-store/web"}]},"id":0}
2022-05-29T11:14:43.932 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":0,"method":"workspace/configuration","params":{"items":[{"section":"editor"}]}}
2022-05-29T11:14:43.932 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":1,"method":"workspace/configuration","params":{"items":[{"section":"tailwindCSS"}]}}
2022-05-29T11:14:43.932 helix_lsp::transport [INFO] Language server not initialized, delaying request
2022-05-29T11:14:43.932 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":0,"result":{"capabilities":{"textDocumentSync":1,"hoverProvider":true,"colorProvider":true,"codeActionProvider":true,"completionProvider":{"resolveProvider":true,"triggerCharacters":["\"","'","`"," ",".","[","!","/",":"]}}}}
2022-05-29T11:14:43.932 helix_lsp::transport [INFO] <- {"capabilities":{"codeActionProvider":true,"colorProvider":true,"completionProvider":{"resolveProvider":true,"triggerCharacters":["\"","'","`"," ",".","[","!","/",":"]},"hoverProvider":true,"textDocumentSync":1}}
2022-05-29T11:14:43.932 helix_lsp::transport [INFO] Draining pending message Response(Success(Success { jsonrpc: Some(V2), result: Array([Null]), id: Num(0) }))
2022-05-29T11:14:43.932 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","result":[null],"id":0}
2022-05-29T11:14:43.933 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"initialized","params":{}}
2022-05-29T11:14:43.933 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","result":[null],"id":1}
2022-05-29T11:14:43.933 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"languageId":"css","text":"body {\n @apply w-ful\n}\n","uri":"file:///home/hucancode/Documents/unagi-store/web/test.css","version":0}}}
2022-05-29T11:14:43.938 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":1,"message":"Unhandled exception: Cannot read properties of undefined (reading 'userLanguages')\nTypeError: Cannot read properties of undefined (reading 'userLanguages')\n at /usr/lib/node_modules/@tailwindcss/language-server/bin/tailwindcss-language-server:57:415664\n at Generator.next (<anonymous>)\n at fulfilled (/usr/lib/node_modules/@tailwindcss/language-server/bin/tailwindcss-language-server:57:413506)"}}
2022-05-29T11:14:43.938 helix_term::application [INFO] window/logMessage: LogMessageParams { typ: Error, message: "Unhandled exception: Cannot read properties of undefined (reading 'userLanguages')\nTypeError: Cannot read properties of undefined (reading 'userLanguages')\n at /usr/lib/node_modules/@tailwindcss/language-server/bin/tailwindcss-language-server:57:415664\n at Generator.next (<anonymous>)\n at fulfilled (/usr/lib/node_modules/@tailwindcss/language-server/bin/tailwindcss-language-server:57:413506)" }
2022-05-29T11:14:46.209 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/completion","params":{"position":{"character":14,"line":1},"textDocument":{"uri":"file:///home/hucancode/Documents/unagi-store/web/test.css"}},"id":1}
2022-05-29T11:14:46.210 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":1,"error":{"code":-32601,"message":"Unhandled method textDocument/completion"}}
2022-05-29T11:14:46.210 helix_lsp::transport [ERROR] <- Method not found: Unhandled method textDocument/completion
2022-05-29T11:14:46.842 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"body {\n @apply w-full\n}\n"}],"textDocument":{"uri":"file:///home/hucancode/Documents/unagi-store/web/test.css","version":1}}}
2022-05-29T11:14:47.244 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/completion","params":{"position":{"character":15,"line":1},"textDocument":{"uri":"file:///home/hucancode/Documents/unagi-store/web/test.css"}},"id":2}
2022-05-29T11:14:47.245 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":2,"error":{"code":-32601,"message":"Unhandled method textDocument/completion"}}
2022-05-29T11:14:47.245 helix_lsp::transport [ERROR] <- Method not found: Unhandled method textDocument/completion
2022-05-29T11:14:52.103 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"body {\n @apply w-full \n}\n"}],"textDocument":{"uri":"file:///home/hucancode/Documents/unagi-store/web/test.css","version":2}}}
2022-05-29T11:14:52.104 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/completion","params":{"position":{"character":16,"line":1},"textDocument":{"uri":"file:///home/hucancode/Documents/unagi-store/web/test.css"}},"id":3}
2022-05-29T11:14:52.104 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":3,"error":{"code":-32601,"message":"Unhandled method textDocument/completion"}}
2022-05-29T11:14:52.104 helix_lsp::transport [ERROR] <- Method not found: Unhandled method textDocument/completion
2022-05-29T11:14:52.544 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"body {\n @apply w-full h\n}\n"}],"textDocument":{"uri":"file:///home/hucancode/Documents/unagi-store/web/test.css","version":3}}}
2022-05-29T11:14:52.657 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"body {\n @apply w-full h-\n}\n"}],"textDocument":{"uri":"file:///home/hucancode/Documents/unagi-store/web/test.css","version":4}}}
2022-05-29T11:14:53.384 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"body {\n @apply w-full h-f\n}\n"}],"textDocument":{"uri":"file:///home/hucancode/Documents/unagi-store/web/test.css","version":5}}}
2022-05-29T11:14:53.423 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"body {\n @apply w-full h-fu\n}\n"}],"textDocument":{"uri":"file:///home/hucancode/Documents/unagi-store/web/test.css","version":6}}}
2022-05-29T11:14:53.824 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/completion","params":{"position":{"character":20,"line":1},"textDocument":{"uri":"file:///home/hucancode/Documents/unagi-store/web/test.css"}},"id":4}
2022-05-29T11:14:53.825 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":4,"error":{"code":-32601,"message":"Unhandled method textDocument/completion"}}
2022-05-29T11:14:53.825 helix_lsp::transport [ERROR] <- Method not found: Unhandled method textDocument/completion
2022-05-29T11:14:59.860 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"body {\n @apply w-full h-fu\n}\n"}],"textDocument":{"uri":"file:///home/hucancode/Documents/unagi-store/web/test.css","version":7}}}
2022-05-29T11:15:00.021 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"body {\n @apply w-full h-fu\n}\n"}],"textDocument":{"uri":"file:///home/hucancode/Documents/unagi-store/web/test.css","version":8}}}
2022-05-29T11:19:22.480 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"shutdown","params":null,"id":5}
2022-05-29T11:19:22.481 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":5,"result":null}
2022-05-29T11:19:22.481 helix_lsp::transport [INFO] <- null
2022-05-29T11:19:22.481 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"exit","params":null}
2022-05-29T11:21:45.732 helix_view::theme [WARN] Theme: malformed hexcode: silver
2022-05-29T11:21:45.732 helix_view::theme [WARN] Theme: malformed hexcode: lightning
2022-05-29T11:21:45.732 helix_view::theme [WARN] Theme: malformed hexcode: delta
2022-05-29T11:21:45.732 helix_view::theme [WARN] Theme: malformed hexcode: apricot
2022-05-29T11:21:45.736 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{"textDocument":{"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"completion":{"completionItem":{"resolveSupport":{"properties":["documentation","detail","additionalTextEdits"]},"snippetSupport":false},"completionItemKind":{}},"hover":{"contentFormat":["markdown"]},"publishDiagnostics":{},"rename":{"dynamicRegistration":false,"honorsChangeAnnotations":false,"prepareSupport":false}},"window":{"workDoneProgress":true},"workspace":{"configuration":true,"didChangeConfiguration":{"dynamicRegistration":false},"workspaceFolders":true}},"processId":26821,"rootPath":"/home/hucancode","rootUri":"file:///home/hucancode","workspaceFolders":[{"name":"hucancode","uri":"file:///home/hucancode"}]},"id":0}
2022-05-29T11:21:45.875 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":0,"method":"workspace/configuration","params":{"items":[{"section":"editor"}]}}
2022-05-29T11:21:45.875 helix_lsp::transport [INFO] Language server not initialized, delaying request
2022-05-29T11:21:45.875 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":1,"method":"workspace/configuration","params":{"items":[{"section":"tailwindCSS"}]}}
2022-05-29T11:21:45.875 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":0,"result":{"capabilities":{"textDocumentSync":1,"hoverProvider":true,"colorProvider":true,"codeActionProvider":true,"completionProvider":{"resolveProvider":true,"triggerCharacters":["\"","'","`"," ",".","[","!","/",":"]}}}}
2022-05-29T11:21:45.875 helix_lsp::transport [INFO] <- {"capabilities":{"codeActionProvider":true,"colorProvider":true,"completionProvider":{"resolveProvider":true,"triggerCharacters":["\"","'","`"," ",".","[","!","/",":"]},"hoverProvider":true,"textDocumentSync":1}}
2022-05-29T11:21:45.875 helix_lsp::transport [INFO] Draining pending message Response(Success(Success { jsonrpc: Some(V2), result: Array([Null]), id: Num(0) }))
2022-05-29T11:21:45.875 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","result":[null],"id":0}
2022-05-29T11:21:45.875 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"initialized","params":{}}
2022-05-29T11:21:45.875 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","result":[null],"id":1}
2022-05-29T11:21:45.875 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"languageId":"css","text":"\n","uri":"file:///home/hucancode/test.css","version":0}}}
2022-05-29T11:21:45.880 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":1,"message":"Unhandled exception: Cannot read properties of undefined (reading 'userLanguages')\nTypeError: Cannot read properties of undefined (reading 'userLanguages')\n at /usr/lib/node_modules/@tailwindcss/language-server/bin/tailwindcss-language-server:57:415664\n at Generator.next (<anonymous>)\n at fulfilled (/usr/lib/node_modules/@tailwindcss/language-server/bin/tailwindcss-language-server:57:413506)"}}
2022-05-29T11:21:45.880 helix_term::application [INFO] window/logMessage: LogMessageParams { typ: Error, message: "Unhandled exception: Cannot read properties of undefined (reading 'userLanguages')\nTypeError: Cannot read properties of undefined (reading 'userLanguages')\n at /usr/lib/node_modules/@tailwindcss/language-server/bin/tailwindcss-language-server:57:415664\n at Generator.next (<anonymous>)\n at fulfilled (/usr/lib/node_modules/@tailwindcss/language-server/bin/tailwindcss-language-server:57:413506)" }
2022-05-29T11:21:49.881 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"b\n"}],"textDocument":{"uri":"file:///home/hucancode/test.css","version":1}}}
2022-05-29T11:21:49.937 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"bo\n"}],"textDocument":{"uri":"file:///home/hucancode/test.css","version":2}}}
2022-05-29T11:21:50.186 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"bod\n"}],"textDocument":{"uri":"file:///home/hucancode/test.css","version":3}}}
2022-05-29T11:21:50.241 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"body\n"}],"textDocument":{"uri":"file:///home/hucancode/test.css","version":4}}}
2022-05-29T11:21:50.563 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"body \n"}],"textDocument":{"uri":"file:///home/hucancode/test.css","version":5}}}
2022-05-29T11:21:50.563 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/completion","params":{"position":{"character":5,"line":0},"textDocument":{"uri":"file:///home/hucancode/test.css"}},"id":1}
2022-05-29T11:21:50.564 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":1,"error":{"code":-32601,"message":"Unhandled method textDocument/completion"}}
2022-05-29T11:21:50.564 helix_lsp::transport [ERROR] <- Method not found: Unhandled method textDocument/completion
2022-05-29T11:21:51.000 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"body {}\n"}],"textDocument":{"uri":"file:///home/hucancode/test.css","version":6}}}
2022-05-29T11:21:51.241 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"body {\n \n}\n"}],"textDocument":{"uri":"file:///home/hucancode/test.css","version":7}}}
2022-05-29T11:21:52.220 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"body {\n @\n}\n"}],"textDocument":{"uri":"file:///home/hucancode/test.css","version":8}}}
2022-05-29T11:21:52.633 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"body {\n @a\n}\n"}],"textDocument":{"uri":"file:///home/hucancode/test.css","version":9}}}
2022-05-29T11:21:52.684 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"body {\n @ap\n}\n"}],"textDocument":{"uri":"file:///home/hucancode/test.css","version":10}}}
2022-05-29T11:21:52.857 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"body {\n @app\n}\n"}],"textDocument":{"uri":"file:///home/hucancode/test.css","version":11}}}
2022-05-29T11:21:53.062 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"body {\n @appl\n}\n"}],"textDocument":{"uri":"file:///home/hucancode/test.css","version":12}}}
2022-05-29T11:21:53.142 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"body {\n @apply\n}\n"}],"textDocument":{"uri":"file:///home/hucancode/test.css","version":13}}}
2022-05-29T11:21:53.483 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"body {\n @apply \n}\n"}],"textDocument":{"uri":"file:///home/hucancode/test.css","version":14}}}
2022-05-29T11:21:53.483 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/completion","params":{"position":{"character":9,"line":1},"textDocument":{"uri":"file:///home/hucancode/test.css"}},"id":2}
2022-05-29T11:21:53.483 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":2,"error":{"code":-32601,"message":"Unhandled method textDocument/completion"}}
2022-05-29T11:21:53.483 helix_lsp::transport [ERROR] <- Method not found: Unhandled method textDocument/completion
2022-05-29T11:22:02.002 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"body {\n @apply w\n}\n"}],"textDocument":{"uri":"file:///home/hucancode/test.css","version":15}}}
2022-05-29T11:22:02.137 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"body {\n @apply w-\n}\n"}],"textDocument":{"uri":"file:///home/hucancode/test.css","version":16}}}
2022-05-29T11:22:02.370 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"body {\n @apply w-f\n}\n"}],"textDocument":{"uri":"file:///home/hucancode/test.css","version":17}}}
2022-05-29T11:22:02.486 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"body {\n @apply w-fu\n}\n"}],"textDocument":{"uri":"file:///home/hucancode/test.css","version":18}}}
2022-05-29T11:22:02.691 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"body {\n @apply w-ful\n}\n"}],"textDocument":{"uri":"file:///home/hucancode/test.css","version":19}}}
2022-05-29T11:22:02.851 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"body {\n @apply w-full\n}\n"}],"textDocument":{"uri":"file:///home/hucancode/test.css","version":20}}}
2022-05-29T11:22:03.252 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/completion","params":{"position":{"character":15,"line":1},"textDocument":{"uri":"file:///home/hucancode/test.css"}},"id":3}
2022-05-29T11:22:03.253 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":3,"error":{"code":-32601,"message":"Unhandled method textDocument/completion"}}
2022-05-29T11:22:03.253 helix_lsp::transport [ERROR] <- Method not found: Unhandled method textDocument/completion
2022-05-29T11:22:03.481 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"body {\n @apply w-fullh\n}\n"}],"textDocument":{"uri":"file:///home/hucancode/test.css","version":21}}}
2022-05-29T11:22:03.617 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"body {\n @apply w-fullh \n}\n"}],"textDocument":{"uri":"file:///home/hucancode/test.css","version":22}}}
2022-05-29T11:22:03.617 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/completion","params":{"position":{"character":17,"line":1},"textDocument":{"uri":"file:///home/hucancode/test.css"}},"id":4}
2022-05-29T11:22:03.618 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":4,"error":{"code":-32601,"message":"Unhandled method textDocument/completion"}}
2022-05-29T11:22:03.618 helix_lsp::transport [ERROR] <- Method not found: Unhandled method textDocument/completion
2022-05-29T11:22:03.974 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"body {\n @apply w-fullh\n}\n"}],"textDocument":{"uri":"file:///home/hucancode/test.css","version":23}}}
2022-05-29T11:22:04.114 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"body {\n @apply w-full\n}\n"}],"textDocument":{"uri":"file:///home/hucancode/test.css","version":24}}}
2022-05-29T11:22:04.408 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"body {\n @apply w-full \n}\n"}],"textDocument":{"uri":"file:///home/hucancode/test.css","version":25}}}
2022-05-29T11:22:04.408 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/completion","params":{"position":{"character":16,"line":1},"textDocument":{"uri":"file:///home/hucancode/test.css"}},"id":5}
2022-05-29T11:22:04.408 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":5,"error":{"code":-32601,"message":"Unhandled method textDocument/completion"}}
2022-05-29T11:22:04.408 helix_lsp::transport [ERROR] <- Method not found: Unhandled method textDocument/completion
2022-05-29T11:22:04.504 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"body {\n @apply w-full h\n}\n"}],"textDocument":{"uri":"file:///home/hucancode/test.css","version":26}}}
2022-05-29T11:22:04.633 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"body {\n @apply w-full h-\n}\n"}],"textDocument":{"uri":"file:///home/hucancode/test.css","version":27}}}
2022-05-29T11:22:05.313 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"body {\n @apply w-full h-f\n}\n"}],"textDocument":{"uri":"file:///home/hucancode/test.css","version":28}}}
2022-05-29T11:22:05.354 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"body {\n @apply w-full h-fu\n}\n"}],"textDocument":{"uri":"file:///home/hucancode/test.css","version":29}}}
2022-05-29T11:22:05.755 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/completion","params":{"position":{"character":20,"line":1},"textDocument":{"uri":"file:///home/hucancode/test.css"}},"id":6}
2022-05-29T11:22:05.755 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"body {\n @apply w-full h-ful\n}\n"}],"textDocument":{"uri":"file:///home/hucancode/test.css","version":30}}}
2022-05-29T11:22:05.756 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":6,"error":{"code":-32601,"message":"Unhandled method textDocument/completion"}}
2022-05-29T11:22:05.756 helix_lsp::transport [ERROR] <- Method not found: Unhandled method textDocument/completion
2022-05-29T11:22:05.911 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"body {\n @apply w-full h-full\n}\n"}],"textDocument":{"uri":"file:///home/hucancode/test.css","version":31}}}
2022-05-29T11:22:06.313 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/completion","params":{"position":{"character":22,"line":1},"textDocument":{"uri":"file:///home/hucancode/test.css"}},"id":7}
2022-05-29T11:22:06.313 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":7,"error":{"code":-32601,"message":"Unhandled method textDocument/completion"}}
2022-05-29T11:22:06.313 helix_lsp::transport [ERROR] <- Method not found: Unhandled method textDocument/completion
2022-05-29T11:24:12.480 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"shutdown","params":null,"id":8}
2022-05-29T11:24:12.481 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":8,"result":null}
2022-05-29T11:24:12.481 helix_lsp::transport [INFO] <- null
2022-05-29T11:24:12.481 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"exit","params":null}
any info for this? not working and even broke svelte syntax highlighting and completions
my languages.toml file:
[[language]]
name = "tailwind"
scope = "source.svelte"
file-types = ["svelte"]
roots = ["tailwind.config.js","tailwind.config.cjs"]
language-server = { command = "tailwindcss-language-server", args = ["--stdio"] }
Im experiencing the same issue as @gasacchi
any update?
I looked into this some, it appears that the tailwindcss language server expects the config
to be an object, and so crashes when a config is not provided, which means the language server never registers the textDocument/completion
handler.
userLanguages: params.initializationOptions.userLanguages
? params.initializationOptions.userLanguages
: {},
Tailwindcss never checks to make sure initializationOptions
is in fact an object.
My configuration file that does not produce that error looks like this
[[language]]
name = "tailwindcss"
scope = "source.css"
injection-regex = "(postcss|css|html)"
file-types = ["css"]
roots = ["tailwind.config.js","tailwind.config.cjs"]
language-server = { command = "tailwindcss-language-server", args = ["-vvv", "--stdio"] }
indent = { tab-width = 2, unit = " " }
config = { } # <---- this is the partial fix
But even though the error went away (and the logs show the language server working), it's still not giving completions. (The server keeps returning null
for the list of completions)
2022-11-08T16:06:58.671 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/completion","params":{"position":{"character":16,"line":1},"textDocument":{"uri":"file:///home/andrew/Code/js/spry/landing-svelte/src/routes/+page.svelte"}},"id":4}
2022-11-08T16:06:58.674 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":4,"result":null}
I haven't figured the issue out, but I thought I would write down what I've discovered so far.
Update: In a .postcss
file after setting the language to tailwindcss, autocomplete works, it is just in svelte that it isn't working
Update 2:
I solved it! Tailwindcss determines which type of file you are in based on the language-id
parameter, so a working configuration for svelte files (only) is below.
[[language]]
name = "tailwind-svelte"
scope = "source.svelte"
file-types = ["svelte"]
roots = ["tailwind.config.js","tailwind.config.cjs"]
language-server = { language-id = "svelte", command = "tailwindcss-language-server", args = ["--stdio"] }
config = { }
You need to modify each language tailwindcss works with and overwrite it with tailwindcss and the correct language-id
. Unfortunately, this overwrites the existing language server for all those languages. Until #2507 is merged, there isn't a way to add two language servers to the same language. Once that PR is merged a configuration file for tailwindcss (for Svelte, CSS, and HTML) would look like this (which is the config I am currently using after building the PR myself).
[[language]]
name = "svelte"
scope = "source.svelte"
file-types = ["svelte"]
roots = ["tailwind.config.js","tailwind.config.cjs"]
language-servers = [ "tailwindcss-svelte", "svelteserver" ]
[language-server.tailwindcss-svelte]
language-id = "svelte"
command = "tailwindcss-language-server"
args = ["--stdio"]
config = { }
[[language]]
name = "css"
scope = "source.css"
file-types = ["css", "postcss"]
language-servers = [ "tailwindcss-css", "vscode-css-language-server" ]
[language-server.tailwindcss-css]
language-id = "css"
command = "tailwindcss-language-server"
args = ["--stdio"]
config = { }
[[language]]
name = "html"
scope = "text.html.basic"
file-types = ["html"]
language-servers = [ "tailwindcss-html", "vscode-html-language-server" ]
[language-server.tailwindcss-html]
language-id = "html"
command = "tailwindcss-language-server"
args = ["--stdio"]
config = { }
Once https://github.com/tailwindlabs/tailwindcss-intellisense/pull/656 is released the config will be able to be empty without causing tailwind to crash, which fixes this bug.
Seriously @anbcodes, thank you so much for this information! This is the last thing missing for me to finally ditch vscode all together. You've made my day.
Any news on this. Should it work now? I am not able to use this.
Current problem is that with #2507, hover doesn't work if tailwindcss is not first language added to language-servers
..
When Svelte or Vue are second in that array then their features are not working.
I tried to change that, and it works :smiley:
My temp fork.
Anyone do this with tsx files ?
@arnm Did you found any solutions?
Now that it has been merged did someone experiment already with TSX and Tailwind? This was my current attempt but I'm most likely doing something wrong:
[[language]]
name = "typescript"
roots = ["tailwind.config.js", "tailwind.config.cjs"]
language-servers = [ "tailwindcss-typescript", "typescript-language-server" ]
[language-server.tailwindcss-typescript]
language-id = "typescript"
command = "tailwindcss-language-server"
args = ["--stdio"]
config = { }
I'm trying with
[[language]]
language-servers = ["svelteserver", "tailwindcss"]
name = "svelte"
roots = ["tailwind.config.cjs", "tailwind.config.js"]
[language-server.rust-analyzer]
command = "/nix/store/gz8ifn0klcfccnksnpn2y8sc1qsq4f28-rust-analyzer-unwrapped-2023-05-15/bin/rust-analyzer"
[language-server.svelteserver]
command = "/nix/store/vh8zkvwr23mmbiqpkwgqy6dxp8q1kilv-svelte-language-server-0.15.10/bin/svelteserver"
[language-server.tailwindcss]
args = ["--stdio"]
command = "/nix/store/64cg3zg014l1xx5667ix4aq2k7m84ick-_at_tailwindcss_slash_language-server-0.0.13/bin/tailwindcss-language-server"
(with the master branch and it's not working at all. Curious if anyone can share a working configuration).
I'm trying with
[[language]] language-servers = ["svelteserver", "tailwindcss"] name = "svelte" roots = ["tailwind.config.cjs", "tailwind.config.js"] [language-server.rust-analyzer] command = "/nix/store/gz8ifn0klcfccnksnpn2y8sc1qsq4f28-rust-analyzer-unwrapped-2023-05-15/bin/rust-analyzer" [language-server.svelteserver] command = "/nix/store/vh8zkvwr23mmbiqpkwgqy6dxp8q1kilv-svelte-language-server-0.15.10/bin/svelteserver" [language-server.tailwindcss] args = ["--stdio"] command = "/nix/store/64cg3zg014l1xx5667ix4aq2k7m84ick-_at_tailwindcss_slash_language-server-0.0.13/bin/tailwindcss-language-server"
(with the master branch and it's not working at all. Curious if anyone can share a working configuration).
Try to add in: [language-server.tailwindcss]
language-id = "svelte"
config = { }
Ive tried and infortunately it didnt work for me Ive also tried putting tailwindcss before svelteserver but that didnt do better either. Thank you for the suggestion though !
@Philipp-M are we doing something wrong?
Don't have much time right now...
language-id
is a language specific element (a language-server can support multiple different languages). So this should be under the relevant language
svelte, but by default if language-id
under the language
isn't defined, the name
attribute is used instead.
What may give some insight is running helix with the verbose flag (-v
) and checking the logs (in linux ~/.cache/helix/helix.log
).
For tsx the language-id
that is used by default is typescriptreact
which follows the recommendation in https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocumentItem
Thanks for your comment!
Just to add a couple of elements
- I added a PR with the settings for tailwind which I'm using to test https://github.com/helix-editor/helix/pull/7080
- I've tried running tailwind with
-vvv
but nothing shows up about tailwindcss language server and nothing at all shows up in the logs. (I've verified that the binary path is actually correct).
I'm going to try another lsp that would benefit from being run side by side with another one. I'll report if I can make that one work.
Tested the following configuration in project/.helix/languages.toml
and both servers appear to work:
[[language]]
name = "svelte"
language-servers = ["svelteserver", "tailwindcss"]
roots = ["tailwind.config.cjs", "tailwind.config.js"]
[language-server.svelteserver]
command = "node_modules/@tailwindcss/language-server/bin/tailwindcss-language-server"
[language-server.tailwindcss]
language-id = "svelte"
command = "node_modules/svelte-language-server/bin/server.js"
args = ["--stdio"]
TailwindLSP was working for me on node v16
. On v18
not so much.
I tried to debug it(this branch)
Helix doesn't respond to these two requests:
2023-05-21T18:18:29.678 helix_lsp::transport [INFO] tailwindcss-vue <- {"jsonrpc":"2.0","id":0,"method":"workspace/configuration","params":{"items":[{"section":"editor"}]}}
2023-05-21T18:18:29.678 helix_lsp::transport [INFO] tailwindcss-vue <- {"jsonrpc":"2.0","id":1,"method":"workspace/configuration","params":{"items":[{"section":"tailwindCSS"}]}}
I tried to stop these two requests and insert default values(from other editors) and it works(Linux) for React, Vue and Svelte :smiley:
npm
npm i helix-twcss -g
#other language servers and languages
...
# tailwind react
[language-server.tailwindcss-react]
language-id = "javascriptreact"
command = "hx-tw"
config = { }
args = ["--stdio"]
timeout = 3
# tailwind vue
[language-server.tailwindcss-vue]
language-id = "vue"
command = "hx-tw"
args = ["--stdio"]
timeout = 5
[[language]]
name = "vue"
scope = "source.vue"
file-types = ["vue"]
roots = ["package.json", "tailwind.config.js","tailwind.config.cjs", ".prettierrc.json"]
language-servers = ["volar","tailwindcss-vue"]
injection-regex = "vue"
formatter = {command = "prettier", args = ["--parser", "vue"]}
auto-format = true
[[language]]
name = "tsx"
language-servers = ["tailwindcss-react", "tsreact"]
roots = ["tailwind.config.js","tailwind.config.cjs", ".prettierrc.json"]
[[language]]
name = "jsx"
language-servers = ["tailwindcss-react", "tsreact"]
roots = ["tailwind.config.js","tailwind.config.cjs", ".prettierrc.json"]
...
Until helix client doesn't respond to workspace/configuration
I will use this.
@uros-5 I am using your patched LSP and it works! Well kinda, the completions are kinda messed up for me. As soon a I enter the first hyphen in my class, it just displays random other classes. Anybody else got that issue?
@uros-5 I am using your patched LSP and it works! Well kinda, the completions are kinda messed up for me. As soon a I enter the first hyphen in my class, it just displays random other classes. Anybody else got that issue?
I had that too on previous version of helix. Try updating to the latest or build from source.
@uros-5 ah thanks! I am currently using the the copilot MR branch so updating might be a bit tricky, but that certainly explains it.
I started using your patched LSP too, @uros-5 and as @MatthiasGrandl said it's working for me too. I've found one curious behavior though, which is that if the tailwind LSP is the first in the list, completions (from both TW-LSP and typescript-language-server
) work (thanks for the hint about a newer helix build!), but the hover
command (from typescript-language-server
) doesn't (hitting Space k
to get type information from LSP). When typescript-language-server
is the first entry instead, both work. I couldn't find anything about whether that's the expected behavior—it certainly feels if the TW-LSP doesn't have any info, helix should fall back on the next LSP in the list?
Edit: I just realized that the TW-LSP should show info when using hover
on the class names. That works when it's the first entry. So it seems to me this is just helix not handling the multiple-LSP case for hover
at all yet?
I've found one curious behavior though, which is that if the tailwind LSP is the first in the list, completions (from both TW-LSP and
typescript-language-server
) work (thanks for the hint about a newer helix build!), but thehover
command (fromtypescript-language-server
) doesn't (hittingSpace k
to get type information from LSP).
We talked about that in (this) issue and also here. Helix codebase changed a lot since January so check this. It's up with master + hover works for multiple languages. I don't know other solution for hover.
I've found one curious behavior though, which is that if the tailwind LSP is the first in the list, completions (from both TW-LSP and
typescript-language-server
) work (thanks for the hint about a newer helix build!), but thehover
command (fromtypescript-language-server
) doesn't (hittingSpace k
to get type information from LSP).We talked about that in (this) issue and also here. Helix codebase changed a lot since January so check this. It's up with master + hover works for multiple languages. I don't know other solution for hover.
This did not work for me, I am not getting any hover ro tailwinds classes.
This did not work for me, I am not getting any hover ro tailwinds classes.
Have you tried to build from source?
I updated helix-twcss
package. Reinstall it globally.
This did not work for me, I am not getting any hover ro tailwinds classes.
Have you tried to build from source? I updated
helix-twcss
package. Reinstall it globally.
I did build your fork from source.
EDIT: did not work either. still no hover. completion is working dough.
EDIT: helix-twcss ? how do I do that?
Please read previous comments.. It's not that hard.
EDIT: helix-twcss ? how do I do that?
Please read previous comments.. It's not that hard.
as mentioned above, it still does not show any hover. sorry I missed that. this is my languages.toml configuration do you see anything that might be wrong?
[[language]]
name = "typescript"
scope = "source.ts"
injection-regex = "(ts|typescript)"
language-servers = [{except-features = ["format"], name = "typescript-language-server"}, "tailwindcss-react", "eslint"]
roots = ["tailwind.config.js","tailwind.config.cjs", ".prettierrc.json"]
file-types = ["ts", "mts", "cts"]
formatter = { command = 'prettier', args = ["--stdin-filepath", "file.ts"] }
indent = { tab-width = 4, unit = "\t" }
auto-format = true
[[language]]
language-servers = [{except-features = ["format"], name = "typescript-language-server"}, "tailwindcss-react", "eslint"]
roots = ["tailwind.config.js","tailwind.config.cjs", ".prettierrc.json"]
name = "javascript"
scope = "source.js"
injection-regex = "(js|javascript)"
file-types = ["js", "mjs", "cjs"]
formatter = { command = 'prettier', args = ["--stdin-filepath", "file.js"] }
indent = { tab-width = 4, unit = "\t" }
auto-format = true
[[language]]
language-servers = [{except-features = ["format"], name = "typescript-language-server"}, "tailwindcss-react", "eslint"]
roots = ["tailwind.config.js","tailwind.config.cjs", ".prettierrc.json"]
name = "jsx"
scope = "source.jsx"
injection-regex = "jsx"
file-types = ["jsx"]
formatter = { command = 'prettier', args = ["--stdin-filepath", "file.jsx"] }
indent = { tab-width = 4, unit = "\t" }
auto-format = true
[[language]]
language-servers = [{except-features = ["format"], name = "typescript-language-server"}, "tailwindcss-react" , "eslint"]
roots = ["tailwind.config.js","tailwind.config.cjs", ".prettierrc.json"]
name = "tsx"
scope = "source.tsx"
injection-regex = "(tsx)" # |typescript
file-types = ["tsx"]
formatter = { command = 'prettier', args = ["--stdin-filepath", "file.tsx"] }
indent = { tab-width = 4, unit = "\t" }
auto-format = true
[[language]]
name = "html"
scope = "text.html.basic"
injection-regex = "html"
file-types = ["html"]
language-servers = ["tailwindcss-react","vscode-html-language-server"]
roots = ["tailwind.config.js","tailwind.config.cjs", ".prettierrc.json"]
auto-format = true
indent = { tab-width = 4, unit = "\t" }
[[language]]
name = "css"
scope = "source.css"
injection-regex = "css"
file-types = ["css"]
language-servers = ["tailwindcss-react", "vscode-css-language-server"]
roots = ["tailwind.config.js","tailwind.config.cjs", ".prettierrc.json"]
auto-format = true
indent = { tab-width = 4, unit = "\t" }
[language-server.tailwindcss-react]
language-id = "javascriptreact"
command = "hx-tw"
config = { }
args = ["--stdio"]
timeout = 3
[language-server.eslint]
args = ["--stdio"]
command = "vscode-eslint-language-server"
[language-server.eslint.config]
format = true
nodePath = ""
onIgnoredFiles = "off"
quiet = false
rulesCustomizations = []
run = "onType"
validate = "on"
[language-server.eslint.config.codeAction]
[language-server.eslint.config.codeAction.disableRuleComment]
enable = true
location = "separateLine"
[language-server.eslint.config.codeAction.showDocumentation]
enable = true
[language-server.eslint.config.codeActionOnSave]
enable = true
mode = "all"
[language-server.eslint.config.workingDirectory]
mode = "location"
[language-server.typescript-language-server]
args = ["--stdio"]
command = "typescript-language-server"
[language-server.typescript-language-server.config]
documentFormatting = false
as mentioned above, it still does not show any hover. sorry I missed that. this is my languages.toml configuration do you see anything that might be wrong?
I tried your config and it works as expected. Install latest npm i helix-twcss -g
. I don't have macOS so I can't test it there.