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

feat: Add default configuration for KCL language server #13148

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

arichtman
Copy link

Adds a default configuration for KCL's language server.

I'm not sure where else this needs to be added.
It looks like the --health argument operates dynamically enough.
Where in the tests might a test for this go?
Should I add something to the release notes?

Fix #13147

@arichtman arichtman force-pushed the add-kcl-lang-server branch from 5e08292 to 7a86f22 Compare March 20, 2025 18:00
@the-mikedavis
Copy link
Member

Generally we don't accept language definitions that don't also have syntax highlighting. Language server configurations can go in https://github.com/helix-editor/helix/wiki/Language-Server-Configurations

@the-mikedavis the-mikedavis added the A-language-support Area: Support for programming/text languages label Mar 23, 2025
@uncenter
Copy link
Contributor

I came across nvim-treesitter/nvim-treesitter#7657 the other day as I was looking to upstream something to nvim-treesitter, so looks like there is a maintained Tree-sitter grammar you can use! https://github.com/kcl-lang/tree-sitter-kcl

@arichtman arichtman force-pushed the add-kcl-lang-server branch 4 times, most recently from 5fd2e21 to 5682776 Compare March 24, 2025 23:54
@arichtman
Copy link
Author

image
Added highlighting 😊

Copy link
Contributor

@uncenter uncenter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some suggestions on how to improve the queries :)

Comment on lines 136 to 146
"and"
"or"
"not"
"in"
"is"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some/all of these can be under keyword.operator instead.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved the ones commented here, or did you mean all of them under @operator ?


(selector_expr
(select_suffix
(identifier) @property))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(identifier) @property))
(identifier) @property))

property isn't an official scope for Helix, maybe variable.other.member is fitting if this node matches the description of "Fields of composite data types (e.g. structs, unions)"?

@arichtman
Copy link
Author

Wow, awesome @uncenter - but this highlighting.scm is verbatim from the tree-sitter-kcl repository. I'm guessing we should upstream these?

@uncenter
Copy link
Contributor

Wow, awesome @uncenter - but this highlighting.scm is verbatim from the tree-sitter-kcl repository. I'm guessing we should upstream these?

It's a little complicated because every Tree-sitter based editor does things differently. The original queries here (from the upstream repository) look like they are intended for usage in Neovim, whereas Helix uses some different scopes in its themes so we have to change it up a bit (no need to upstream these changes back since the changes will be specific to Helix).

@arichtman arichtman marked this pull request as draft March 25, 2025 01:02
@arichtman arichtman force-pushed the add-kcl-lang-server branch from b0a17a6 to 490e964 Compare March 25, 2025 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-support Area: Support for programming/text languages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add KCL language server support
3 participants