Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow providing a custom binary path for ZLS and other language servers. #6767

Closed
1 task done
paperdave opened this issue Jan 26, 2024 · 8 comments
Closed
1 task done
Labels
enhancement [core label] language server An umbrella label for all language servers language An umbrella label for all programming languages syntax behaviors setting Feedback for preferences, configuration, etc zig Zig programming language support

Comments

@paperdave
Copy link

Check for existing issues

  • Completed

Describe the feature

Excited to see merging of the Zig integration. I built the editor locally to try it out, and it's great to see syntax highlighting for it finally.

But I have the nightly version of zig and zls installed on my machine. Zed seems to load the stable version 0.11. That makes it unable to parse the build.zig in Bun because of new features the language has seen that have not been released into stable.

image

I solve this in VSCode with these options:

image

Furthermore, in Bun's repo, we hardcode a specific path relative to the project as our build system downloads a specific version of the compiler.

image

(the .exe is a specific workaround because Windows binaries must have .exe as a suffix; on Posix we symlink the extensionless binary to a .exe to get this working on all platforms seamlessly)

Honestly would be amazing if Zed could just peek at the vscode config and steal the properties to make this "just work", but I believe the proper feature request is having some Zed equivalents of these settings. I could not find any within the code so I assume they do not exist.

If applicable, add mockups / screenshots to help present your vision of the feature

No response

@paperdave paperdave added admin read Pending admin review enhancement [core label] triage Maintainer needs to classify the issue labels Jan 26, 2024
@paperdave
Copy link
Author

paperdave commented Jan 26, 2024

Sorry, it seems this isnt a issue with ZLS. but rather the grammar. auguste says to me it is a ZLS version issue.

image

I believe my feature request is still valid as I do need to configure specific versions of the compiler.

@JosephTLyons JosephTLyons added language An umbrella label for all programming languages syntax behaviors setting Feedback for preferences, configuration, etc language server An umbrella label for all language servers zig Zig programming language support and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Jan 29, 2024
@jansol
Copy link
Contributor

jansol commented Feb 1, 2024

@paperdave
Copy link
Author

It seems #9293 opens up the door to add this to Zig, which would solve my own use case.

@llogick
Copy link
Contributor

llogick commented Jul 8, 2024

I'm not confident enough in my Rust skills to PR it d40fb6a

@GildedHonour
Copy link

image

@notpeter
Copy link
Member

notpeter commented Sep 4, 2024

I believe this is now supported. Can you test and see if this works for you?

  "lsp": {
    "zls": {
      "binary": {
        "path": "/opt/homebrew/bin/zig"
      }
    }
  }

If not, please comment and I'm happy to reopen. Thanks

@notpeter notpeter closed this as completed Sep 4, 2024
@mkaito
Copy link

mkaito commented Oct 11, 2024

I believe this is now supported. Can you test and see if this works for you?

  "lsp": {
    "zls": {
      "binary": {
        "path": "/opt/homebrew/bin/zig"
      }
    }
  }

If not, please comment and I'm happy to reopen. Thanks

Does this allow for relative paths? My use case would be ruby gem bundle binstubs.

@notpeter
Copy link
Member

Does this allow for relative paths? My use case would be ruby gem bundle binstubs.

I think so. Not sure whether it's:

  • whatever/bin/ruby-ls
  • project_dir/whatever/bin/ruby-ls
  • ./whatever/bin/ruby-ls

We should document this better. If it doesn't work go ahead and open a new issue.

Alternatively you should also be able to add that bin dir to your path and it'll pick it automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement [core label] language server An umbrella label for all language servers language An umbrella label for all programming languages syntax behaviors setting Feedback for preferences, configuration, etc zig Zig programming language support
Projects
None yet
Development

No branches or pull requests

7 participants