Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

🐛 Helix editor: Rome language server shadows TS #4107

Open
1 task done
arendjr opened this issue Dec 27, 2022 · 9 comments
Open
1 task done

🐛 Helix editor: Rome language server shadows TS #4107

arendjr opened this issue Dec 27, 2022 · 9 comments
Labels
S-To triage Status: user report of a possible bug that needs to be triaged

Comments

@arendjr
Copy link
Contributor

arendjr commented Dec 27, 2022

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

  • I agree to follow Rome's Code of Conduct
@arendjr arendjr added the S-To triage Status: user report of a possible bug that needs to be triaged label Dec 27, 2022
@rchl
Copy link

rchl commented Dec 29, 2022

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.

@arendjr
Copy link
Contributor Author

arendjr commented Dec 29, 2022

I reported the issue with the Helix editor and it seems a PR is already open on their side (see: helix-editor/helix#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.

@github-actions
Copy link

👋 @rome/staff please triage this issue by adding one of the following labels: S-Bug: confirmed, S-Planned , S-Wishlist or umbrella

@matthewmturner
Copy link

@arendjr any chance you could update helix config instructions as you mentioned above?

@arendjr
Copy link
Contributor Author

arendjr commented Jun 9, 2023

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.

@kothavade
Copy link

I was able to get the LSP linting to work, but could not get formatting -- I think it's held up by helix-editor/helix#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!

@wornut
Copy link

wornut commented Jun 18, 2023

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:

  1. Build the Helix editor from source (master branch) to version 23.05 (b4fe31ca). This version supports multiple LSPs.
  2. 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.

@arendjr
Copy link
Contributor Author

arendjr commented Jun 21, 2023

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 :)

@matthewmturner
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
S-To triage Status: user report of a possible bug that needs to be triaged
Projects
None yet
Development

No branches or pull requests

6 participants