Skip to content

How to update the language server

jwortmann edited this page Dec 11, 2021 · 5 revisions

This is a small guide for maintainers of this repository how to update the language server to the latest version and make a new release for LSP-julia.

The language server consist of the Julia packages LanguageServer.jl, SymbolServer.jl + dependencies and must be installed via the Julia package manager. To ensure a compatible version of LanguageServer.jl to this LSP-julia plugin, LanguageServer.jl and SymbolServer.jl should be pinned to a certain commit (actual tags/releases of LanguageServer.jl seem to be quite infrequent).

The following steps are necessary to update the packages:

  1. Go to https://github.com/julia-vscode/LanguageServer.jl and https://github.com/julia-vscode/SymbolServer.jl and note/copy the latest commit hashes from the master branches (or the hashes of the compatible commits which should be used).
  2. Navigate into the directory where the Project.toml and Manifest.toml files for the language server are stored.
    • Windows: C:\Users\<username>\AppData\Local\Sublime Text\Package Storage\LSP-julia\<commit-hash>
    • macOS: /Users/<username>/Library/Caches/Sublime Text/Package Storage/LSP-julia/<commit-hash>
  3. Start Julia in that directory and activate the environment with Julia's package manager:
    julia> ]
    (@v1.7) pkg> activate .
    (aa8287a) pkg>
    
  4. Remove the LanguageServer and SymbolServer packages:
    (aa8287a) pkg> remove LanguageServer
    (aa8287a) pkg> remove SymbolServer
    
  5. Add the LanguageServer and SymbolServer packages with their latest commit (example commit hash below):
    (aa8287a) pkg> add LanguageServer#dc87d7211dbdffdfaff12edac3a25182ac4407fb
    (aa8287a) pkg> add SymbolServer#8e21aeb8cb7ae792b89899b9153f74d4a35b9f1a
    
  6. Copy the Manifest.toml file which was just updated by the Julia package manageer from the current folder into LSP-julia/server (the folder from this repository).
  7. Open the file plugin.py and update the commit hash string returned by the server_version() method of the JuliaLanguageServer class. This can in theory be an arbitrary string, but I prefer to use the 7-digit short commit hash of the LanguageServer.jl version here. It will be used for the folder name under Package Storage/LSP-julia, and to check whether the current version is installed.
  8. Restart Sublime Text and open a Julia file. The plugin should create the folder with the new commit hash and instantiate the environment (again). To be on the very safe side, optionally delete the LanguageServer and SymbolServer folders under .julia/packages before doing this step, so that the package manager is forced to download the packages again. Ensure that the server can start and that everything works as expected.
  9. To create a new release of LSP-julia for Package Control, commit the changes and push a new tag to this repository.
Clone this wiki locally