Experimenting with the Universal Language Server support for Sublime Text 3 plugin, available here and Elixir, using the Language Server Protocol.
Right now, and sadly, the LSP plugin doesn't include Elixir out of the box. A bit of copying some files around and editing, is still required. I am focusing on OSX only, in this note.
Install the following:
- Sublime 3
- the TextMate and Sublime Text Bundle for the Elixir programming language, from elixir-editors/elixir-tmbundle
- Language Server Protocol support for Sublime Text 3, also from tomv564/LSP
- and of course Elixir.
First make sure you have Elixir, Sublime3 and the plugins above, properly installed. Then edit the following file: ~/Library/Application Support/Sublime\ Text\ 3/Packages/LSP/LSP.sublime-settings
, and add the following entry, to the {"clients": { ..
structure:
"elixir":
{
"command": ["elixir"],
"scopes": ["source.ex", "source.exs"],
"syntaxes": ["Packages/elixir-tmbundle/Syntaxes/Elixir.tmLanguage", "Packages/elixir-tmbundle/Syntaxes/EEx.tmLanguage", "Packages/elixir-tmbundle/Syntaxes/HTML (EEx).tmLanguage"],
"languageId": "elixir"
}
That's all. If while you edit the LSP.sublime-settings
file, your Sublime console is open (CTRL ~
), you can see the support for Elixir loading and be available for immediate use, excerpt:
LSP: Config added: clangd (enabled)
LSP: Config added: rls (enabled)
LSP: Config added: reason (enabled)
LSP: Config added: elixir (enabled)
LSP: Config added: pyls (enabled)
LSP: Config added: jsts (enabled)
LSP: Config added: dotty (enabled)
LSP: Config added: golsp (enabled)
LSP: Config added: ocaml (enabled)
- all this work can be scripted, but I am lazy :P
- the inline Elixir doc doesn't have a nice formatter, it will be hard to read, but it works
HTH