From 1ae8f81bd43089c354a88e1c6ac51753c86fb1ce Mon Sep 17 00:00:00 2001 From: lelgenio Date: Mon, 7 Dec 2020 15:23:56 -0300 Subject: [PATCH] add kak-lsp.toml --- config.yaml | 5 ++ dotfiles/kak-lsp.toml | 195 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 200 insertions(+) create mode 100644 dotfiles/kak-lsp.toml diff --git a/config.yaml b/config.yaml index 14cfcbb..9c801ec 100644 --- a/config.yaml +++ b/config.yaml @@ -351,6 +351,11 @@ dotfiles: # Just a bunch of paths and action mappings actions: - install_meta + kak-lsp: + src: kak-lsp.toml + dst: ~/.config/kak-lsp/kak-lsp.toml + + ############################################################### # Big pahts ############################################################### diff --git a/dotfiles/kak-lsp.toml b/dotfiles/kak-lsp.toml new file mode 100644 index 0000000..9f630aa --- /dev/null +++ b/dotfiles/kak-lsp.toml @@ -0,0 +1,195 @@ +snippet_support = true +verbosity = 2 + +[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.bash] +filetypes = ["sh"] +roots = [".git", ".hg"] +command = "bash-language-server" +args = ["start"] + +[language.c_cpp] +filetypes = ["c", "cpp"] +roots = [ "compile_commands.json", ".clangd" ] +command = "clangd" + +[language.crystal] +filetypes = ["crystal"] +roots = ["shard.yml"] +command = "scry" + +[language.css] +filetypes = ["css"] +roots = ["package.json"] +command = "css-languageserver" +args = ["--stdio"] + +[language.d] +filetypes = ["d", "di"] +roots = [".git", "dub.sdl", "dub.json"] +command = "dls" + +[language.dart] +# start shell to find path to dart analysis server source +filetypes = ["dart"] +roots = ["pubspec.yaml", ".git"] +command = "sh" +args = ["-c", "dart $(dirname $(which dart))/snapshots/analysis_server.dart.snapshot --lsp"] + +[language.elm] +filetypes = ["elm"] +roots = ["elm.json"] +command = "elm-language-server" +args = ["--stdio"] + +[language.elm.initialization_options] +runtime = "node" +elmPath = "elm" +elmFormatPath = "elm-format" +elmTestPath = "elm-test" + +[language.go] +filetypes = ["go"] +roots = ["Gopkg.toml", "go.mod", ".git", ".hg"] +command = "gopls" +offset_encoding = "utf-8" + +[language.haskell] +filetypes = ["haskell"] +roots = ["Setup.hs", "stack.yaml", "*.cabal"] +# You might also be interested in the newer, but early stage, haskell-language-server +# https://github.com/haskell/haskell-language-server +command = "hie-wrapper" +args = ["--lsp"] + +[language.html] +filetypes = ["html"] +roots = ["package.json"] +command = "html-languageserver" +args = ["--stdio"] + +[language.javascript] +filetypes = ["javascript"] +roots = [".flowconfig"] +command = "flow" +args = ["lsp"] + +[language.typescript] +filetypes = ["typescript"] +roots = ["package.json"] +command = "typescript-language-server" +args = ["--stdio"] + +[language.json] +filetypes = ["json"] +roots = ["package.json"] +command = "json-languageserver" +args = ["--stdio"] + +[language.latex] +filetypes = ["latex"] +roots = [".git"] +command = "texlab" + +[language.nim] +filetypes = ["nim"] +roots = ["*.nimble", ".git"] +command = "nimlsp" + +[language.nix] +filetypes = ["nix"] +roots = ["flake.nix", "shell.nix", ".git"] +command = "rnix-lsp" + +[language.ocaml] +filetypes = ["ocaml"] +roots = ["Makefile", "opam", "*.opam", "dune"] +command = "ocaml-language-server" +args = ["--stdio"] + +[language.php] +filetypes = ["php"] +roots = [".htaccess", "composer.json"] +command = "intelephense" +args = ["--stdio"] + +[language.php.initialization_options] +storagePath = "/tmp/intelephense" + +[language.python] +filetypes = ["python"] +roots = ["requirements.txt", "setup.py", ".git", ".hg"] +command = "pyls" +offset_encoding = "utf-8" + +[language.reason] +filetypes = ["reason"] +roots = ["package.json", "Makefile", ".git", ".hg"] +command = "ocaml-language-server" +args = ["--stdio"] + +[language.ruby] +filetypes = ["ruby"] +roots = ["Gemfile"] +command = "solargraph" +args = ["stdio"] + +# [language.rust] +# filetypes = ["rust"] +# roots = ["Cargo.toml"] +# command = "rls" +# args = [] + +[language.rust] +filetypes = ["rust"] +roots = ["Cargo.toml"] +command = "rust-analyzer" +args = [] + +[language.terraform] +filetypes = ["terraform"] +roots = ["*.tf"] +command = "terraform-ls" +args = ["serve"] + +[language.godot] +filetypes = ["gd", "gdscript", "gdscript3"] +roots = ["project.godot", ".git/"] +command = "nc" +args = [ "localhost", "6008"]