Skip to content
This repository has been archived by the owner on Feb 20, 2024. It is now read-only.

Not able to set cairo-ls settings in Helix IDE #47

Open
Eikix opened this issue Dec 22, 2022 · 5 comments
Open

Not able to set cairo-ls settings in Helix IDE #47

Eikix opened this issue Dec 22, 2022 · 5 comments

Comments

@Eikix
Copy link
Contributor

Eikix commented Dec 22, 2022

Hey:)!

I've been trying to set up cairo-ls in Helix. Opened a PR for getting the lsp up and running on Helix: #46.
Nonetheless, it appears I can't pass the settings to my config.

I try to pass in sourceDir, venvCommand, etc. For some reason, the LSP does not recognize them. Would you have an idea for how to set these settings in other environments as VSCode?

@Eikix Eikix changed the title Not able to set cairo-ls settings in Helix Not able to set cairo-ls settings in Helix IDE Dec 22, 2022
@Eikix
Copy link
Contributor Author

Eikix commented Dec 22, 2022

For reference: helix-editor/helix#5245

@ericglau
Copy link
Owner

Sorry for the late response. From the thread above, it looks like some settings are being passed through to the language server, but you have additional source files in certain folders that are not recognized during compilation. Is that correct?

The language server also has a cairoPath setting that takes an array of strings representing additional locations to search for cairo files.

Can you try something like this?

config = { <the other settings that you currently have>, cairoPath = [ "your additional path" ] }

@Eikix
Copy link
Contributor Author

Eikix commented Jan 24, 2023

Hi:)!

I tried this:

[[language]]
config = { cairoPath = [
  "/Users/eliastazartes/code/theodo/kakarot/src",
  "/Users/eliastazartes/code/theodo/kakarot",
  "/Users/eliastazartes/code/theodo/kakarot/tests",
"tests",
"lib"
], sourceDir = "src", venvCommand = "source ~/cairo_venv/bin/activate", nileUseVenv = false, useVenv = true, nileVenvCommand = "source ~/cairo_venv/bin/activate" }
name = "cairo"
scope = "source.cairo"
injection-regex = "cairo"
file-types = ["cairo"]
indent = { tab-width = 2, unit = "  " }
comment-token = "#"
language-server = { command = "cairols.sh" }

And it does not work:
image

But it appears the language server can't read this config somehow.
I'm trying to pass the arguments in my bash script, but it still does not work.

node ~/code/lsp/node_modules/cairo-ls/out/server.js --stdio --sourceDir="src" --venvCommand="source ~/cairo_venv/bin/activate" --nileUseVenv=false --useVenv=true --nileVenvCommand="" --cairoPath="['/Users/eliastazartes/code/theodo/kakarot/src', '/Users/eliastazartes/code/theodo/kakarot','/Users/eliastazartes/code/theodo/kakarot/tests']"

@ericglau
Copy link
Owner

I couldn't get the config working either. Will need to look into it further.

@ericglau
Copy link
Owner

ericglau commented Jan 26, 2023

If you really need it for now, you could just edit the defaults in the source code and then build it by following https://github.com/ericglau/cairo-ls/blob/main/CONTRIBUTING.md -- only need the first 3 steps:

Run npm install in this folder (main repo). This installs all necessary npm modules in both the client and server folder
Open VS Code on this folder (main repo).
Press Ctrl+Shift+B (Command+Shift+B on Mac) to compile the client and server.

then you can find server/out/server.js and edit your cairols.sh to point to that.

Repository owner deleted a comment from thangtq-pionero Feb 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants