Replies: 26 comments
-
Does the log say anything when editing |
Beta Was this translation helpful? Give feedback.
-
2022-08-13T16:46:23.539 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
},
"signatureHelp": {
"signatureInformation": {
"activeParameterSupport": true,
"documentationFormat": [
"markdown"
],
"parameterInformation": {
"labelOffsetSupport": true
}
}
}
},
"window": {
"workDoneProgress": true
},
"workspace": {
"applyEdit": true,
"configuration": true,
"didChangeConfiguration": {
"dynamicRegistration": false
},
"workspaceFolders": true
}
},
"processId": 30555,
"rootPath": "/d/dev/revealjs/astro_present",
"rootUri": "file:///d/dev/revealjs/astro_present",
"workspaceFolders": [
{
"name": "astro_present",
"uri": "file:///d/dev/revealjs/astro_present"
}
]
},
"id": 0
} 2022-08-13T16:46:23.959 helix_lsp::transport [INFO] <- {
"jsonrpc": "2.0",
"id": 0,
"error": {
"code": -32603,
"message": "Request initialize failed with message: Cannot read properties of undefined (reading 'environment')"
}
} 2022-08-13T16:46:23.959 helix_lsp::transport [ERROR] <- InternalError: Request initialize failed with message: Cannot read properties of undefined (reading 'environment') (I formatted the json) Seems like their language server fails to initialize. But thank you for pointing out that there is a log, I didn't knew that. |
Beta Was this translation helpful? Give feedback.
-
As far as I know, "environment" isn't part of the LSP spec so this looks like something internal to Astro's LSP when it handles the |
Beta Was this translation helpful? Give feedback.
-
Astro-ls did indeed expected an additional setting called |
Beta Was this translation helpful? Give feedback.
-
Ah awesome, looks like that PR is already merged. Besides that, it may be possible to supply the values they're looking for with the For example the json language server needs an initialization value to enable formatting: Lines 123 to 132 in 2968756 |
Beta Was this translation helpful? Give feedback.
-
Yep, issue is fixed on our side (PR has been merged and released). Don't hesitate to let me know if there's anything else we can do to better support Helix! |
Beta Was this translation helpful? Give feedback.
-
I hope this is the right place to ask this. It seems to be related to this issue. I'm currently trying to setup astro-ls @astrojs/[email protected] on helix 22.12 (96ff64a) Unfortunately, the LSP is not working. ~/.cache/helix/helix.log after opening a .astro file
The lines that caught my attention were:
My language.toml
Am I trying to do something that is not supported, or just missing something on my configuration? |
Beta Was this translation helpful? Give feedback.
-
Hello, our language server requires a path to TypeScript's You can see more details here: https://github.com/withastro/language-tools/blob/main/docs/language-server/initParams.md |
Beta Was this translation helpful? Give feedback.
-
If anyone got this to work, it would be great to summarize the findings in the wiki page. Thanks in advance! |
Beta Was this translation helpful? Give feedback.
-
This seems like the right place to report this: I am trying to configure Going through logs, I found this:
in particular, these lines seems to be quite relevant
I wonder if this could be a bug in |
Beta Was this translation helpful? Give feedback.
-
Works for me on windows, but on linux, astro-ls fails to start with this in the helix logs:
|
Beta Was this translation helpful? Give feedback.
-
I stumbled upon the same error as @keogami and tried to look into it a bit. I'm not very familiar with the language server protocol, but it seems to me as if After changing a line of code in This is what i got after sending a proper url:
|
Beta Was this translation helpful? Give feedback.
-
Has anyone gotten this to work? |
Beta Was this translation helpful? Give feedback.
-
Filed this just now: withastro/language-tools#526 CC @eulervoid Let's get this working! |
Beta Was this translation helpful? Give feedback.
-
@eulervoid as I understand, this request is to get the value of the "typescript" config item that you should pass to the LSP. Did you add this to your config = { "typescript" = { serverPath = "/full/path/to/your/node_modules/typescript/lib/tsserverlibrary.js" }, "environment" = "node" } |
Beta Was this translation helpful? Give feedback.
-
I think everything works after the path/uri inconsistency is fixed (see withastro/language-tools#527). I'll make a change to the wiki once this has been merged/released upstream. Not sure what is the best way to install and provide the path to the |
Beta Was this translation helpful? Give feedback.
-
The problem was fixed in https://github.com/withastro/language-tools/releases/tag/%40astrojs%2Flanguage-server%401.0.5 Here is my [[language]]
name = "astro"
scope = "source.astro"
injection-regex = "astro"
file-types = ["astro"]
roots = ["package.json", "astro.config.mjs"]
language-server = { command = "astro-ls", args = ["--stdio"] }
auto-format = true Here is my [[language]]
name = "astro"
config = { "typescript" = { serverPath = "/home/beeb/path_to_my_project/node_modules/typescript/lib/tsserverlibrary.js" }, "environment" = "node" } I couldn't make it work with a relative path to Wiki has been updated: https://github.com/helix-editor/helix/wiki/How-to-install-the-default-language-servers#astro |
Beta Was this translation helpful? Give feedback.
-
I've followed the wiki to a tee and it's still not working for me. Here's what the end of my logs look like after exiting Helix with a .astro file open
I wish I knew what |
Beta Was this translation helpful? Give feedback.
-
@Teajey so you have defined the |
Beta Was this translation helpful? Give feedback.
-
Yes, exactly. Here's my config [[language]]
name = "astro"
scope = "source.astro"
injection-regex = "astro"
file-types = ["astro"]
roots = ["package.json", "astro.config.mjs"]
language-server = { command = "astro-ls", args = ["--stdio"] } And local project config [[language]]
name = "astro"
config = { "typescript" = { serverPath = "/<path to project>/node_modules/typescript/lib/tsserverlibrary.js" }, "environment" = "node" } Edit: Same result if I move the |
Beta Was this translation helpful? Give feedback.
-
@Teajey and you did |
Beta Was this translation helpful? Give feedback.
-
It does indeed. I made a sanity check. I think the issue lies in that it's searching for |
Beta Was this translation helpful? Give feedback.
-
Yeah something might have changed in their tooling, like the name of the options. Try to see if there is any info on the astro lsp repo. I haven't worked on an astro project in a little while and can't really test right now. |
Beta Was this translation helpful? Give feedback.
-
I think they migrated to using volar recently so maybe the option is not needed anymore. |
Beta Was this translation helpful? Give feedback.
-
Hello! In 2.0 of our language server we updated it to be Volar-based, so our options are now the same as the Vue LSP in regard to the server path. So for the TypeScript path, that would be |
Beta Was this translation helpful? Give feedback.
-
I am converting this to a discussion since any concrete bugs upstream/in helix seem to be resolved |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to add the astro language server to languages.toml (https://github.com/withastro/language-tools/tree/main/packages/language-server). It is installed globally and callable as
astro-ls
. My languages.toml entry looks like this:I have tried different roots such as
["astro.config.mjs"]
and[]
, but the response is always, that there is no lsp loaded for this buffer.There is no tree-sitter grammar for astro.
Beta Was this translation helpful? Give feedback.
All reactions