tools
tools copied to clipboard
š Helix editor: Rome language server shadows TS
Environment information
OS: Arch Linux
Rome: v11.0.0
What happened?
Iām trying to set up the Rome Language Server with the Helix editor. While everything seems to work at first glance, I notice that functionality offered by the TypeScript language server, such as āgoto definitionā is no longer available.
I followed the instructions for configuring the Rome language server: https://github.com/rome/tools/blob/main/editors/helix/manual.md
While the Rome language server now works, it had the unintended side-effect of making functionality from TypeScript language server unavailable.
Expected result
Both functionality from the Rome language server and the TypeScript language server should be available.
Maybe the Rome language server should forward commands it doesnāt handle to the TS language server? I did confirm that typescript-language-server was in my PATH when I ran rome start.
Code of Conduct
- [X] I agree to follow Rome's Code of Conduct
Rome doesn't advertise that it is a definitionProvider so related functionality should not be affected. I would suggest reporting it against the Helix editor.
I reported the issue with the Helix editor and it seems a PR is already open on their side (see: https://github.com/helix-editor/helix/pull/2507) to add support for multiple language servers per language. If you donāt mind, we can keep this issue open and Iāll create a PR to update your Helix config instructions once thatās merged.
š @rome/staff please triage this issue by adding one of the following labels: S-Bug: confirmed, S-Planned , S-Wishlist or umbrella
@arendjr any chance you could update helix config instructions as you mentioned above?
It might require some updating, since I think they changed some things before they merged that PR. But yeah, Iāll try to give it a go over the next week.
I was able to get the LSP linting to work, but could not get formatting -- I think it's held up by https://github.com/helix-editor/helix/pull/5626, but if this is the case, I'm not sure how the manual demo works.
This is what I have so far:
[language-server.rome]
command = "rome"
args = ["lsp-proxy"]
formatter = { command = "rome", args = ["format", "--stdin-file-path", "test.js"]}
[[language]]
language-servers = [ "rome", { name = "typescript-language-server", except-features = [ "format" ] }]
name = "javascript"
auto-format = true
If anyone happens to know how to fix formatting, that would be appreciated!
I am attempting to configure the Helix editor with multiple LSPs for the latest version of NextJS. I anticipate that this setup will support both linting and formatting features.
To reproduce this setup:
- Build the Helix editor from source (master branch) to version 23.05 (b4fe31ca). This version supports multiple LSPs.
- Rome 12.1.3
For the project languages setup, create a languages.toml file in the .helix directory with the following configuration:
[language-server.rome]
command = "node_modules/.bin/rome"
args = ["lsp-proxy"]
formatter = { command = "node_modules/.bin/rome", args = ["format", "--stdin-file-path", "test.tsx"] }
[[language]]
name = "tsx"
auto-format = true
language-servers = [ { name = "rome", only-features = ["format", "completion", "code-action", "diagnostics", "inlay-hints"] }, "typescript-language-server" ]
Following these steps, everything should function correctly. I've checked the Helix log and the Rome rage log, and both appear to be free of errors.
I tried to give it a go, but as @wornut noticed, you currently need a build from the master branch as there are no releases yet that support multiple language servers. Note that version 23.05 is a released version, but the PR for the language servers was merged a day later. So I think it's better to revisit Rome's instructions when a new release is out. For the more courageous, it looks like @wornut's instructions would get the job done :)
Oh interesting, I was under the impression that there was already a release with this feature as there are docs for it already - but I guess those docs are for master and not latest release.