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

Make language-servers spacing consistent #12565

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jerabaul29
Copy link
Contributor

At present the spacing of the lsps listed in the language-servers fields for different languages are not consistent: see e.g.:

language-servers = [ "rust-analyzer" ]

vs.

language-servers = ["codeql"]

This makes "automated" editing error prone. This PR makes this spacing aspect consistent.

@jerabaul29
Copy link
Contributor Author

Mmh, actually wait a bit, there may be an issue with this fix somehow, I need to investigate.

@jerabaul29
Copy link
Contributor Author

Actually, I wonder if the issue is with the latest languages.toml that is present on main and on top of which I apply my changes.

@jerabaul29
Copy link
Contributor Author

The languages.toml from this commit:

https://github.com/helix-editor/helix/blob/99d33c741a22b69988ed60060a6a09cf2abb62be/languages.toml

gives me a failed to parse error, I think it introduced an issue.

@jerabaul29
Copy link
Contributor Author

strange, commenting line

comment-tokens = ["//", "///"]

the languages.toml parses, with it uncommented it does not parse. I do not understand why.

@the-mikedavis
Copy link
Member

The failed CI run I believe is unrelated to the changes

@the-mikedavis
Copy link
Member

Making this spacing consistent is not desirable to me. It's falls under the category of stylistic changes which make the git blame harder to follow and may conflict with other open PRs unnecessarily.

@jerabaul29
Copy link
Contributor Author

jerabaul29 commented Jan 17, 2025

@the-mikedavis thank you for your comment :) .

My feeling (but I may be wrong :) ) is that this is a bit more than style. For example, I found out this issue when trying to edit the languages.toml: what I did in helix was to try to add the typos-lsp lsp to all language-servers specifications:

  • select whole document: %
  • split cursor at the language-servers: slanguage-servers = \[
  • insert a new lsp on all selections: a "typos-lsp",

what happens then is that on most language-servers entries, this worked as expected and added the typos-lsp LSP, but on the ones that missed the at the end and start of the [ ], this messed things up by ending up with results like:

language-servers = ["typos-lsp", typespec"]

(note the automatic " functionality messed up the typesec").

This is the motivation for pushing this PR, rather than style per se.

Of course maybe the way I was trying to add typos-lsp to all specifications was naive and there is a better way, but at least for me it was the first thing I thought about, and debugging / understanding why I had issues after this took me half an hour - this would not happen after this PR :) .

@kirawi kirawi added A-documentation Area: Documentation improvements S-waiting-on-review Status: Awaiting review from a maintainer. and removed A-documentation Area: Documentation improvements labels Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants