ajuvercr / jsonld-lsp

https://ajuvercr.github.io/jsonld-lsp/
MIT License
13 stars 1 forks source link

More usage instructions in README #5

Open hoijui opened 10 months ago

hoijui commented 10 months ago

Woah cool! :-) glad to see this, and even in Rust! thank you!

I am mostly interested in the turtle support, but.. think I did not yet get it working well. I would like to see instructions for that in the README too, and next to NVim, also for Helix - A quite well received Vim/Kakoune alternative written in Rust.

This is what I did to configure Helix, and .. I think it .. works, but am not sure:

~/.config/helix/languages.toml:

[language-server.turtle-lsp]
command = "turtle-language-server"

[[language]]
name = "turtle"
scope = "source.ttl"
injection-regex = "turtle"
file-types = ["ttl"]
comment-token = "#"
indent = { tab-width = 2, unit = "  " }
#formatter = { command = "mylang-formatter" , args = ["--stdin"] }
language-servers = [ "turtle-lsp" ]
ajuvercr commented 10 months ago

I think command you are looking for is turtle-language-server. Can you report back it that works?

hoijui commented 10 months ago

That is what I used, as you can see in the second line in the config file. Thing is.. it might work, but syntax highlighting does not work for sure, and that is what I use for validating visually, if it works or not. ... should that be working for turtle?

ajuvercr commented 10 months ago

I did some digging.

For me, it worked pretty easily with helix with this configuration inside ~/.config/helix/languages.toml

[language-server.turtle-lsp]
command = "turtle-language-server"

[[language]]
name = "turtle"
scope = "source.ttl"
injection-regex = "turtle"
file-types = ["ttl"]
comment-token = "#"
indent = { tab-width = 2, unit = "  " }
language-servers = [ "turtle-lsp" ]
roots = [] # note root

Result: 2024-01-18T11:34:00,184274897+01:00

The problem with highlighting is that the lsp uses semantic tokens to highlight the code (not treesitter), which is currently not yet implemented by helix. https://github.com/helix-editor/helix/pull/9360

But it does look like people are working on it.