-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Documentation for how to add an lsp #340
Comments
I am not sure if it could be configured currently. I think it can't. |
I think the general way to configure things is: Copy languages.toml to language-server = { command = "typescript-language-server", args = ["--stdio"] } But I don't actually know what you can change there. |
I think he meant the language specific configuration, not like the args. |
That's still a bit of a hack. We should probably allow adding new language definitions without the need for the user to copy the I think the best way here would be to have |
I actually meant exactly what @thomkeh said |
Would this PR solve the issue? |
Should this be closed now that #654 is merged? |
The thread has multiple features mentioned, so I'll answer them in order:
You have to check the supported list of LSPs and install the one corresponding to your language.
See the "Default LSP" column in https://docs.helix-editor.com/lang-support.html.
https://github.com/helix-editor/helix/wiki/How-to-install-the-default-language-servers
Since #654 is merged instead of copying the default
It's possible to send config values to the LSP itself for fine-tuning it's behavior, see #2063 (comment) for an example. This issue could be closed, but we still don't have any solid, centralized docs in https://docs.helix-editor.com describing LSP in detail (including why it's required, pointing to the LSP installation wiki, etc). |
I've just heard about helix editor and wanted to try it, LSP without config - nice. Checked out the docs, and installed taplo, as recommended, with
Searching the web didn't help, except to find the diagnostics above.
|
It looks like you're running an older helix release - taplo was added after the 22.03 release: #2302 so you'll need to run 22.05 |
I think it would be good to show a full example of how to translate a more complicated setup into the format that helix wants. #2063 (comment) provides a great example of how to port over a simple configuration, but I'm trying to work with a configuration with nested tables and it's not going well. |
@cinerea0 Could you share the configuration with the nested tables? We could add the ported examples to the wiki too. |
@sudormrfbin After a bit more tinkering I realized that it isn't so much a nested table as it is lua not having the syntax to express the difference between tables and arrays, which TOML does. I've still included my configurations below in case they make a good example. Lua for Neovimtexlab = {
build = {
forwardSearchAfter = true,
onSave = true
},
chktex = {
onEdit = true,
},
forwardSearch = {
executable = 'zathura',
args = { '--synctex-forward', '%l:1:%f', '%p' }
},
} TOML for Helix[[language]]
name = "latex"
config = { texlab = { build = { onSave = true, forwardSearchAfter = true }, forwardSearch = { executable = "zathura", args = [ "--synctex-forward", "%l:1:%f", "%p" ] }, chktex = { onEdit = true } } } EDIT: Actually, there were nested tables, and the TOML representation is quite awkward looking. |
The TOML representation doesn't look that bad if you spread it out (I think I did it correctly, no Latex knowledge here). [[language]]
name = "latex"
[language.config.texlab.build]
onSave = true
forwardSearchAfter = true
[language.config.texlab.forwardSearch]
executable = "zathura"
args = [ "--synctex-forward", "%l:1:%f", "%p" ]
[language.config.texlab.chktex]
onEdit = true |
@MGlolenstine That does indeed work. We were workshopping it in #2758, for some reason no one came up with that representation. |
@cinerea0 I'm glad I was able to help! The beauty of TOML is that you can reformat and reorganise your keys as much as you want to make it as readable as you want :) |
Using comments in this page I was able to get forward synctex search to work on macos (with Skim). I wonder if anybody has got inverse search to work as well. Apparently this is still a problem with helix itself. I searched for a while and I couldn't find a way to ask a current hx process to switch to a particular file:lineno via a shell command... Ideally it could be something like Is there any way this feature could be added? By the way, helix rocks! I was (and still am) a vscode user, but I have so much fun using helix that I am really considering switching to it for all my work. You have my admiration for the excellent work 😊 |
Apparently the config parameter is now defunct. How do we configure this now? |
@robrecord good question. I just added a rust config thing to use clippy and would also like to know how to make it work |
@gozes @robrecord I think I figured it out. Like some other lsp configs it seems with the new way things work we need to turn the previously mentioned config into: [[language]]
name = "latex"
[language-server.texlab.config.texlab.build]
onSave = true
forwardSearchAfter = true
[language-server.texlab.config.texlab.forwardSearch]
executable = "zathura"
args = [ "--synctex-forward", "%l:1:%f", "%p" ]
[language-server.texlab.config.texlab.chktex]
onEdit = true Basically, all the keys given in the texlab Wiki like This works for me (I built from master on the 26th of august), hope this works for you too! |
I think we can close this, this issue is just quite old/stale. I consider the docs at https://docs.helix-editor.com/master/languages.html#language-server-configuration sufficient, especially with the many examples in the wiki: https://github.com/helix-editor/helix/wiki/How-to-install-the-default-language-servers. If people have specific suggestions on how the docs can be improved they can open new issues (or even better a PR). |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Describe your feature request
Nowhere in the docs does it actually explain how you configure an LSP.
I just found this project and whilst it looks interesting I have essentially no way of understanding how to set it up without going through the source code.
looks interesting though :)
The text was updated successfully, but these errors were encountered: