Kakoune Language Server Protocol Client

Overview

Kakoune Language Server Protocol Client

kak-lsp is a Language Server Protocol client for Kakoune implemented in Rust.

Installation

Note
kak-lsp.toml destination in all described installation methods is just an example. Also, kak-lsp doesn’t read the configuration file from the current working directory or binary’s dir by default. Please consult Configuring kak-lsp to figure out where does kak-lsp expect kak-lsp.toml to be in your environment and how to specify a custom path to it. However, if you don’t need to change configuration then feel free to skip copying it anywhere as the default configuration is embedded into kak-lsp binary.

Pre-built binaries

MacOS

Homebrew
brew install kak-lsp/kak-lsp/kak-lsp
Manual
curl -O -L https://github.com/kak-lsp/kak-lsp/releases/download/v9.0.0/kak-lsp-v9.0.0-x86_64-apple-darwin.tar.gz
tar xzvf kak-lsp-v9.0.0-x86_64-apple-darwin.tar.gz

# replace `~/.local/bin/` with something on your `$PATH`
mv kak-lsp ~/.local/bin/

mkdir -p ~/.config/kak-lsp
mv kak-lsp.toml ~/.config/kak-lsp/

Linux

Package managers
  • Arch Linux: pacman -S kak-lsp or AUR/kak-lsp-git

  • Void Linux: xbps-install -S kak-lsp

  • Fedora Copr: sudo dnf copr enable atim/kakoune -y && sudo dnf install kak-lsp

Others
wget https://github.com/kak-lsp/kak-lsp/releases/download/v9.0.0/kak-lsp-v9.0.0-x86_64-unknown-linux-musl.tar.gz
tar xzvf kak-lsp-v9.0.0-x86_64-unknown-linux-musl.tar.gz

# replace `~/.local/bin/` with something on your `$PATH`
mv kak-lsp ~/.local/bin/

mkdir -p ~/.config/kak-lsp
mv kak-lsp.toml ~/.config/kak-lsp/

From the source

Generally, you need the latest stable version of Rust to build kak-lsp.

git clone https://github.com/kak-lsp/kak-lsp
cd kak-lsp

cargo install --locked --force --path .

# replace `~/.config` with OS-specific dir as described at https://docs.rs/dirs/2.0.1/dirs/fn.config_dir.html
mkdir -p ~/.config/kak-lsp

# or just link if you are okay with default config
cp kak-lsp.toml ~/.config/kak-lsp/

With plug.kak

If you don’t mind using plugin manager, you can install kak-lsp with plug.kak. Add this code to your kakrc:

plug "kak-lsp/kak-lsp" do %{
    cargo install --locked --force --path .
}

You can replace cargo install with ln -sf target/release/kak-lsp ~/.local/bin/ where ~/.local/bin/ can be replaced to something in your $PATH.

Examples of configuration with plug.kak can be found at Wiki.

Language servers

kak-lsp doesn’t manage installation of language servers, please install them by yourself for the languages you plan to use kak-lsp with. Please consult the How to install servers wiki page for quick installation of language servers supported by kak-lsp out of the box.

Usage

Note
Contents below corresponds to the master branch HEAD and could be slightly out-of-sync with the version installed from pre-built binaries. The most common case is new commands being in a pre-release testing stage. Please refer README.asciidoc revision tagged with version you use or README.asciidoc from the release archive (included starting from version 5.10.0).

To enable LSP support for configured languages (see the next section) just add the following commands to your kakrc:

eval %sh{kak-lsp --kakoune -s $kak_session}
lsp-enable

A bit more involved but recommended way is to enable kak-lsp only for specific filetypes you need via lsp-enable-window, e.g.:

eval %sh{kak-lsp --kakoune -s $kak_session}
hook global WinSetOption filetype=(rust|python|go|javascript|typescript|c|cpp) %{
    lsp-enable-window
}

Either way you get:

  • completions

  • lsp-definition command to go to definition, mapped to gd by default

  • lsp-hover command to show hover info (including relevant diagnostics when available)

    • to automatically show hover when you move around use lsp-auto-hover-enable

    • to show hover anchored to hovered position do set global lsp_hover_anchor true

    • to exclude diagnostics do set-option global lsp_show_hover_format 'printf %s "${lsp_info}"'

  • lsp-declaration command to jump to the declaration of the symbol under the main cursor

  • lsp-definition command to jump to the definition of the symbol under the main cursor

  • lsp-type-definition command to jump to the definition of the type of the symbol under the main cursor

  • lsp-implementation command to find implementations for a symbol under the main cursor

  • lsp-references command to find references for a symbol under the main cursor, mapped to gr by default

    • for the previous five commands, *goto* buffer has grep filetype so you can press <ret> on a line or use the grep-jump command

  • lsp-find-error command to jump to the next or previous error in the file

    • lsp-references-previous-match and lsp-references-next-match to navigate between references

  • lsp-highlight-references command to highlight references in current buffer for a symbol under the main cursor with Reference face (which is equal to MatchingChar face by default)

  • lsp-document-symbol command to list current buffer’s symbols

  • lsp-workspace-symbol command to list project-wide symbols matching the query

  • lsp-workspace-symbol-incr command to incrementally list project-wide symbols matching the query

    • *symbols* buffer has grep filetype so you can press <ret> on a line or use the grep-jump command

    • lsp-symbols-previous-match and lsp-symbols-next-match to navigate between symbols

  • lsp-diagnostics command to list project-wide diagnostics (current buffer determines project and language to collect diagnostics)

    • *diagnostics* buffer has make filetype so you can press <ret> on a line or use the make-jump command

  • inline diagnostics highlighting using DiagnosticError and DiagnosticWarning faces; could be disabled with lsp-inline-diagnostics-disable command

  • flags in the left margin on lines with errors or warnings; could be disabled with lsp-diagnostic-lines-disable command

  • lsp-formatting command to format current buffer, according to the tabstop and lsp_insert_spaces options

  • lsp-formatting-sync command to format current buffer synchronously, suitable for use with BufWritePre hook:

hook global WinSetOption filetype=rust %{
    hook window BufWritePre .* lsp-formatting-sync
}
  • lsp-rename <new_name> and lsp-rename-prompt commands to rename the symbol under the main cursor.

  • lsp-code-actions command to open a menu with code actions available for the current main cursor position

  • lsp_diagnostic_error_count and lsp_diagnostic_warning_count options which contains number of diagnostics errors and warnings published for the current buffer. For example, you can put it into your modeline to see at a glance if there are errors in the current file

  • starting new kak-lsp session when Kakoune session begins and stopping it when Kakoune session ends

Note
By default, kak-lsp exits when it doesn’t receive any request from Kakoune during 30 minutes, even if Kakoune session is still up and running. Change server.timeout in kak-lsp.toml to tweak duration, or set it to 0 to disable this behaviour. In any scenario making new request would lead to attempt to spin up server if it is down.
  • lsp user mode. The following example mapping gives you access to the shortcuts from below table after typing ,l.

map global user l %{: enter-user-mode lsp<ret>} -docstring "LSP mode"
Binding Command

a

lsp-code-actions

c

lsp-capabilities

d

lsp-definition

e

lsp-diagnostics

f

lsp-formatting

h

lsp-hover

i

lsp-implementation

r

lsp-references

R

lsp-rename-prompt

s

lsp-signature-help

S

lsp-document-symbol

o

lsp-workspace-symbol-incr

n

lsp-find-error

p

lsp-find-error --previous

y

lsp-type-definition

&

lsp-highlight-references

To know which subset of kak-lsp commands is backed by current buffer filetype’s language server use lsp-capabilities command.

All commands are also represented as subcommands of umbrella lsp command if you prefer this style. For example, you can use lsp references instead of lsp-references.

Configuration

kak-lsp itself has configuration, but it also adds configuration options to Kakoune that affect the Kakoune integration.

Configuring kak-lsp

kak-lsp is configured via configuration file in TOML format. By default kak-lsp tries to read kak-lsp/kak-lsp.toml under OS-specific config dir as described here, but you can override it with command-line option --config.

Look into the default kak-lsp.toml in the root of repository, it should be quite self-descriptive. The only example which is not covered by default kak-lsp.toml is setting initialization options for a language server. It’s done like this:

[language.go.initialization_options]
formatTool = "gofmt"

Important: The configuration file does not extend the default configuration, but rather overwrites it. This means that if you want to customize any of the configuration, you must copy the entire default configuration and then edit it.

If you are setting any options to server via cli do not forget to append them to %sh{kak-lsp --kakoune …​} in your kakrc. It’s not needed if you change options in ~/.config/kak-lsp/kak-lsp.toml file.

Please let us know if you have any ideas about how to make default config more sensible.

Configuring Kakoune

kak-lsp’s Kakoune integration declares the following options:

  • lsp_completion_trigger (str): This option is set to a Kakoune command, which is executed every time the user pauses in insert mode. If the command succeeds, kak-lsp will send a completion request to the language server.

  • lsp_diagnostic_line_error_sign (str): When using lsp-diagnostic-lines-enable and the language server detects an error, kak-lsp will add a flag to the left-most column of the window, using this string and the LineFlagErrors face.

  • lsp_diagnostic_line_warning_sign (str): When using lsp-diagnostic-lines-enable and the language server detects an warning, kak-lsp will add a flag to the left-most column of the window, using this string and the LineFlagErrors face.

  • lsp_hover_anchor (bool): When using lsp-hover or lsp-auto-hover-enable, if this option is true then the hover information will be displayed next to the active selection. Otherwise, the information will be displayed in a box in the lower-right corner.

  • lsp_hover_max_lines (int): If greater than 0 then limit rendered hover information to the given number of lines.

  • lsp_hover_insert_mode_trigger (str): This option is set to a Kakoune command. When using lsp-auto-hover-insert-mode-enable, this command is executed every time the user pauses in insert mode. If the command succeeds, kak-lsp will send a hover-information request for the text selected by the command.

  • lsp_insert_spaces (bool): When using lsp-formatting, if this option is true, kak-lsp will ask the language server to indent with spaces rather than tabs.

  • lsp_auto_highlight_references (bool): If this option is true then lsp-highlight-references is executed every time user pauses in normal mode.

  • lsp_server_configuration (str-to-str-map): At startup, and when this option is modified, kak-lsp will send its contents to the language server in a workspace/DidChangeConfiguration notification. Some languages servers allow dynamic configuration in this way. See below for more information about this option.

  • lsp_server_initialization_options (str-to-str-map): When initialize request is sent to the language server kak-lsp will ask Kakoune for this option value in the buffer which provoked start of the language server. If value is non-empty then it will override initialization_options set for the buffer’s filetype in kak-lsp.toml. See below for more information about this option.

The lsp_server_configuration and lsp_server_initialization_options options are unusual, since the language server wants deeply-nested JSON objects, which are hard to represent in Kakoune. If a language server’s documentation says it wants a structure like this:

{
    "settings": {
        "rust": {
            "clippy_preference": "on"
        }
    }
}

…​you can achieve the same thing in Kakoune with:

set-option global lsp_server_configuration rust.clippy_preference="on"

That is, the keys of the lsp_server_configuration option are a .-delimited path of JSON objects. For implementation reasons, the values use TOML serialisation rules rather than JSON rules, but they’re pretty much the same thing for strings, numbers and booleans, which are the most common configuration types.

Inlay hints for rust-analyzer

Inlay hints are a feature supported by rust-analyzer, which show inferred types, parameter names in function calls, and the types of chained calls inline in the code. To enable support for it in kak-lsp, add the following to your kakrc:

hook global WinSetOption filetype=rust %{
  hook window -group rust-inlay-hints BufReload .* rust-analyzer-inlay-hints
  hook window -group rust-inlay-hints NormalIdle .* rust-analyzer-inlay-hints
  hook window -group rust-inlay-hints InsertIdle .* rust-analyzer-inlay-hints
  hook -once -always window WinSetOption filetype=.* %{
    remove-hooks window rust-inlay-hints
  }
}

You can change the face of the hints with set-face global InlayHint <face>.

Semantic Tokens

kak-lsp supports the semanticTokens feature for semantic highlighting. If the language server supports it, you can enable it with:

hook global WinSetOption filetype=<language> %{
  hook window -group semantic-tokens BufReload .* lsp-semantic-tokens
  hook window -group semantic-tokens NormalIdle .* lsp-semantic-tokens
  hook window -group semantic-tokens InsertIdle .* lsp-semantic-tokens
  hook -once -always window WinSetOption filetype=.* %{
    remove-hooks window semantic-tokens
  }
}

The faces used for semantic tokens and modifiers can be modified in kak-lsp.toml, under the semantic_tokens and semantic_token_modifiers sections. The modifiers are used first if available, and then the main token type is used if no modifier face is specified.

Inlay Diagnostics

kak-lsp supports showing diagnostics inline after their respective line, but this behaviour can be somewhat buggy and must be enabled explicitly:

lsp-inlay-diagnostics-enable global

Snippets

kak-lsp has experimental support for snippets. It is enabled by setting snippet_support = true at the top level of the config.

It uses the two faces SnippetsNextPlaceholders and SnippetsOtherPlaceholders, you may want to customize those.

To properly use snippets, you’ll probably want something like this:

def -hidden insert-c-n %{
 try %{
   lsp-snippets-select-next-placeholders
   exec '<a-;>d'
 } catch %{
   exec -with-hooks '<c-n>'
 }
}
map global insert <c-n> "<a-;>: insert-c-n<ret>"

This maps <c-n> to select the next placeholder if there is one, and otherwise executes <c-n> as normal

Limitations

Encoding

kak-lsp works only with UTF-8 documents.

Position.character interpretation

Currently, kak-lsp doesn’t conform to the spec regarding the interpretation of Position.character. LSP spec says that

A position inside a document (see Position definition below) is expressed as a zero-based line and character offset. The offsets are based on a UTF-16 string representation. So a string of the form a𐐀b the character offset of the character a is 0, the character offset of 𐐀 is 1 and the character offset of b is 3 since 𐐀 is represented using two code units in UTF-16.

However, kak-lsp treats Position.character as an offset in UTF-8 code points by default. Fortunately, it appears to produce the same result within the Basic Multilingual Plane (BMP) which includes a lot of characters.

Unfortunately, many language servers violate the spec as well, and in an inconsistent manner. Please refer https://github.com/Microsoft/language-server-protocol/issues/376 for more information. There are two main types of violations we met in the wild:

1) Using UTF-8 code points, just like kak-lsp does. Those should work well with kak-lsp for characters outside BMP out of the box.

2) Using UTF-8 code units (bytes), just like Kakoune does. Those are supported by kak-lsp but require adding offset_encoding = "utf-8" to language server configuration in kak-lsp.toml.

Troubleshooting

If kak-lsp fails try to put this line in your kakrc after kak-lsp --kakoune invocation:

set global lsp_cmd "kak-lsp -s %val{session} -vvv --log /tmp/kak-lsp.log"

to enable debug logging.

If it will not give enough insights to fix the problem or if the problem is a bug in kak-lsp itself please don’t hesitate to raise an issue.

Note
Some Kakoune plugins could interfere with kak-lsp, particularly completions providers. E.g. racer.kak competes for autocompletion in Rust files.

Crashes

For troubleshooting crashes, you might like to run kak-lsp outside of Kakoune.

To do this:

  1. Before launching Kakoune, run kak-lsp with an arbitrary session ID (here foobar):

    kak-lsp -s foobar
  2. In a second terminal, run Kakoune with the same session ID:

    kak -s foobar

Versioning

kak-lsp follows SemVer with one notable difference from common practice: we don’t use 0 major version to indicate that product is not yet reached stability. Even for non-stable and not feature-complete product user should be clearly informed about breaking change. Therefore we start with major version 1 and increment it each time when upgrade requires user’s attention.

Comments
  • Kakoune waiting for kak-lsp to finish

    Kakoune waiting for kak-lsp to finish

    I have had this problem for quite some time, I haven't reported it yet because I think it is hard to debug, and I can live with it well enough.

    I shall describe it as well as possible.

    In files that do not have a language server (git commit or text/markdown file) sometimes (once a day) kakoune waits indefinitely for a shell command to finish. If I do killall kak-lsp, kakoune continues again. However if instead of doing killall kak-lsp I do ctrl-c in kakoune, my whole x server crashes.

    This problem only happens when I'm working in my default session which is started when I log in and which I often connect to.

    If I do ps -aux | grep kak I see the following processes.

    jjk        974  4.7  0.0  14120  7208 ?        R    13:48   6:58 kak -s default -d
    jjk       1427  0.0  0.0 143156  4840 ?        Sl   15:47   0:00 /home/jjk/git/kak-lsp-git/src/kak-lsp/target/release/kak-lsp -s default --daemonize --initial-request
    jjk       5771  0.0  0.0  13048  6376 pts/0    S+   16:08   0:00 kak -c default -e  edit %{/home/jjk/git/dance/tsconfig.json}; 
    jjk       5782  0.0  0.0   7100  1980 ?        S    16:08   0:00 sh -c  ( lsp_draft=$(printf '%s.' "${kak_opt_lsp_draft}" | sed 's/\\/\\\\/g' | sed 's/"/\\"/g' | sed "s/$(printf '\t')/\\\\t/g") lsp_draft=${lsp_draft%.} printf ' session  = "%s" client   = "%s" buffile  = "%s" filetype = "%s" version  = %d method   = "textDocument/didOpen" [params] draft    = """ %s""" ' "${kak_session}" "${kak_client}" "${kak_buffile}" "${kak_opt_filetype}" "${kak_timestamp}" "${lsp_draft}" | ${kak_opt_lsp_cmd} --request) > /dev/null 2>&1 < /dev/null & 
    jjk       5790  0.0  0.0   7100  1672 ?        S    16:08   0:00 sh -c  ((printf ' session  = "%s" client   = "%s" buffile  = "%s" filetype = "%s" version  = %d method   = "workspace/didChangeConfiguration" [params.settings] ' "${kak_session}" "${kak_client}" "${kak_buffile}" "${kak_opt_filetype}" "${kak_timestamp}"; eval set -- $kak_opt_lsp_server_configuration while [ $# -gt 0 ]; do     key=${1%%=*}     value=${1#*=}     quotedkey='"'$(printf %s "$key"|sed -e 's/\\/\\\\/' -e 's/"/\\"/')'"'      printf '%s = %s\n' "$quotedkey" "$value"      shift done ) | ${kak_opt_lsp_cmd} --request) > /dev/null 2>&1 < /dev/null & 
    jjk       5793  0.0  0.0  75200  5040 ?        Sl   16:08   0:00 /home/jjk/git/kak-lsp-git/src/kak-lsp/target/release/kak-lsp -s default --request
    jjk       5795  0.0  0.0  75200  5124 ?        Sl   16:08   0:00 /home/jjk/git/kak-lsp-git/src/kak-lsp/target/release/kak-lsp -s default --request
    jjk       5799  0.0  0.0   7100  1636 ?        S    16:08   0:00 sh -c  ((printf ' session  = "%s" client   = "%s" buffile  = "%s" filetype = "%s" version  = %d method   = "workspace/didChangeConfiguration" [params.settings] ' "${kak_session}" "${kak_client}" "${kak_buffile}" "${kak_opt_filetype}" "${kak_timestamp}"; eval set -- $kak_opt_lsp_server_configuration while [ $# -gt 0 ]; do     key=${1%%=*}     value=${1#*=}     quotedkey='"'$(printf %s "$key"|sed -e 's/\\/\\\\/' -e 's/"/\\"/')'"'      printf '%s = %s\n' "$quotedkey" "$value"      shift done ) | ${kak_opt_lsp_cmd} --request) > /dev/null 2>&1 < /dev/null & 
    jjk       5801  0.0  0.0  75200  4984 ?        Sl   16:08   0:00 /home/jjk/git/kak-lsp-git/src/kak-lsp/target/release/kak-lsp -s default --request
    jjk       5818  0.0  0.0   7100   424 ?        S    16:08   0:00 sh -c  (printf ' session   = "%s" client    = "%s" buffile   = "%s" filetype  = "%s" version   = %d method    = "textDocument/hover" [params.position] line      = %d column    = %d ' "${kak_session}" "${kak_client}" "${kak_buffile}" "${kak_opt_filetype}" "${kak_timestamp}" ${kak_cursor_line} ${kak_cursor_column} | ${kak_opt_lsp_cmd} --request) > /dev/null 2>&1 < /dev/null & 
    jjk       5821  0.0  0.0  75200  4876 ?        Sl   16:08   0:00 /home/jjk/git/kak-lsp-git/src/kak-lsp/target/release/kak-lsp -s default --request
    jjk       6091  0.0  0.0   7100   424 ?        S    16:08   0:00 sh -c  (printf ' session   = "%s" client    = "%s" buffile   = "%s" filetype  = "%s" version   = %d method    = "textDocument/hover" [params.position] line      = %d column    = %d ' "${kak_session}" "${kak_client}" "${kak_buffile}" "${kak_opt_filetype}" "${kak_timestamp}" ${kak_cursor_line} ${kak_cursor_column} | ${kak_opt_lsp_cmd} --request) > /dev/null 2>&1 < /dev/null & 
    jjk       6094  0.0  0.0  75200  4980 ?        Sl   16:08   0:00 /home/jjk/git/kak-lsp-git/src/kak-lsp/target/release/kak-lsp -s default --request
    jjk       6142  0.0  0.0   7100  1728 ?        S    16:08   0:00 sh -c  (printf ' session   = "%s" client    = "%s" buffile   = "%s" filetype  = "%s" version   = %d method    = "textDocument/hover" [params.position] line      = %d column    = %d ' "${kak_session}" "${kak_client}" "${kak_buffile}" "${kak_opt_filetype}" "${kak_timestamp}" ${kak_cursor_line} ${kak_cursor_column} | ${kak_opt_lsp_cmd} --request) > /dev/null 2>&1 < /dev/null & 
    jjk       6145  0.0  0.0  75200  5000 ?        Sl   16:08   0:00 /home/jjk/git/kak-lsp-git/src/kak-lsp/target/release/kak-lsp -s default --request
    jjk       6171  0.0  0.0   7100   424 ?        S    16:08   0:00 sh -c  (printf ' session   = "%s" client    = "%s" buffile   = "%s" filetype  = "%s" version   = %d method    = "textDocument/hover" [params.position] line      = %d column    = %d ' "${kak_session}" "${kak_client}" "${kak_buffile}" "${kak_opt_filetype}" "${kak_timestamp}" ${kak_cursor_line} ${kak_cursor_column} | ${kak_opt_lsp_cmd} --request) > /dev/null 2>&1 < /dev/null & 
    jjk       6174  0.0  0.0  75200  5180 ?        Sl   16:08   0:00 /home/jjk/git/kak-lsp-git/src/kak-lsp/target/release/kak-lsp -s default --request
    jjk       6219  0.0  0.0   7100  1632 ?        S    16:08   0:00 sh -c  (printf ' session   = "%s" client    = "%s" buffile   = "%s" filetype  = "%s" version   = %d method    = "textDocument/hover" [params.position] line      = %d column    = %d ' "${kak_session}" "${kak_client}" "${kak_buffile}" "${kak_opt_filetype}" "${kak_timestamp}" ${kak_cursor_line} ${kak_cursor_column} | ${kak_opt_lsp_cmd} --request) > /dev/null 2>&1 < /dev/null & 
    jjk       6222  0.0  0.0  75200  4980 ?        Sl   16:08   0:00 /home/jjk/git/kak-lsp-git/src/kak-lsp/target/release/kak-lsp -s default --request
    jjk       6283  0.0  0.0   7100  2752 ?        S    16:08   0:00 sh -c  ( lsp_draft=$(printf '%s.' "${kak_opt_lsp_draft}" | sed 's/\\/\\\\/g' | sed 's/"/\\"/g' | sed "s/$(printf '\t')/\\\\t/g") lsp_draft=${lsp_draft%.} printf ' session  = "%s" client   = "%s" buffile  = "%s" filetype = "%s" version  = %d method   = "textDocument/didChange" [params] draft    = """ %s""" ' "${kak_session}" "${kak_client}" "${kak_buffile}" "${kak_opt_filetype}" "${kak_timestamp}" "${lsp_draft}" | ${kak_opt_lsp_cmd} --request) > /dev/null 2>&1 < /dev/null 
    jjk       6284  0.0  0.0   7100  1896 ?        S    16:08   0:00 sh -c  ( lsp_draft=$(printf '%s.' "${kak_opt_lsp_draft}" | sed 's/\\/\\\\/g' | sed 's/"/\\"/g' | sed "s/$(printf '\t')/\\\\t/g") lsp_draft=${lsp_draft%.} printf ' session  = "%s" client   = "%s" buffile  = "%s" filetype = "%s" version  = %d method   = "textDocument/didChange" [params] draft    = """ %s""" ' "${kak_session}" "${kak_client}" "${kak_buffile}" "${kak_opt_filetype}" "${kak_timestamp}" "${lsp_draft}" | ${kak_opt_lsp_cmd} --request) > /dev/null 2>&1 < /dev/null 
    jjk       6292  0.0  0.0  75200  5124 ?        Sl   16:08   0:00 /home/jjk/git/kak-lsp-git/src/kak-lsp/target/release/kak-lsp -s default --request
    jjk      11718  0.0  0.0   7100  2836 pts/2    S+   16:15   0:00 sh -c      autoload_directory() {         find -L "$1" -type f -name '*\.kak' \             | sed 's/.*/try %{ source "&" } catch %{ echo -debug Autoload: could not load "&" }/'     }      echo "colorscheme default"      if [ -d "${kak_config}/autoload" ]; then         autoload_directory ${kak_config}/autoload     elif [ -d "${kak_runtime}/autoload" ]; then         autoload_directory ${kak_runtime}/autoload     fi      if [ -f "${kak_runtime}/kakrc.local" ]; then         echo "source '${kak_runtime}/kakrc.local'"     fi      if [ -f "${kak_config}/kakrc" ]; then         echo "source '${kak_config}/kakrc'"     fi 
    jjk      32030  0.0  0.0   7100   420 ?        S    16:07   0:00 sh -c  (printf ' session   = "%s" client    = "%s" buffile   = "%s" filetype  = "%s" version   = %d method    = "textDocument/hover" [params.position] line      = %d column    = %d ' "${kak_session}" "${kak_client}" "${kak_buffile}" "${kak_opt_filetype}" "${kak_timestamp}" ${kak_cursor_line} ${kak_cursor_column} | ${kak_opt_lsp_cmd} --request) > /dev/null 2>&1 < /dev/null & 
    jjk      32032  0.0  0.0  75200  5044 ?        Sl   16:07   0:00 /home/jjk/git/kak-lsp-git/src/kak-lsp/target/release/kak-lsp -s default --request
    jjk      32039  0.0  0.0   7100   424 ?        S    16:07   0:00 sh -c  (printf ' session  = "%s" client   = "%s" buffile  = "%s" filetype = "%s" version  = %d method   = "textDocument/didSave" [params] ' "${kak_session}" "${kak_client}" "${kak_buffile}" "${kak_opt_filetype}" "${kak_timestamp}" | ${kak_opt_lsp_cmd} --request) > /dev/null 2>&1 < /dev/null & 
    jjk      32041  0.0  0.0  75200  4880 ?        Sl   16:07   0:00 /home/jjk/git/kak-lsp-git/src/kak-lsp/target/release/kak-lsp -s default --request
    jjk      32058  0.0  0.0   7100  1640 ?        S    16:07   0:00 sh -c  (printf ' session   = "%s" client    = "%s" buffile   = "%s" filetype  = "%s" version   = %d method    = "textDocument/hover" [params.position] line      = %d column    = %d ' "${kak_session}" "${kak_client}" "${kak_buffile}" "${kak_opt_filetype}" "${kak_timestamp}" ${kak_cursor_line} ${kak_cursor_column} | ${kak_opt_lsp_cmd} --request) > /dev/null 2>&1 < /dev/null & 
    jjk      32060  0.0  0.0  75200  4996 ?        Sl   16:07   0:00 /home/jjk/git/kak-lsp-git/src/kak-lsp/target/release/kak-lsp -s default --request
    jjk      32113  0.0  0.0   7100   424 ?        S    16:07   0:00 sh -c  (printf ' session  = "%s" client   = "%s" buffile  = "%s" filetype = "%s" version  = %d method   = "textDocument/didClose" [params] ' "${kak_session}" "${kak_client}" "${kak_buffile}" "${kak_opt_filetype}" "${kak_timestamp}" | ${kak_opt_lsp_cmd} --request) > /dev/null 2>&1 < /dev/null & 
    jjk      32115  0.0  0.0  75200  5100 ?        Sl   16:07   0:00 /home/jjk/git/kak-lsp-git/src/kak-lsp/target/release/kak-lsp -s default --request
    

    I have attached gdb to 5793, which is in this instruction:

    0x00007f708b0a2c3b in connect () from /usr/lib/libpthread.so.0
    

    I have also attached to 1427, which is in instruction:

    0x00007f76fecaf77c in pthread_cond_timedwait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
    

    If you need more debugging info I can provide it, the problem happens daily.

    bug 
    opened by JJK96 47
  • Proper structure of main script, for loading by plugin managers

    Proper structure of main script, for loading by plugin managers

    Hello. I'm writing a plugin manager, and currently I'm not able to use your plugin, if it is loaded by the plugin manager.

    I've added noload option to workaround this issue, but I think that this isn't proper way of how plugin should work. I still want to be able to start lsp manually, I just don't want to avoid loading of main script, and load it via shell command.

    My current setup is:

    plug "ul/kak-lsp" "noload" %{
        hook global WinSetOption filetype=(c,cpp,rust) %{
            evaluate-commands %sh{ kak-lsp --kakoune -s $kak_session }
        }
    }
    

    Let me breakdown this for you: plug - it's a command that does the following:

    • checks if first parameter (which is a repo) exists at plugin installation path, and if it exists:
      • parses parameters, like "noload", "branch: ...", "tag: ...";
      • loads all .kak files in the repo. If "noload" is specified this step is skipped;
      • loads %{settings} from the last parameter even if previous step was skipped.

    So this configuration skips the plugin files itself, but sets the hooks that will call external program, that will load lsp.kak script. I think that this should be handled by lsp.kak and not by external program. So user configuration can be like this:

    plug "ul/kak-lsp" %{
        set-option global lsp_path_to_executable "no/more/symlinking"
        hook global WinSetOption filetype=(c,cpp,rust) %{
            lsp-start [optional parameters]
        }
    }
    

    So script could handle everything by itself, as a plugin should do. Final proposal workflow is:

    • source lsp.kak either by plugin manager, or from user configuration, or from autoload folder;
    • configure some options like path to kak-lsp inside kakoune's config;
    • start lsp via generic command by entering it manually or by hook.

    I understand that simply calling kak-lsp from shell and passing session id to it feels easier, but I think that this should be handled in the main script, and not in the binary.

    enhancement 
    opened by andreyorst 33
  • `kak-lsp` doesn't always send `workspace/didChangeConfiguration` server configuration options

    `kak-lsp` doesn't always send `workspace/didChangeConfiguration` server configuration options

    I noticed this only for pyls, configuration but might be more general.

    From the log, seems that at some point kak-lsp stops sending the initialize jsonrpc method.

    This means that pyls stops using the custom configuration options and reverts to defaults.


    kak-lsp.toml relevant section

    [language.python]
    filetypes = ["python"]
    roots = [".git", "requirements.txt", "setup.py", "*.py"]
    command = "pylsp"
    workaround_server_sends_plaintext_labeled_as_markdown = true
    settings_section = "_"
    [language.python.settings._]
    pylsp.configurationSources = ["flake8"]
    pylsp.plugins.pycodestyle.enabled = false
    pylsp.plugins.mccabe.enabled = false
    pylsp.plugins.pyflakes.enabled = false
    pylsp.plugins.flake8.enabled = true
    pylsp.plugins.flake8.ignore = ["F821", "F722"]
    pylsp.plugins.flake8.maxLineLength = 120
    pylsp.plugins.black.line_length = 120
    

    kak-lsp.log

    opened by razcore-rad 28
  • Language server is not configured for filetype ``

    Language server is not configured for filetype ``

    Hi, I'm new to kak and kak-lsp, I'm trying to setup C completion on kak using kak-lsp, however I'm having a few issues :

    I tried doing "kak-lsp -vvvv --session session" in a window and then "kak -s session file.c" + lsp-capabilities (in kak)

    the kak-lsp window reported me this :

    Feb 23 10:19:54.599 DEBG Language server is not configured for filetype ``, module: kak_lsp::session:80
    

    I'm not sure what if I have configured something wrong or if this is a possible bug.

    configuration files : kakrc :

    eval %sh{kak-lsp --kakoune -s $kak_session}
    hook global WinSetOption filetype=(c|cpp|zig) %{
        lsp-enable-window
        lsp-auto-hover-enable
        lsp-auto-signature-help-mode
        lsp-auto-hover-insert-mode-disable
    }
    

    kak-lsp :

    snippet_support = false
    verbosity = 2
    
    [server]
    # exit session if no requests were received during given period in seconds
    # works only in unix sockets mode (-s/--session)
    # set to 0 to disable
    timeout = 1800 # seconds = 30 minutes
    
    [language.c_cpp]
    filetypes = ["c", "cpp"]
    roots = ["compile_commands.json", ".clangd"]
    command = "clangd"
    
    [language.zig]
    filetypes = ["zig"]
    roots = ["build.zig"]
    command = "zls"
    

    my environment : OS : ArchLinux kak : Kakoune v2020.09.01 kak-lsp : kak-lsp 9.0.0 clangd : clangd version 11.1.0

    Thanks in advance.

    need steps to reproduce 
    opened by InfRandomness 27
  • Julia unicodes

    Julia unicodes

    The LanguageServer of Julia has unicode completion support e.g. \xi becomes ξ (full list here https://docs.julialang.org/en/v1/manual/unicode-input/index.html).

    kak-lsp does know about this, but it can't handle the completion/substitution, see: grafik

    \xi is recognised but becomes: grafik

    opened by koehlerson 24
  • kak-lsp process stays running and consumes a lot of CPU

    kak-lsp process stays running and consumes a lot of CPU

    I'm not sure how I got into this state, I'll try to come up with repro steps. But for now see the picture, it is filtered for kak, and there are no kak processes running, but a bunch of kak-lsp.

    image

    bug need steps to reproduce 
    opened by maximbaz 22
  • Show lightbulb in modeline to hint at available code actions

    Show lightbulb in modeline to hint at available code actions

    Off by default because this wastes two columns. Use :lsp-code-actions-enable to activate. When a lightbulb is shown, use :lsp-code-actions (bound to a in the lsp user mode) to select one to run via a menu.

    Closes #475 Closes mawww/kakoune#4387

    I've been testing with this file and rust-analyzer (make sure to uncomment the rust-analyzer part in the default config)

    enum Test {
        Foo,
        Bar,
    }
    fn main() {
        let foo: Test = Test::Foo;
        match foo {
            Test::Foo => println!("foo"),
            _ => (),
        }
    }
    

    TODO:

    • [x] How can we avoid wasting two columns?
    opened by krobelus 20
  • What is the lsp-snippet story?

    What is the lsp-snippet story?

    Is there a setup that enables lsp-snippet completions? https://discuss.kakoune.com/t/need-snippets-we-got-snippets/42 mentions several snippet plugins, but no confirmation of a working setup.

    Does kak-lsp emit snippets? If not what is blocking this use case?

    opened by Avi-D-coder 20
  • Java lsp example

    Java lsp example

    Hey,

    I tried to get the Java lsp to work (eclipse jdt).

    This command seems to start the server (seen here for example)

    java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044 -Declipse.application=org.eclipse.jdt.ls.core.id1 -Dosgi.bundles.defaultStartLevel=4 -Declipse.product=org.eclipse.jdt.ls.core.product -Dlog.level=ALL -noverify -Xmx1G -jar /opt/jdt-language-server/plugins/org.eclipse.equinox.launcher.jar -configuration /opt/jdt-language-server/config_linux -data /path/to/my_project/ --add-modules=ALL-SYSTEM --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED
    

    However, adding the following doesn't do anything (confirmed with :lsp-capabilities inside a .java file)

    [language.java]
    filetypes = ["java"]
    roots = [".git"]
    command = "java"
    args = ["-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044 -Declipse.application=org.eclipse.jdt.ls.core.id1 -Dosgi.bundles.defaultStartLevel=4 -Declipse.product=org.eclipse.jdt.ls.core.product -Dlog.level=ALL -noverify -Xmx1G -jar /opt/jdt-language-server-0.69.0-202102120513/plugins/org.eclipse.equinox.launcher_1.6.0.v20200915-1508.jar -configuration /opt/jdt-language-server-0.69.0-202102120513/config_linux -data /mnt/data/UGent/2020-2021/semester2/HOP/FPGA-CAD-Framework/ --add-modules=ALL-SYSTEM --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED"]
    

    I probably don't have enough understanding to get it to work, but @topisani mentioned in #126 this server as an example for the usage of [language.java.initialization_options], but I have no idea how to set it up...

    I'm aware this is probably not the right channel, but would anyone care to share the trick? (@topisani ?) Maybe it can be put in the docs afterwards...

    question 
    opened by th1j5 19
  • No diagnostics, completion, or hover for any language server

    No diagnostics, completion, or hover for any language server

    So I have this on the Kakoune Community site, but to have it here for others to look.

    Here's the output of uname -a (for the sake of it):

    Linux my-void 5.4.46_1 #1 SMP PREEMPT Wed Jun 10 19:33:58 UTC 2020 x86_64 GNU/Linux
    

    kak -version: Kakoune v2020.01.16-273-g74e3e5ef

    kak-lsp -V: kak-lsp 8.0.0-snapshot (I'm on the most recent master)

    Here's the bit from my kakoune config for kak-lsp:

    plug "ul/kak-lsp" do %{
        cargo build --release --locked
        cargo install --force --path . --locked
        cargo clean
    } config %{
    	
        set-option global lsp_cmd "kak-lsp --kakoune -vvv -c $HOME/.config/kak-lsp/kak-lsp.toml -s %val{session} --log $HOME/.config/kak-lsp/kak-lsp.log"
    
        define-command lsp-restart %{ lsp-stop; lsp-start }
    
        set-option global lsp_completion_trigger "execute-keys 'h<a-h><a-k>\S[^\s,=;*(){}\[\]]\z<ret>'"
        set-option global lsp_diagnostic_line_error_sign "!"
        set-option global lsp_diagnostic_line_warning_sign "?"
        hook global WinSetOption filetype=(c|cpp|objc|d|rust|haskell|nim|elixir|latex|javascript) %{
    
            lsp-start
        	lsp-enable-window
        	echo -debug "Enabling LSP for filtetype %opt{filetype}"
        	
        	lsp-auto-hover-enable
        	lsp-auto-hover-insert-mode-disable
        	set-option global lsp_auto_highlight_references true
        	set-option global lsp_hover_anchor true
        	
        	# Semantic highlighting
        	hook window -group semantic-tokens BufReload .* lsp-semantic-tokens
        	hook window -group semantic-tokens NormalIdle .* lsp-semantic-tokens
        	hook window -group semantic-tokens InsertIdle .* lsp-semantic-tokens
        	hook -once -always window WinSetOption filetype=.* %{
        		 remove-hooks window semantic-tokens
        	}
        	
        	# Other things
        	# hook window BufWritePre .* lsp-formatting-sync
        	hook window BufWritePost .* lsp-diagnostics
        	hook -always global KakEnd .* lsp-exit
            hook global WinSetOption filetype=rust %{
                set-option window lsp_server_configuration rust.clippy_preference="on"
            }
        }
    }
    

    And my kak-lsp.toml:

    lsp_hover_anchor=true
    lsp_hover_max_lines=6
    snippet_support = true
    verbosity = 3
    
    [semantic_scopes]
    # Map textmate scopes to kakoune faces for semantic highlighting
    # the underscores are translated to dots, and indicate nesting.
    # That is, if variable_other_field is omitted, it will try the face for
    # variable_other and then variable
    #
    # To see a list of available scopes in the debug buffer, run lsp-semantic-available-scopes
    variable = "variable"
    entity_name_function = "function"
    entity_name_type = "type"
    variable_other_enummember = "variable"
    entity_name_namespace = "module"
    
    # Semantic tokens support
    # See https://github.com/microsoft/vscode-languageserver-node/blob/8c8981eb4fb6adec27bf1bb5390a0f8f7df2899e/client/src/semanticTokens.proposed.ts#L288
    # for token/modifier types.
    
    [semantic_tokens]
    type = "type"
    variable = "variable"
    namespace = "module"
    function = "function"
    string = "string"
    keyword = "keyword"
    operator = "operator"
    comment = "comment"
    
    [semantic_modifiers]
    documentation = "documentation"
    readonly = "default+d"
    
    [server]
    # exit session if no requests were received during given period in seconds
    # works only in unix sockets mode (-s/--session)
    # set to 0 to disable
    timeout = 1800 # seconds = 30 minutes
    
    [language.c_cpp]
    filetypes = ["c", "cpp", "objc", "objcpp", "cuda"]
    roots = [".ccls", "compile_commands.json"]
    command = "ccls"
    args= ["--init={\"completion\":{\"detailedLabel\":false},\"highlight\":{\"lsRanges\":true}"]
    
    [language.d]
    filetypes = ["d", "di"]
    roots = [".git", "dub.sdl", "dub.json"]
    command = "dls"
    
    [language.rust]
    filetypes = ["rust"]
    roots = ["Cargo.toml"]
    command = "rls"
    
    [language.haskell]
    filetypes = ["haskell"]
    roots = ["Setup.hs", "stack.yaml", "*.cabal"]
    command = "haskell-language-server-wrapper"
    args = ["--lsp"]
    
    [language.nim]
    filetypes = ["nim"]
    roots = ["*.nimble", ".git"]
    command = "nimlsp"
    
    [language.elixir]
    filetypes = ["elixir", "exs", "eex"]
    roots = ["mix.exs"]
    command = "~/Tools/Elixir/elixir-ls/release/language_server.sh"
    
    [language.latex]
    filetypes = ["latex"]
    roots = [".git"]
    command = "texlab"
    
    [language.javascript]
    filetypes = ["javascript"]
    roots = ["package.json", "jsconfig.json"]
    command = "tsserver"
    
    [language.typescript]
    filetypes = ["typescript"]
    roots = ["package.json", "tsconfig.json"]
    command = "tsserver"
    

    All the executables for the language servers are in my $PATH (I can run :eval %sh{ echo $PATH } and get all the correct directories in $PATH), and I can run them outside of Kakoune.

    I get the feeling there's one silly thing that I've done that's giving me troubles, but I'm not sure as to what it is.

    opened by alecStewart1 18
  • Implement Markdown parsing

    Implement Markdown parsing

    Similar to https://github.com/kak-lsp/kak-lsp/pull/337 (which I only noticed half-way into this), this uses pulldown-cmark to parse Markdown into a markup string usable with :info -markup.

    Links are highlighted, but only their name/title is shown. Syntax and URL are stripped. URLs could be very long and potentially bloat the output. And you can't select them to copy, either. The link name/title should be enough to search for in the relevant resource.

    Images are stripped completely. Similar to links, even if the URL was shown, it wouldn't help much.

    Code is not highlighted per-language, just the regular {mono} and {block} faces. Ideally, there would be a simple way to query the editor to run its highlighters, but I don't think there is. ~~Semantic Tokens from the LSP server might be an option too.~~ Token requests only work on files. Because of this, the "Signature Help" feature has been left untouched, as the values here are just code snippets.

    Open issues:

    • [x] Multi-line code blocks are broken: https://github.com/mawww/kakoune/issues/4313. Do we want to add a workaround? Fixed upstream.
    • [x] I am reusing existing faces from the Markdown highlighter and existing diagnostics rendering. This has worked fine for me so far. But since most colour schemes use a different background for the info box than the buffer, this might not always work. Do we want to create a new set of faces for this?
    • [ ] Currently, I only have set up rust-analyzer to test with.
    • [x] The info box used for autocompletion doesn't seem to support markup strings. So I haven't touched that at all.

    Fixes #73, #476.

    opened by sclu1034 15
  • Push kak-lsp to crates.io

    Push kak-lsp to crates.io

    This will make installing and updating it much less fiddly. For instance I have a few other binaries installed through Cargo and I have a single command set up to automatically fetch updates and recompile only changed projects, but it only works if the projects are installed through crates.io; I'd really rather not have to replicate all that logic manually in my update script.

    opened by EleanorNB 0
  • bash server not working. updateConfiguration failed

    bash server not working. updateConfiguration failed

    I've installed the plugin and the bash language server. The lsp plugin is enabled, but nothing is apparent (no sign of error but it doesn't seem to be working properly either). I found this error in tmp log:

    lsp-show-message-log 'updateConfiguration: failed with [
    
    {
    "code": "invalid_type",
    "expected": "object"
    "received": "null",
    "path": [],
    "message": "Expected object, received null"
     }
    ]', module: kak_lsp::editor_transport:82
    

    This command in shell doesn't give error:

    bash-language-server start
    

    I'm new to kakoune. I'm using the plugin manager and lsp and that's all beside some kakoune config.

    Also, I've tried to add the treesitter plugin but removed it after. But the lsp didn't seem to work before I've done that either, so I doubt it is related.

    opened by jogood 6
  • Panic on bad `textDocument/signatureHelp` response from sumneko/lua-language-server

    Panic on bad `textDocument/signatureHelp` response from sumneko/lua-language-server

    Ref: https://github.com/sumneko/lua-language-server/issues/1751

    Dec 07 19:14:59.362 ERRO panic: panicked at 'Failed to parse response: Error("invalid value: integer `-1`, expected u32", line: 0, column: 0)', src/context.rs:140:64, module: kak_lsp:286
    Dec 07 19:14:59.362 INFO Waiting for Messages to language server to finish..., module: kak_lsp::thread_worker:19
    Dec 07 19:14:59.362 DEBG Received signal to stop language server, closing pipe, module: kak_lsp::language_server_transport:193
    

    lua-language-server was returning a bad response to the textDocument/signatureHelp request from kak-lsp. This causes kak-lsp to panic. Sumneko has fixed the issue with the server, but kak-lsp shouldn't be panicking in this case either.

    Reproduction

    Open this file with lua-language-server running (default configuration works fine):

    local mystring = "foo"
    
    print(string.match(mystring, "(foo)"))
    

    Change string on line 3 to math, then change it back to string. As you are typing string, the bad response will be sent and kak-lsp will panic.

    opened by raiguard 0
  • pylsp will autocomplete correctly but will not provide diagnostics

    pylsp will autocomplete correctly but will not provide diagnostics

    kak-lsp.toml

    [language.rust]
    filetypes = ["rust"]
    roots = ["Cargo.toml"]
    command = "rust-analyzer"
    
    [language.python]
    filetypes = ["python"]
    roots = ["requirements.txt", "setup.py", ".git", ".hg"]
    command = "pylsp"
    offset_encoding = "utf-8"
    
    [language.nix]
    filetypes = ["nix"]
    roots = ["flake.nix", "shell.nix", ".git"]
    command = "rnix-lsp"
    

    kakrc

    # Generated by home-manager
    colorscheme solarized-dark
    set-option global tabstop 2
    set-option global indentwidth 2
    add-highlighter global/ show-matching
    # UI options
    # User modes
    # Key mappings
    # Hooks
    # enable kak-lsp for following filetypes
    eval %sh{kak-lsp --kakoune -s $kak_session}
    hook global WinSetOption filetype=(rust|python|go|javascript|typescript|c|cpp|nix) %{
          lsp-enable-window
    }
    
    # recommended lsp mappings
    map global user l %{:enter-user-mode lsp<ret>} -docstring "LSP mode"
    map global insert <tab> '<a-;>:try lsp-snippets-select-next-placeholders catch %{ execute-keys -with-hooks <lt>tab> }<ret>' -docstring 'Select next snippet placeholder'
    map global object a '<a-semicolon>lsp-object<ret>' -docstring 'LSP any symbol'
    map global object <a-a> '<a-semicolon>lsp-object<ret>' -docstring 'LSP any symbol'
    map global object e '<a-semicolon>lsp-object Function Method<ret>' -docstring 'LSP function or method'
    map global object k '<a-semicolon>lsp-object Class Interface Struct<ret>' -docstring 'LSP class interface or struct'
    map global object d '<a-semicolon>lsp-diagnostic-object --include-warnings<ret>' -docstring 'LSP errors and warnings'
    map global object D '<a-semicolon>lsp-diagnostic-object<ret>' -docstring 'LSP errors'
    

    I tested by trying to import modules I have installed (heapq). Autocomplete worked for both the import and heapq tokens.

    I then went one line below and typed gibberish. At no point did I have the red star in the tray.

    Nix language server seems to be fine.

    opened by blakat360 7
  • Add ability to set workspace folders

    Add ability to set workspace folders

    It seems currently it's not possible to customize the workspace folders --- kak-lsp will only use the root dir.

    Additionally, if this feature is added, it'd be nice to be able to use environment variables inside the config file, since $PWD will probably be needed in the workspace paths.

    need steps to reproduce 
    opened by gbrlsnchs 16
Releases(v14.1.0)
  • v14.1.0(Oct 26, 2022)

    14.1.0 - 2022-10-26

    Additions:

    • Default language server for protobuf.
    • Added support for codeAction/resolve, which allows to use code actions sent by Deno for example.
    • The recommended mappings have been augmented by new command lsp-diagnostic-object to jump to next/previous diagnostics.
    • lsp-auto-signature-help-enable now shows an info box by default, and formats the active parameter in a bold font.
    • lsp-definition and friends now select the symbol name instead of merely placing the cursor at symbol start. Same for lsp-find-error.
    • lsp-highlight-references now selects all references in the current buffer.
    • New lsp-inlay-code-lenses-enable command allows to render code lenses as virtual text (#623).
    • The support for filterText in completions no longer depends on an out-of-tree Kakoune feature.

    Fixes:

    • Fix lags due to rust-analyzer sending a ton of progress reports.
    • lsp-rename will now write hidden buffers that are affected by the rename, to give the language server and other external tools a more consistent view of affected files.
    • Suppress "language server not initialized" errors that originate from hooks.
    • Fix a glitch when a line has both a code lens and an inline diagnostic.
    • When talking to servers that don't support UTF-8 byte-offsets, kak-lsp now adheres to the LSP specification by treating column-offsets as UTF-16 Code Units instead of Unicode Code Points.
    Source code(tar.gz)
    Source code(zip)
    kak-lsp-v14.1.0-x86_64-apple-darwin.tar.gz(2.71 MB)
    kak-lsp-v14.1.0-x86_64-unknown-linux-musl.tar.gz(3.16 MB)
  • v14.0.0(Aug 29, 2022)

    14.0.0 - 2022-08-29

    This is a small bug fix release but it also includes updates to the default config.

    Breaking changes:

    • typescript-language-server replaces flow as default language server for JavaScript.
    • crystalline replaces scry as default language server for Crystal.
    • The user mode mapping for s now runs lsp-goto-document-symbol instead of lsp-signature-help. The old mapping (<c-o>) has been removed.

    Fixes:

    • lsp-find-error and code lenses were broken in 13.0.0, which has been fixed.
    • The server-specific configuration for the solargraph Ruby language server has been fixed.
    • The new command lsp-goto-document-symbol (which replaced the old <c-o> binding) can now handle nested symbols.
    Source code(tar.gz)
    Source code(zip)
    kak-lsp-v14.0.0-x86_64-apple-darwin.tar.gz(2.58 MB)
    kak-lsp-v14.0.0-x86_64-unknown-linux-musl.tar.gz(3.03 MB)
  • v13.0.0(Aug 11, 2022)

    13.0.0 - 2022-08-11

    Here are some notable changes. See the git log for a full list of changes.

    Breaking changes:

    • Completion snippet support is now enabled again in the default config.
    • The default object mode mappings have been removed. Users are expected to add their preferred mappings. The README now has a section with recommended mappings.

    Additions:

    • Default configuration for Elvish and Clojure.
    • On macOS, the config file is now read from $XDG_CONFIG_HOME/kak-lsp/kak-lsp.toml. The old location (~/Library/Preferences/kak-lsp/kak-lsp.toml) is used as a fallback (#293).
    • Added shim support for workspace/WorkspaceFolders, which fixes interaction with bash-language-server.
    • Some errors are shown directly in the editor, unless the error was triggered by a hook.
    • lsp-document-symbol now indents nested symbols.

    Fixes:

    • Completions with snippets now interact properly with Kakoune's completion engine (#616).
    • Fixed default configuration for HTML/CSS/JSON following the upstream renaming of the binaries.
    • lsp-enable-window no longer adds a redundant global NormalKey hook (introduced in 12.1.0)
    • kak-lsp now avoids sending unsupported requests to the server.
    Source code(tar.gz)
    Source code(zip)
    kak-lsp-v13.0.0-x86_64-apple-darwin.tar.gz(2.58 MB)
    kak-lsp-v13.0.0-x86_64-unknown-linux-musl.tar.gz(3.03 MB)
  • v12.2.1(May 8, 2022)

  • v12.2.0(May 2, 2022)

    12.2.0 - 2022-05-03

    Deprecations:

    • rust-analyzer-inlay-hints is deprecated in favor of lsp-inlay-hints-enable. Inlay hints now requires rust-analyzer version >= 2022-04-18. (#602, #613).

    Additions:

    • Support LSP Code Lenses (#490).
    • Support the new textDocument/inlayHint request from LSP v3.17 (#600).
    • New command lsp-inlay-hints-enable simplifies inlay hints configuration (#602).
    • Completion item documentation can now be resolved lazily if required by the language server (6bee0a13).
    • lsp-hover now shows diagnostics from anywhere on a line touched by the main selection, instead of just diagnostics whose range contains the cursor (5461c141).
    • lsp_hover_max_lines now defaults to 20 which limits the size of the info box spawned by lsp-hover (#615).

    Fixes:

    • lsp-formatting with pylsp now preserves cursor positions again (regressed in 12.1.0).
    • Inlay diagnostics are now disabled in insert mode, to avoid diagnotsics jumping around while typing (#605).
    • The default config for typescript-language-server now supports TSX files (#211).
    • lsp-object (]a etc.) can now jump past the symbols sent by pylsp.
    • texlab-forward-search's SyncTeX inverse search now works in more scenarios (#603).
    • Support server specific configuration servers like pylsp that don't use initializationOptions for configuration (#611).
    Source code(tar.gz)
    Source code(zip)
    kak-lsp-v12.2.0-x86_64-apple-darwin.tar.gz(2.51 MB)
    kak-lsp-v12.2.0-x86_64-unknown-linux-musl.tar.gz(2.98 MB)
  • v12.1.0(Mar 28, 2022)

    12.1.0 - 2022-03-28

    Additions:

    • New mappings for Kakoune's object mode allow to select adjacent/surrounding symbols like functions or types (#598).
    • New mapping for the lsp user mode, <c-o>, spawns a menu to jump to buffer symbol (#584).
    • lsp-formatting used to spawn several shell processes for each modification, which caused noticable delays when formatting many lines. This has been remedied by avoiding shell calls (88f52f0c).
    • kak-lsp is now compatible with the proposed changes to P and (see Kakoune's breaking-cleanups branch).
    • The documentation now communicates that kak-lsp appends to the global modeline at load time (eb54d378).
    • New experimental command lsp-connect allows to handle certain LSP responses messages with a custom command (#584).

    Bug fixes:

    • lsp_auto_show_code_actions has been fixed to actually hide the lightbulb when no code action is available (76cff5f2).
    • Loading kak-lsp no longer leaves around a scratch buffer (#593).
    • Code actions are now offered for the main selection's range, instead of just the cursor position. This unlocks an "extract to function" refactoring from rust-analyzer. (#594).
    • The *-sync commands now automatically restart the server instead of showing an error if the server is down (b54ec807).
    Source code(tar.gz)
    Source code(zip)
    kak-lsp-v12.1.0-x86_64-apple-darwin.tar.gz(2.41 MB)
    kak-lsp-v12.1.0-x86_64-unknown-linux-musl.tar.gz(2.88 MB)
  • v12.0.1(Jan 29, 2022)

  • v12.0.0(Jan 26, 2022)

    Breaking changes:

    Additions:

    • lsp-handle-progress gained a default implementation that shows an hourglass (⌛) in the modeline when a language server is busy (f8a8cf8).
    • The code action menu now provides fuzzy (subsequence) filtering but no longer provides <c-n>/<c-p> due to implementation reasons (b4ee2a3).
    • When accepting a completion, any additionalTextEdits are now applied. For example, rust-analyzer adds import statements this way (2637b26).
    • New command lsp-code-action-sync is the synchronous variant of lsp-code-action, suitable for use in BufWritePre hooks (#582).
    • The default configuration for semantic_tokens now uses a more condensed syntax (#587).
    • Some systems' C libraries ship old Unicode databases, but terminals often bundle newer versions. To avoid graphical glitches, emoji are only used if they are assigned display width 2 by the C library's wcwidth(3) (73c2d1a, c3aeb0d).
    • The clangd protocol extension for offset encoding negotiation is now supported, which means kak-lsp now uses UTF-8 offsets if the server supports them (#485).

    Bug fixes:

    • lsp-formatting-sync now works again with texlab instead of blocking forever (regressed in 11.0.0) (a12831a).
    • Certain text edits (such as some code actions from rust-analyzer) were not applied correctly, which has been fixed (35ba8de).
    Source code(tar.gz)
    Source code(zip)
    kak-lsp-v12.0.0-x86_64-apple-darwin.tar.gz(2.45 MB)
    kak-lsp-v12.0.0-x86_64-unknown-linux-musl.tar.gz(2.91 MB)
  • v11.1.0(Dec 8, 2021)

    11.1.0 - 2021-12-08

    Lots of interesting updates but no breaking changes (fingers crossed).

    Additions:

    • Default configuration for Erlang (#548), R (#555) and Racket (#568).
    • Goto/get hover info of next/previous function with new lsp-next-function/lsp-hover-next-function (#557).
    • Allow to show hover info in the *hover* buffer (instead of the info box) with new lsp-hover-buffer (#564, #257).
    • Show lightbulb in modeline when code actions are available and lsp_auto_show_code_actions is set (#538).
    • Run specific code actions with new lsp-code-action (#566).
    • Support LSP's Call Hierarchy, to show callers/callees of the function at cursor with lsp-incoming-calls/lsp-outgoing-calls (#554).
    • Support LSP's Selection Range, to quickly select interesting ranges around cursors with lsp-selection-range (#288).
    • Create just one undo entry for sequences of text edits (like from lsp-code-actions or lsp-formatting) (#533).
    • Set new environment variable KAK_LSP_FORCE_PROJECT_ROOT to use the same project root even for files outside a project, to reuse a single language server (#542).
    • Support server progress notifications via $/progress, removing support for the non-standard window/progress (#545).
    • Support for filterText in completions, which depends on a proposed Kakoune feature (#551).
    • Allow multiple characters and spaces in diagnostic gutter via lsp_diagnostic_line_error_sign and friends (#571).
    • Support LaTeX language server texlab's custom commands with texlab-build and texlab-forward-search (SyncTeX support) (#573).

    Bug fixes:

    • Honor extra_word_chars for completions, fixing completion of Lisps (#568).
    • Fix go-to-definition for files containing invalid UTF-8 (#535).
    • Fix default server-specific configuration for pyls (regressed in 11.0.0).
    • Use the LineNumbers face for the flag-lines highlighter that shows diagnostics, to work better with non-default backgrounds (#524).
    • Fix applying sequences of text edits, like from lsp-code-actions or lsp-formatting (#527).
      • Also, do not drop trailing newline from text edits (e9af1aa).
    • Quoting/escaping fixes for diagnostics and hover info.
    Source code(tar.gz)
    Source code(zip)
    kak-lsp-v11.1.0-x86_64-apple-darwin.tar.gz(2.41 MB)
    kak-lsp-v11.1.0-x86_64-unknown-linux-musl.tar.gz(2.85 MB)
  • v11.0.1(Sep 16, 2021)

    11.0.1 - 2021-09-17

    This is mostly a bug fix release but also includes Markdown rendering and enhanced inlay diagnostics.

    Breaking changes:

    • The face LineFlagErrors has been renamed to LineFlagError, for consistency with other faces (#516).

    Bug fixes:

    • Fix example server configuration for lua-language-server.
    • Fix completion of tokens containing non-word-characters, such as Ruby attributes, Ruby symbols and Rust lifetimes (#378, #510).
    • lsp-highlight-references clears highlights on failure, improving the behavior when %opt{lsp_auto_highlight_references} is set to true (#457).
    • Fix jumping to locations when Kakoune working directory is different from project root (#517).
    • Fix jumping to locations with absolute paths (#519).
    • Diagnostics of level "info" and "hint" are no longer shown as "warning", and are given distinct faces (#516).
      • find-next-error will skip over "info" and "hint" diagnostics.
    • Fix adjacent insertion text edits, for example as sent by rust-analyzer as code actions (#512).
    • The default kak-lsp.toml recognizes .git and .hg as project root markers for C/C++ files. This makes lsp-references work better out-of-the-box for projects like Kakoune that don't need a compile_commands.json.

    Additions:

    • Render Markdown from hover and from completions in info box. You can set custom faces to highlight different syntax elements (#73, #513).
      • Some servers like pyls send that info in plaintext but label it as Markdown. Work around this with a new configuration option workaround_server_sends_plaintext_labeled_as_markdown in the default kak-lsp.toml to force plaintext rendering.
    • Multiple inlay diagnostics on a single line are coalesced (#515).
    Source code(tar.gz)
    Source code(zip)
    kak-lsp-v11.0.1-x86_64-apple-darwin.tar.gz(2.30 MB)
    kak-lsp-v11.0.1-x86_64-unknown-linux-musl.tar.gz(2.77 MB)
  • v11.0.0(Aug 31, 2021)

    11.0.0 - 2021-09-01

    Breaking changes:

    • Two incompatible changes to the configuration format - see the updated kak-lsp.toml for examples.
      • semantic_tokens syntax has changed, allowing for more fine-grained face configuration (#488)
      • settings replaces initialization_options for server-specific settings (#511)
    • Snippet support has been disabled by default, as a workaround for conflicts with Kakoune's built-in completion (#282).
    • lsp-show-message, which handles window/showMessage requests from the server has been removed. See below for the replacement.
    • Hidden commands lsp-next-match and lsp-previous-match were removed in favor of lsp-next-location and lsp-previous-location (#466).
    • haskell-language-server is the new default language server for Haskell, replacing haskell-ide-engine.

    Additions:

    • Finish support for workspace/configuration (#234).
    • %opt{lsp_config} allows to set server-specific settings dynamically (#500).
    • Default configuration for Julia (#502).
    • lsp-show-message has been replaced by four separate commands lsp-show-message-{error,warning,info,log}. The new default implementations log the given messages from the language server to the debug buffer. Important messages are shown in %opt{toolsclient}.
    • The new command lsp-show-code-actions can be overridden to customize the default menu behavior of lsp-code-actions (#367).
    • New commands lsp-{next,previous}-location generalize grep-next-match, lsp-next-match and friends (#466).
    • New option lsp_location_format to customize the ":"-style location patterns that lsp-{next,previous}-location can match (#466).

    Bug fixes:

    • Fix renaming of Rust lifetimes (#474).
    • The suggested config for rust-analyzer was fixed for the case that rustup is installed but rust-analyzer is not installed via rustup.
    • Fix spurious cursor movement on lsp-rename and lsp-rename-prompt (#504).
    • Fix responses to workspace/configuration in case there are no initialization options set (#509).

    Deprecations:

    • %opt{lsp_server_initialization_options} and %opt{lsp_server_configuration} are deprecated in favor of setting [language.<filetype>.settings] in %opt{lsp_config}(#500).
    • lsp-{goto,symbols}-{next,previous}-match are deprecated in favor of commands like lsp-next-location *goto* and similar (#466).
    Source code(tar.gz)
    Source code(zip)
    kak-lsp-v11.0.0-x86_64-apple-darwin.tar.gz(2.22 MB)
    kak-lsp-v11.0.0-x86_64-unknown-linux-musl.tar.gz(2.69 MB)
  • v10.0.0(Jun 3, 2021)

    This is a small release with a useful fix to lsp-rename (#481).

    Breaking changes:

    • The semantic highlighting feature has been removed. It is superseded by semantic tokens which are officially part of LSP 3.16.
    • Buffers *goto*, *symbols*, *diagnostics* are given the lsp-goto filetype instead of grep or make (#454).
    • ocamllsp replaces the discontinued ocaml-language-server as default language server for OCaml (#471).

    Additions:

    • lsp-rename-prompt is added to to the lsp user mode, mapped to R (#441).
    • Default configuration for CSS variants "less" and "scss" (#473).
    • kak-lsp sends the configured offset encoding to the language server (see https://clangd.llvm.org/extensions.html#utf-8-offsets), which still defaults to utf-16.
    • lua-language-server was added as default language server for Lua.

    Bug fixes:

    • Fix edits (by lsp-rename and friends) to files that were not opened as Kakoune buffers (#481).
    • lsp-show-{diagnostics,goto-choices,document-symbols} no longer cd to the project root (#454).
    • Fix error when the documentation part of a completion item starts with a dash (-) (#460).
    • Fix completions of non-ASCII characters for some textEdit completions (#455).
    • Fix lsp-rename with pyright (#468).
    • Treat snippets containing < literally, instead of as Kakoune key names (#470)
    • Nested entries in lsp_server_initialization_options like a.b=1 are sent to language servers as {"a":{"b":1}} instead of {"a.b":1}, matching the treatment of lsp_server_configuration (#480).
    • Fix a case where lua-language-server would hang (#479) because kak-lsp didn't support workspace/configuration; basic support has been added.
    Source code(tar.gz)
    Source code(zip)
    kak-lsp-v10.0.0-x86_64-apple-darwin.tar.gz(2.21 MB)
    kak-lsp-v10.0.0-x86_64-unknown-linux-musl.tar.gz(2.70 MB)
  • v9.0.0(Jan 23, 2021)

    v9.0.0

    kak-lsp has moved to the @kak-lsp GitHub organization.

    Thanks to @ul for this excellent tool, and thanks to everyone who contributed feedback and patches.

    This release fixes several bugs, maintaining compatibility with some language servers. Please see v8.0.0...v9.0.0 for a detailed log.

    BREAKING changes:

    • clangd replaces cquery as default language server for C/C++. If you were still using cquery you need to either to put it back into the config or install clangd. (@Screwtapello)
    • rustup is now used by default if available to find rls from the currently active Rust toolchain. (@pickfire)
    • hie-wrapper replaces hie as default language server for Haskell (@414owen).

    Additions:

    • Support for LSP's semantic tokens and semantic highlighting (@tadeokondrak, @topisani).
    • Inlay diagnostics is an experimental feature to show diagnostics directly after a line. (@tadeokondrak)
    • New command lsp-range-formatting formats selections (@414owen).
    • New command clangd-switch-source-header (@topisani).
    • Added default configuration for Elixir (@jtrees), Nix (@deviant), terraform (@xenrox), yaml (@pickfire), Zig (@arrufat).

    Bug fixes:

    • Fix infinite loop when editing scratch buffer (@krobelus, d38643c).
    • Some commands no longer clobber the " register (@BurNiinTRee, 0d34864).
    • lsp-next-match activates the *references* buffer before updating the line in %opt{toolsclient}. (@vbauerster, a3fde50).
    • Support a restricted form of textEdit completions (@krobelus, 6f5c0cd).
    • Request plain-text information for hover and signature, so gopls no longer sends Markdown (@puckipedia, 5e591e75)
    • Fix snippet insertion with gopls and Dart (@gustavo-hms, dd5a3ce)
    • Show error popups when configuration is invalid (@krobelus, 34e888e).
    Source code(tar.gz)
    Source code(zip)
    kak-lsp-v9.0.0-x86_64-apple-darwin.tar.gz(2.12 MB)
    kak-lsp-v9.0.0-x86_64-unknown-linux-musl.tar.gz(2.62 MB)
  • v8.0.0(Apr 19, 2020)

    This release consists of many contributions from the community. Many thanks for making kak-lsp better!

    Please see https://github.com/ul/kak-lsp/compare/v7.0.0...v8.0.0 for a detailed log. There are a few breaking changes and additions highlighted below:

    BREAKING changes:

    • bingo was replaced with gopls as a default language server for Go. If you were still using bingo you need to either to put it back into the config or install gopls.
    • Completions now support snippets and they are enabled by default. Please see https://github.com/ul/kak-lsp/pull/270 for details. PR to include this information into README would be highly appreciated! To ask language server to not include snippets change snippet_support back to false in kak-lsp.toml (some language servers don't respect this option though).

    Non-breaking changes:

    • Semantic highlighting support. Please see https://github.com/ul/kak-lsp/pull/269 for details. PR to include this information into README would be highly appreciated!
    • Added lsp-implementation command to find implementations for a symbol under the main cursor. *implementations* buffer has grep filetype so you can use all commands provided by grep.kak, including grep-jump.
    • Added lsp_show_hover_format option. Example of the usage is to exclude diagnostics from lsp-hover with set-option global lsp_show_hover_format 'printf %s "${lsp_info}"'
    • ejdtls-organize-imports command to organise imports when using eclipse.jdt.ls language server.
    Source code(tar.gz)
    Source code(zip)
    kak-lsp-v8.0.0-x86_64-apple-darwin.tar.gz(2.12 MB)
    kak-lsp-v8.0.0-x86_64-unknown-linux-musl.tar.gz(2.50 MB)
  • v7.0.0(Oct 1, 2019)

    BREAKING changes:

    • Default search path for kak-lsp.toml has been changed from ~/.config/kak-lsp to a system-dependent location, see https://github.com/ul/kak-lsp/#configuring-kak-lsp for details.
    • Removed TCP mode.
    • Pre-built binaries for FreeBSD are no longer provided (as cross-compilation toolkit I use on Travis dropped support for FreeBSD).

    Non-breaking changes:

    • Add default configuration for Crystal (@alexherbo2), Nim (@SolitudeSF), Elm (@bburdette).
    • Add lsp-disable and lsp-disable-window commands (@andreyorst)
    • Support code actions which use workspace edits instead of commands (@topisani)
    • Add support for window/showMessage, to change it's behaviour override lsp-show-message in your kakrc.
    • Add --log option for easier https://github.com/ul/kak-lsp/#troubleshooting
    • Fixed a few bugs, including deadlock and text edits application (@lePerdu)
    Source code(tar.gz)
    Source code(zip)
    kak-lsp-v7.0.0-x86_64-apple-darwin.tar.gz(2.00 MB)
    kak-lsp-v7.0.0-x86_64-unknown-linux-musl.tar.gz(2.30 MB)
  • v6.2.0(May 11, 2019)

    New features

    • Before, it was possible to provide initializationOptions of initialize request on per-server basis via initialization_options in kak-lsp.toml. Now, lsp_server_initialization_options is also available for the same purpose but giving more flexibility (i.e. per-project options). When non-empty, it will override initialization_options from kak-lsp.toml. (#126)
    • snippet_support option is available in kak-lsp.toml to ask language servers to include snippets into completions. Note kak-lsp itself doesn't handle snippets in any special way; you still need to integrate it with snippet manager compatible with LSP snippet format. (#145)
    • Now it is possible to specify project root via an environment variable. Ref https://github.com/ul/kak-lsp/wiki/Project-root-selection for more details. (#182, courtesy of @benjumanji)
    • window/progress notification is now forwarded to Kakoune, ref https://github.com/ul/kak-lsp/wiki/Handling-progress-notifications for the example of using it. (#196, courtesy of @ricochet1k)
    • lsp-code-actions command (#199, courtesy of @ricochet1k)

    Bugfixes

    • Offsets are now handled better outside of Basic Latin up to Basic Multilingual Plane for spec-compliant language servers. UTF-8 code point/unit based servers should now work properly even outside the BMP range. For the UTF-8 code unit servers you need to specify offset_encoding = "utf-8" in kak-lsp.toml. (#191, #98, #40)
    • More robust formatting. (#188, #200)
    • Better behaviour in a multi-user environment. (#174)
    Source code(tar.gz)
    Source code(zip)
    kak-lsp-v6.2.0-x86_64-apple-darwin.tar.gz(1.94 MB)
    kak-lsp-v6.2.0-x86_64-unknown-freebsd.tar.gz(2.15 MB)
    kak-lsp-v6.2.0-x86_64-unknown-linux-musl.tar.gz(2.26 MB)
  • v6.1.0(Mar 1, 2019)

    • New lsp-references-next-match, lsp-references-previous-match, lsp-symbols-next-match, lsp-symbols-previous-match commands to cycle through positions referenced in *references* and *symbols* buffers respectively. Kudos to @hinshun for idea and implementation!
    • Redundant lsp_tab_size option is removed. kak-lsp now just uses Kakoune's tabstop. Thanks @JJK96 for the catch and fix.
    • kak-lsp options now have proper docstrings and docs thanks to @JJK96 and @dmerejkowsky.
    • default lsp-definition and lsp-references mapping doesn't litter command history, thanks @andreyorst for the fix.
    • Go to definition now understands when language server responds with LocationLink, shout out to @daboross for the fix.
    • Semantic highlighting for cquery is enabled by default (but you still need to define cquery* faces to see it).
    • Few more bugfixes.
    Source code(tar.gz)
    Source code(zip)
    kak-lsp-v6.1.0-x86_64-apple-darwin.tar.gz(1.86 MB)
    kak-lsp-v6.1.0-x86_64-unknown-freebsd.tar.gz(2.17 MB)
    kak-lsp-v6.1.0-x86_64-unknown-linux-musl.tar.gz(2.29 MB)
  • v6.0.1(Jan 14, 2019)

  • v6.0.0(Dec 18, 2018)

    BREAKING changes:

    • Default integration now requires explicit lsp-enable call:
    eval %sh{kak-lsp --kakoune -s $kak_session}
    + lsp-enable
    

    This is made to enable hook-related customization easier without the need to keep a copy of lsp.kak. For example, you might want to enable kak-lsp just in the window scope of selected filetypes:

    hook global WinSetOption filetype=(rust|python|go|javascript) %{
        lsp-enable-window
    }
    
    hook global KakEnd .* lsp-exit
    

    Direct sourcing lsp.kak would work as well, but you need to set lsp_cmd option:

    source path/to/lsp.kak
    set global lsp_cmd path/to/kak-lsp
    lsp-enable
    
    • Language server configuration in kak-lsp.toml now depends on filetypes (as in Kakoune option filetype) rather than extensions to determine which language server to start. If you were using custom kak-lsp.toml you need to update it like this:
    [language.c_cpp]
    - extensions = ["c", "h", "cc", "hh", "cpp", "hpp"]
    + filetypes = ["c", "cpp"]
    roots = ["compile_commands.json", ".cquery"]
    command = "cquery"
    args = ["--init={\"cacheDirectory\":\"/tmp/cquery\"}"]
    
    • lsp_diagnostic_count option is split into lsp_diagnostic_error_count and lsp_diagnostic_warning_count (kudos to @JJK96).

    Non-breaking changes:

    • kak-lsp server is now daemonized in current working directory, which solves issue with some language servers in some environments, e.g. RLS on NixOS (kudos to @dpc).

    • Default lsp_hover_insert_mode_trigger is a bit more robust now and works with auto-pairs.kak.

    • D lang is now supported by default kak-lsp.toml (kudos to @jwhear).

    • lsp-rename-prompt prompt now defaults to the current name (kudos to @Screwtapello).

    • lsp_hover_max_lines option allows to restrict hover info size.

    Source code(tar.gz)
    Source code(zip)
    kak-lsp-v6.0.0-x86_64-apple-darwin.tar.gz(2.40 MB)
    kak-lsp-v6.0.0-x86_64-unknown-freebsd.tar.gz(3.00 MB)
    kak-lsp-v6.0.0-x86_64-unknown-linux-musl.tar.gz(3.38 MB)
  • v5.9.0(Oct 28, 2018)

  • v5.7.0(Oct 16, 2018)

Owner
null
A LSP (Language Server Protocol) server for OpenSCAD.

openscad-LSP A LSP (Language Server Protocol) server for OpenSCAD. inspired by dzhu/openscad-language-server Tested with VSCode on Mac and Windows. Te

Leathong 20 Dec 15, 2022
impl LSP (Language Server Protocol) Server for librime

rime-ls 为 rime 输入法核心库 librime (的部分功能) 实现 LSP 协议, 从而通过编辑器的代码补全功能输入汉字. 项目还处在早期阶段, 各方面都非常不成熟. 目标是提供 rime + LSP 的通用解决方案, 在不同编辑器内实现与其他 rime 前端类似的输入体验. Feat

zilch40 55 Jan 22, 2023
Language Server Protocol (LSP) support for vim and neovim.

For legacy python implementation, see branch master. LanguageClient-neovim Language Server Protocol support for vim and neovim. More recordings at Upd

Junfeng Li 3.5k Dec 29, 2022
Fennel language server protocol (LSP) support.

fennel-language-server Fennel language server protocol (LSP) support. fennel-language-server is currently in a very early stage and unreliable. Use it

null 68 Dec 27, 2022
WIP: Asynchronous Language Server Protocol framework

async-lsp Asynchronous Language Server Protocol (LSP) framework based on tower. ⚠️ This project serves as a proof-of-concept for LSP with middlewares

null 9 Apr 11, 2023
IDE tools for writing pest grammars, using the Language Server Protocol for Visual Studio Code, Vim and other editors

Pest IDE Tools IDE support for Pest, via the LSP. This repository contains an implementation of the Language Server Protocol in Rust, for the Pest par

pest 20 Apr 8, 2023
Rust IDE support for Atom, powered by the Rust Language Server (RLS)

IDE-Rust Rust language support for Atom-IDE, powered by rust-analyzer. Features Auto-completion Diagnostics (errors and warnings from rustc) Document

The Rust Programming Language 239 Dec 14, 2022
An experimental proofreading and linting language server for markdown files ✍️

prosemd is an experimental proofreading and linting language server for markdown files. It aims to provide helpful and smart diagnostics when writing

Phil Pluckthun 132 Dec 14, 2022
Repository for the Rust Language Server (aka RLS)

Rust Language Server (RLS) The RLS provides a server that runs in the background, providing IDEs, editors, and other tools with information about Rust

The Rust Programming Language 3.6k Dec 30, 2022
Experimental treesiter based language server, let's see how far this goes 😆.

tsls Tree-sitter based language server for general languages. Warning: It's in active development right now, and bug is expected. Features Go To Defin

Keyv Chan 16 Sep 11, 2022
A brand-new language server for Typst, plus a VS Code extension

Typst LSP A brand-new language server for Typst. Features Syntax highlighting, error reporting, code completion, and function signature help Compiles

Nathan Varner 414 Apr 17, 2023
Rust language support in Atom - LOOKING FOR MAINTAINER, see #144

Rust language support in Atom Adds syntax highlighting and snippets to Rust files in Atom. Install Install the package language-rust in Atom (Preferen

Andreas Neuhaus 118 Oct 11, 2022
RustDT is an Eclipse based IDE for the Rust programming language:

Project website: http://rustdt.github.io/ As of 2017, RustDT is no longer actively maintained, see this blog post for more information. If you are int

null 351 Aug 20, 2022
The official Sublime Text 3 package for the Rust Programming Language

Rust Enhanced About This is a Sublime Text 3 package which supports Rust starting with version 1.0, it makes no attempt at supporting earlier incompat

The Rust Programming Language 704 Jan 7, 2023
rust-analyzer is a modular compiler frontend for the Rust language

rust-analyzer is a modular compiler frontend for the Rust language. It is a part of a larger rls-2.0 effort to create excellent IDE support for Rust.

null 11.2k Jan 8, 2023
tree-sitter server for kakoune

tree-sitter.kak Warning This currently just a proof-of-concept, and isn't stable yet. A Tree-sitter server that keeps parsed ASTs in memory. This is u

Enrico Borba 8 May 4, 2023
Thin wrapper around starship.rs to format kakoune status line

kakship is just a thin wrapper around starship to format the status line of kakoune and is meant to be used with the included kakoune script kakship.kak.

Eric Burghard 15 Jun 7, 2022
Integrating `coqidetop` inside Kakoune

This plugin aims at providing a functional and usable coqidetop wrapper for use with Kakoune. For a list of things left to do, see the end of this REA

Mesabloo 6 Apr 22, 2022
Helix - A kakoune / neovim inspired editor, written in Rust

A kakoune / neovim inspired editor, written in Rust. The editing model is very heavily based on kakoune; during development I found myself agree

null 17.9k Jan 10, 2023
tree-sitter meets Kakoune

kak-tree-sitter This is a binary server that interfaces tree-sitter with kakoune. Features Install Usage Design Credits Features Semantic highlighting

Dimitri Sabadie 5 May 3, 2023