Skip to content
ShalokShalom edited this page Jan 23, 2024 · 4 revisions

Kate with Julia LSP support

LanguageServer.jl can be easily used with Kate by using the pre-defined LSP setting that comes included with every Kate install.

Preparation

  1. Enable the LSP plugin in your Kate installation (Settings -> Configure Kate -> Plugins).
  2. LanguageServer.jl has to be installed locally on your PC. It is recommended to install it into the base environment, i.e. @vX.Y. Open a Julia instance, run ] and then add LanguageServer, and it will be available to use in all other environments.

Custom LSP setting

The default setting should cover most use cases (including Julia installations via Juliaup). But it also serves as a quick and easy starting point to copy and modify it, should you have a custom Julia installation that requires a few tweaks to the LSP setting.

Here's a template to use for a custom Julia LSP config that can be added to Kate in the LSP settings (Settings -> Configure Kate -> LSP Client -> User Server Settings):

{
    "servers": {
        "julia": {
            "command": ["julia", "-e", "using LanguageServer; runserver();"],
            "root": ".",
            "path": ["%{ENV:HOME}/.juliaup/bin"],
            "url": "https://github.com/julia-vscode/LanguageServer.jl",
            "highlightingModeRegex": "^Julia$"
        }
    }
}