Skip to content

The language server for Elixir that just works. Ready for early adopters!

License

Notifications You must be signed in to change notification settings

moissela/next-ls

 
 

Repository files navigation

Next LS

Discord Hex.pm GitHub Discussions

The language server for Elixir that just works. 😎

Still in heavy development, currently supporting the following features:

  • Compiler Diagnostics
  • Code Formatting
  • Workspace Symbols
  • Document Symbols
  • Go To Definition
  • Workspace Folders
  • Find References
  • Extensions
    • Credo

Editor Support

  • Neovim: elixir-tools.nvim
  • VSCode: elixir-tools.vscode
  • Emacs

    Using eglot:

    (require 'eglot)
    
    (add-to-list 'exec-path "path/to/next-ls/bin/")
    
    (with-eval-after-load 'eglot
      (add-to-list 'eglot-server-programs
                   `((elixir-ts-mode heex-ts-mode elixir-mode) .
                     ("nextls" "--stdio=true"))))
    
    (add-hook 'elixir-mode-hook 'eglot-ensure)
    (add-hook 'elixir-ts-mode-hook 'eglot-ensure)
    (add-hook 'heex-ts-mode-hook 'eglot-ensure)
  • Helix

    Add the following config to your ~/.config/helix/languages.toml.

    [[language]]
    name = "elixir"
    scope = "source.elixir"
    language-server = { command = "path/to/next-ls", args = ["--stdio=true"] }

Installation

The preferred way to use Next LS is through one of the supported editor extensions.

If you need to install Next LS on it's own, you can download the executable hosted by the GitHub release. The executable is an Elixir script that utilizes Mix.install/2.

Development

If you are making changes to NextLS and want to test them locally you can run bin/start --port 9000 to start the language server (port 9000 is just an example, you can use any port that you want as long as it is not being used already).

Then you can configure your editor to connect to NextLS using that port.

elixir-tools.nvim

{
  nextls = {enable = true, port = 9000}
}

Visual Studio Code

{
    "elixir-tools.nextls.adapter": "tcp",
    "elixir-tools.nextls.port": 9000,
}

Note

Next LS creates an .elixir-tools hidden directory in your project, but it will be automatically ignored by git.

About

The language server for Elixir that just works. Ready for early adopters!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Elixir 99.7%
  • Shell 0.3%