Problem when adding a language server to the Cairo language #10250
Replies: 15 comments
-
We spawn the language server directly as a child process instead of using a shell so the # ~/.config/helix/languages.toml
[[language]]
name = "cairo"
language-server = { command = "node", args = ["~/code/lsp/node_modules/cairo-ls/out/server.js", "--stdio"] } |
Beta Was this translation helpful? Give feedback.
-
Creating a .sh wrapper script and adding it to my path works fine! PS: I tried the second option, it didn't work for me Thanks again for your fast response!! 🥷🔥 |
Beta Was this translation helpful? Give feedback.
-
Hey! How can I make the LSP recognise correct paths to check: |
Beta Was this translation helpful? Give feedback.
-
You probably either need to pass more flags to the language server, or add a configuration section. |
Beta Was this translation helpful? Give feedback.
-
I previously tested out cairo-ls but found it too minimal so I personally don't use it anymore |
Beta Was this translation helpful? Give feedback.
-
What alternatives are there;)? |
Beta Was this translation helpful? Give feedback.
-
What is a configuration section? Is that a helix thing? |
Beta Was this translation helpful? Give feedback.
-
You can control what configuration is sent to the server in the initialization function with the For an example see the deno configurations: https://github.com/helix-editor/helix/wiki/How-to-install-the-default-language-servers#deno |
Beta Was this translation helpful? Give feedback.
-
Thanks for your time:)! I've checked it out, Tried to pass In order to try and reproduce the VSCode equivalent (in {
"cairols.nileUseVenv": false,
"cairols.venvCommand": "source ~/cairo_venv/bin/activate",
"cairols.useVenv": true,
"cairols.cairoPath": ["lib", "tests"],
"cairols.sourceDir": "src",
"cairols.nileVenvCommand": "source ~/cairo_venv/bin/activate"
} It does not work. I still get an error when trying to import modules inside a .cairo file: Do you have an idea why it does not work? |
Beta Was this translation helpful? Give feedback.
-
Provide logs after running hx with the -v flag. I guessing you need to provide a full path rather than using |
Beta Was this translation helpful? Give feedback.
-
It appears the cairo language server searched imports first in But it would find it in: This is my main issue as of now, not sure about the In the cairo-ls library's README, it is written:
How can I change the language client's settings in Helix? |
Beta Was this translation helpful? Give feedback.
-
I think they're talking about the config sent in the initialization function - the |
Beta Was this translation helpful? Give feedback.
-
[[language]]
name = "cairo"
scope = "source.cairo"
injection-regex = "cairo"
file-types = ["cairo"]
indent = { tab-width = 2, unit = " " }
comment-token = "#"
config = { sourceDir = "tests", venvCommand = "source ~/cairo_venv/bin/activate", nileUseVenv = false, useVenv = true, nileVenvCommand = "source ~/cairo_venv/bin/activate" }
language-server = { command = "cairols.sh" } This is my language config in languages.toml |
Beta Was this translation helpful? Give feedback.
-
Have no idea if this is correct but the vscode config has |
Beta Was this translation helpful? Give feedback.
-
Ah yes, I was playing around with the config object but I tried |
Beta Was this translation helpful? Give feedback.
-
Hi all:)!
I've recently picked up Helix and love it! Thanks a lot. Been using it as my main Rust IDE 🦀.
I'm currently working in the Starknet ecosystem and their programming language is Cairo.
I saw that in the default language config, Cairo is already mentioned. Nonetheless, there is no language server associated.
I tried to override the basic config with the following language config (
~/.config/helix/languages.toml
):Where I aliased
cairo-ls
in my.zshrc
to be:alias cairo-ls="node ~/code/lsp/node_modules/cairo-ls/out/server.js --stdio"
As the cairo language server does not have a binary but rather a node script:
https://www.npmjs.com/package/cairo-ls
When trying to open a
.cairo
file, Helix informs me that there is no language server running.Beta Was this translation helpful? Give feedback.
All reactions