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

Documentation request: document how to install language server support #1893

Closed
aral opened this issue Mar 30, 2022 · 7 comments
Closed

Documentation request: document how to install language server support #1893

aral opened this issue Mar 30, 2022 · 7 comments
Labels
A-documentation Area: Documentation improvements C-enhancement Category: Improvements E-good-first-issue Call for participation: Issues suitable for new contributors

Comments

@aral
Copy link
Contributor

aral commented Mar 30, 2022

How I thought it would work

I install Helix and LSP support would automatically be installed for me for supported languages.

Why I thought that

The output from the installation process makes it look like language support is being fetched and built for a number of languages. I didn’t see it mentioned that this does not include LSP/autocomplete support.

How it should work

I would still expect LSP support to be automatically installed for common languages. Barring that…

Suggested documentation

Autocomplete does not work by default in Helix as language servers are not automatically installed. Please follow the guides to install the language server for the supported languages:

  1. TypeScript

e.g., TypeScript

Requires Node.js/npm (minimum version?)

  1. Install typescript-language-server:
npm install -g typescript-language-server
  1. Install typescript:
npm install -g typescript
@aral aral added the C-enhancement Category: Improvements label Mar 30, 2022
@the-mikedavis the-mikedavis added the A-documentation Area: Documentation improvements label Mar 30, 2022
@sudormrfbin
Copy link
Member

I suppose we can also expand the output of --health to indicate that autocomplete, etc will not work if LSP binary is not found and then point to aforementioned future documentation. On a broader note --health tells you if something is broken, but not how to fix it; we should add doc links at appropriate places.

@kirawi kirawi added the E-good-first-issue Call for participation: Issues suitable for new contributors label Apr 1, 2022
@David-Else
Copy link
Contributor

All the information required has already been compiled here: https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md

I had a quick go at extracting the default language servers used by Helix, removing the redundant information regarding the Neovim setup, and reformatting it. It would take quite a while to create the entire document, so please can I get some feedback if this would be useful.

There is no point in duplicating the Neovim peoples' excellent work, but simply linking to the Neovim docs would make things far too complex and annoying. Most of it is not relevant to Helix users.

Each link under LSP goes direct to the instructions, here is what I have so far as an example:

how-to-install-default-language-servers.md

The following are the default Helix language servers. To use them you must install them manually following the instructions below.

Language LSP
bash bashls
c clangd
c-sharp OmniSharp
cmake cmake-language-server
cpp clangd
dart dart
dockerfile docker-langserver
elixir elixir-ls
elm elm-language-server
go gopls
haskell haskell-language-server-wrappe…
hcl terraform-ls
javascript typescript-language-server
julia julia
kotlin kotlin-language-server
lean lean
mint mint
nix rnix-lsp
prolog swipl
python pylsp
racket racket
rescript rescript-language-server
ruby solargraph
rust rust-analyzer
scala metals
solidity solc
svelte svelteserver
tsx typescript-language-server
typescript typescript-language-server
zig zls

bashls

https://github.com/mads-hartmann/bash-language-server

bash-language-server can be installed via npm:

npm i -g bash-language-server

Language server for bash, written using tree sitter in typescript.

clangd

https://clangd.llvm.org/installation.html

NOTE: Clang >= 9 is recommended! See this issue for more.

clangd relies on a JSON compilation database specified
as compile_commands.json or, for simpler projects, a compile_flags.txt.
For details on how to automatically generate one using CMake look here. Alternatively, you can use Bear.

@the-mikedavis
Copy link
Member

Ah, wonderful! I think a new Wiki page would be good for this so it's easy to compile and keep up to date gradually, and multiple people can contribute easily. Would you like to set this up @David-Else? What you have here looks like a good start. For the list of default language servers, we should link to https://docs.helix-editor.com/lang-support.html or point people towards hx --health so it's automatically kept up to date. I would also add a note saying that operating-system level package managers (brew, chocolatey, linux package managers) tend to carry language servers as well.

@David-Else
Copy link
Contributor

@the-mikedavis Yes, I will sort it out. The Wiki has an automatic table of contents, so it should be easy for users to go straight to the language server they want to install. I will leave out the current table and point to the page you linked. I will credit the original nvim-lspconfig site for the content too.

Should this list of default language servers be for the latest release version of helix, or include language servers that may be in the master branch? (not that there are any at the moment, but I want to make that clear for people who might update the WIKI)

I had a look at https://pkgs.org/search/?q=lsp and could not find many language servers of note. Did you have any in mind? I don't know much about brew or chocolatey, would there be advantages to using them if it were also on something like NPM?

@the-mikedavis
Copy link
Member

Oh hmm I suppose I'm a bit spoiled by Nix - it tends to have just about everything. Nixpkgs has rust-analyzer (here), as do the arch repos (here). If I look around for a less common LSP like elixir-ls I don't see much in the linux repos though. I'm mostly interested in a small note maybe at the top of that wiki that points out that an OS level package manager is potentially an option, so it's up to the user how they'd like to install. (Personally I would never install a global package through NPM instead of Nix since it's very easy to replicate global package state and configuration across machines with Nix.)

For default language servers docs on the master branch: https://docs.helix-editor.com/master/lang-support.html (note the master part: we publish docs there on pushes to master and separately for the releases). That would be an advantage of pointing to hx --health instead though: it will show the default language servers for whatever version of helix one has installed.

@David-Else
Copy link
Contributor

@the-mikedavis I have done it, https://github.com/helix-editor/helix/wiki/How-to-install-the-default-language-servers , what do you think?

@the-mikedavis
Copy link
Member

Looks great! Thanks for putting this all together @David-Else!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-documentation Area: Documentation improvements C-enhancement Category: Improvements E-good-first-issue Call for participation: Issues suitable for new contributors
Projects
None yet
Development

No branches or pull requests

5 participants