Compare commits
2 commits
526ed059db
...
fb1652d82b
Author | SHA1 | Date | |
---|---|---|---|
Natsu Kagami | fb1652d82b | ||
Natsu Kagami | 91603a500d |
|
@ -11,16 +11,55 @@ let
|
||||||
kak-lsp-frontend = { pkgs, lib, ... }:
|
kak-lsp-frontend = { pkgs, lib, ... }:
|
||||||
let
|
let
|
||||||
langserver = name: {
|
langserver = name: {
|
||||||
args = [ "--stdio" ];
|
name = "vscode-${name}-language-server";
|
||||||
command = "${pkgs.nodePackages.vscode-langservers-extracted}/bin/vscode-${name}-language-server";
|
value = {
|
||||||
filetypes = [ name ];
|
args = [ "--stdio" ];
|
||||||
roots = [ "package.json" ".git" ];
|
command = "${pkgs.nodePackages.vscode-langservers-extracted}/bin/vscode-${name}-language-server";
|
||||||
|
filetypes = [ name ];
|
||||||
|
roots = [ "package.json" ".git" ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
tailwind = {
|
||||||
|
command = "tailwindcss-language-server";
|
||||||
|
args = [ "--stdio" ];
|
||||||
|
filetypes = [ "html" "css" "javascript" "typescript" "templ" ];
|
||||||
|
roots = [ "tailwind.config.{js,cjs,mjs,ts}" "package.json" ".git" ];
|
||||||
|
settings_section = "tailwindCSS";
|
||||||
|
settings.tailwindCSS = {
|
||||||
|
validate = "warning";
|
||||||
|
userLanguages.templ = "html";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
templModule = { pkgs, lib, ... }: {
|
||||||
|
programs.kak-lsp.languageServers."vscode-html-language-server".filetypes = [ "templ" ];
|
||||||
|
programs.kak-lsp.languageServers."tailwindcss-language-server".filetypes = [ "templ" ];
|
||||||
|
programs.kak-lsp.languageServers.templ = {
|
||||||
|
command = "templ";
|
||||||
|
args = [ "lsp" ];
|
||||||
|
filetypes = [ "templ" ];
|
||||||
|
roots = [ "go.mod" ".git" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
home.packages = [ pkgs.unstable.templ ];
|
||||||
|
};
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
programs.kak-lsp.languages = lib.attrsets.genAttrs [ "html" "css" "json" ] langserver;
|
imports = [ templModule ];
|
||||||
|
|
||||||
|
programs.kak-lsp.languageServers = (builtins.listToAttrs (map langserver [ "html" "css" "json" ])) // {
|
||||||
|
tailwindcss-language-server = tailwind;
|
||||||
|
};
|
||||||
|
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
nodePackages.vscode-langservers-extracted
|
||||||
|
tailwindcss-language-server
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [ ../modules/programs/my-kakoune ./kaktex.nix kak-lsp-frontend ];
|
imports = [ ../modules/programs/my-kakoune ./kaktex.nix kak-lsp-frontend ];
|
||||||
|
@ -54,13 +93,13 @@ in
|
||||||
{ face = "ts_markup_italic"; token = "text"; modifiers = [ "emph" ]; }
|
{ face = "ts_markup_italic"; token = "text"; modifiers = [ "emph" ]; }
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.kak-lsp.languages.typescript = {
|
programs.kak-lsp.languageServers.typescript-language-server = {
|
||||||
args = [ "--stdio" ];
|
args = [ "--stdio" ];
|
||||||
command = "typescript-language-server";
|
command = "typescript-language-server";
|
||||||
filetypes = [ "typescript" ];
|
filetypes = [ "typescript" ];
|
||||||
roots = [ "package.json" ];
|
roots = [ "package.json" ];
|
||||||
};
|
};
|
||||||
programs.kak-lsp.languages.fsharp = {
|
programs.kak-lsp.languageServers.fsautocomplete = {
|
||||||
args = [ "--adaptive-lsp-server-enabled" "--project-graph-enabled" "--source-text-factory" "RoslynSourceText" ];
|
args = [ "--adaptive-lsp-server-enabled" "--project-graph-enabled" "--source-text-factory" "RoslynSourceText" ];
|
||||||
command = "fsautocomplete";
|
command = "fsautocomplete";
|
||||||
filetypes = [ "fsharp" ];
|
filetypes = [ "fsharp" ];
|
||||||
|
@ -70,7 +109,7 @@ in
|
||||||
AutomaticWorkspaceInit = true;
|
AutomaticWorkspaceInit = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
programs.kak-lsp.languages.scala = {
|
programs.kak-lsp.languageServers.metals = {
|
||||||
command = "metals";
|
command = "metals";
|
||||||
filetypes = [ "scala" ];
|
filetypes = [ "scala" ];
|
||||||
roots = [ "build.sbt" "build.sc" ];
|
roots = [ "build.sbt" "build.sc" ];
|
||||||
|
@ -80,9 +119,14 @@ in
|
||||||
showInferredType = true;
|
showInferredType = true;
|
||||||
decorationProvider = true;
|
decorationProvider = true;
|
||||||
inlineDecorationProvider = true;
|
inlineDecorationProvider = true;
|
||||||
|
# From kakoune-lsp's own options
|
||||||
|
icons = "unicode";
|
||||||
|
isHttpEnabled = true;
|
||||||
|
statusBarProvider = "log-message";
|
||||||
|
compilerOptions = { overrideDefFormat = "unicode"; };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
programs.kak-lsp.languages.latex = {
|
programs.kak-lsp.languageServers.texlab = {
|
||||||
command = "texlab";
|
command = "texlab";
|
||||||
filetypes = [ "latex" ];
|
filetypes = [ "latex" ];
|
||||||
roots = [ "main.tex" "all.tex" ".git" ];
|
roots = [ "main.tex" "all.tex" ".git" ];
|
||||||
|
@ -105,7 +149,7 @@ in
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
programs.kak-lsp.languages.typst = {
|
programs.kak-lsp.languageServers.typst-lsp = {
|
||||||
command = "typst-lsp";
|
command = "typst-lsp";
|
||||||
filetypes = [ "typst" ];
|
filetypes = [ "typst" ];
|
||||||
roots = [ "main.typ" ".git" ];
|
roots = [ "main.typ" ".git" ];
|
||||||
|
@ -114,7 +158,7 @@ in
|
||||||
experimentalFormatterMode = "on";
|
experimentalFormatterMode = "on";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
programs.kak-lsp.languages.markdown = {
|
programs.kak-lsp.languageServers.marksman = {
|
||||||
command = "marksman";
|
command = "marksman";
|
||||||
filetypes = [ "markdown" ];
|
filetypes = [ "markdown" ];
|
||||||
roots = [ ".marksman.toml" ".git" ];
|
roots = [ ".marksman.toml" ".git" ];
|
||||||
|
@ -136,66 +180,115 @@ in
|
||||||
conditional = "keyword_conditional";
|
conditional = "keyword_conditional";
|
||||||
include = "keyword_control_import";
|
include = "keyword_control_import";
|
||||||
};
|
};
|
||||||
programs.my-kakoune.tree-sitter.languages = {
|
programs.my-kakoune.tree-sitter.languages =
|
||||||
scala =
|
let
|
||||||
let
|
tree-sitter-go = pkgs.fetchFromGitHub {
|
||||||
src = pkgs.fetchFromGitHub {
|
owner = "tree-sitter";
|
||||||
owner = "tree-sitter";
|
repo = "tree-sitter-go";
|
||||||
repo = "tree-sitter-scala";
|
rev = "v0.20.0";
|
||||||
rev = "70afdd5632d57dd63a960972ab25945e353a52f6";
|
hash = "sha256-XUSXOTqUySShJ7gebnhObwaFllfIxEYIHN70/wpiJdw=";
|
||||||
hash =
|
leaveDotGit = true;
|
||||||
if pkgs.stdenv.isDarwin
|
|
||||||
then lib.fakeHash
|
|
||||||
else "sha256-Q8KSI8H7+d/sUdSlcNAiOPn2THKk7SFqC3U7rLqSqtE=";
|
|
||||||
leaveDotGit = true;
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
|
||||||
grammar.src = src;
|
|
||||||
queries.src = src;
|
|
||||||
queries.path = "queries/scala";
|
|
||||||
};
|
};
|
||||||
haskell =
|
in
|
||||||
let
|
{
|
||||||
src = pkgs.fetchFromGitHub {
|
scala =
|
||||||
owner = "tree-sitter";
|
let
|
||||||
repo = "tree-sitter-haskell";
|
src = pkgs.fetchFromGitHub {
|
||||||
rev = "ba0bfb0e5d8e9e31c160d287878c6f26add3ec08";
|
owner = "tree-sitter";
|
||||||
sha256 =
|
repo = "tree-sitter-scala";
|
||||||
if pkgs.stdenv.isDarwin
|
rev = "70afdd5632d57dd63a960972ab25945e353a52f6";
|
||||||
then "sha256-lW3E4gSZV/m2RfofUqeiCu8KDz06YEvXbYKs8smXFi4="
|
hash =
|
||||||
else "sha256-H5Z4vPTZCFxDCWguOB8oVSGPJyQonrD8FWAQZTYPG2U=";
|
if pkgs.stdenv.isDarwin
|
||||||
|
then lib.fakeHash
|
||||||
|
else "sha256-Q8KSI8H7+d/sUdSlcNAiOPn2THKk7SFqC3U7rLqSqtE=";
|
||||||
|
leaveDotGit = true;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
grammar.src = src;
|
||||||
|
queries.src = src;
|
||||||
|
queries.path = "queries/scala";
|
||||||
|
};
|
||||||
|
haskell =
|
||||||
|
let
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "tree-sitter";
|
||||||
|
repo = "tree-sitter-haskell";
|
||||||
|
rev = "ba0bfb0e5d8e9e31c160d287878c6f26add3ec08";
|
||||||
|
sha256 =
|
||||||
|
if pkgs.stdenv.isDarwin
|
||||||
|
then "sha256-lW3E4gSZV/m2RfofUqeiCu8KDz06YEvXbYKs8smXFi4="
|
||||||
|
else "sha256-H5Z4vPTZCFxDCWguOB8oVSGPJyQonrD8FWAQZTYPG2U=";
|
||||||
|
leaveDotGit = true;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
grammar.src = src;
|
||||||
|
grammar.compile.args = [ "-c" "-fpic" "../parser.c" "../scanner.c" "../unicode.h" "-I" ".." ];
|
||||||
|
queries.src = src;
|
||||||
|
queries.path = "queries";
|
||||||
|
};
|
||||||
|
yaml = {
|
||||||
|
grammar.src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "ikatyang";
|
||||||
|
repo = "tree-sitter-yaml";
|
||||||
|
rev = "0e36bed171768908f331ff7dff9d956bae016efb";
|
||||||
|
hash = "sha256-rN/a8dYffDQNuvnhNp/nfu0AzhYrR1ESACQbQWb/n5w=";
|
||||||
leaveDotGit = true;
|
leaveDotGit = true;
|
||||||
};
|
};
|
||||||
in
|
grammar.compile.args = [ "-c" "-fpic" "../scanner.cc" "../parser.c" "-I" ".." ];
|
||||||
{
|
grammar.link.args = [ "-shared" "-fpic" "scanner.o" "parser.o" ];
|
||||||
grammar.src = src;
|
grammar.link.flags = [ "-O3" "-lstdc++" ];
|
||||||
grammar.compile.args = [ "-c" "-fpic" "../parser.c" "../scanner.c" "../unicode.h" "-I" ".." ];
|
|
||||||
queries.src = src;
|
queries.src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "helix-editor";
|
||||||
|
repo = "helix";
|
||||||
|
rev = "dbd248fdfa680373d94fbc10094a160aafa0f7a7";
|
||||||
|
hash = "sha256-dv/T8ROXmwEdjM71gza1RzF2HoINA7Zl2jmz63kCZyQ=";
|
||||||
|
leaveDotGit = true;
|
||||||
|
};
|
||||||
|
queries.path = "runtime/queries/yaml";
|
||||||
|
};
|
||||||
|
|
||||||
|
templ =
|
||||||
|
let
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "vrischmann";
|
||||||
|
repo = "tree-sitter-templ";
|
||||||
|
rev = "044ad200092170727650fa6d368df66a8da98f9d";
|
||||||
|
hash = "sha256-umhemFnz/nLzkJk75wMoMAHT+Zs9MYOqWPoYQwoFu74=";
|
||||||
|
leaveDotGit = true;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
grammar.src = src;
|
||||||
|
queries.src = pkgs.runCommandLocal "templ-tree-sitter-queries" { } ''
|
||||||
|
mkdir -p queries
|
||||||
|
# copy most stuff from tree-sitter-templ
|
||||||
|
install -m644 ${src}/queries/templ/* queries
|
||||||
|
# override inherited files
|
||||||
|
cat ${tree-sitter-go}/queries/highlights.scm ${src}/queries/templ/highlights.scm > queries/highlights.scm
|
||||||
|
|
||||||
|
mkdir -p $out/queries
|
||||||
|
cp -r queries $out/queries/templ
|
||||||
|
cd $out
|
||||||
|
${lib.getExe pkgs.git} init
|
||||||
|
${lib.getExe pkgs.git} config user.email "a@b.com"
|
||||||
|
${lib.getExe pkgs.git} config user.name "a"
|
||||||
|
${lib.getExe pkgs.git} add .
|
||||||
|
${lib.getExe pkgs.git} commit -m "Just making a git commit"
|
||||||
|
'';
|
||||||
|
queries.path = "queries/templ";
|
||||||
|
};
|
||||||
|
|
||||||
|
go = {
|
||||||
|
grammar.src = tree-sitter-go;
|
||||||
|
grammar.compile.args = [ "-c" "-fpic" "../parser.c" "-I" ".." ];
|
||||||
|
grammar.link.args = [ "-shared" "-fpic" "parser.o" ];
|
||||||
|
queries.src = tree-sitter-go;
|
||||||
queries.path = "queries";
|
queries.path = "queries";
|
||||||
};
|
};
|
||||||
yaml = {
|
|
||||||
grammar.src = pkgs.fetchFromGitHub {
|
|
||||||
owner = "ikatyang";
|
|
||||||
repo = "tree-sitter-yaml";
|
|
||||||
rev = "0e36bed171768908f331ff7dff9d956bae016efb";
|
|
||||||
hash = "sha256-rN/a8dYffDQNuvnhNp/nfu0AzhYrR1ESACQbQWb/n5w=";
|
|
||||||
leaveDotGit = true;
|
|
||||||
};
|
|
||||||
grammar.compile.args = [ "-c" "-fpic" "../scanner.cc" "../parser.c" "-I" ".." ];
|
|
||||||
grammar.link.args = [ "-shared" "-fpic" "scanner.o" "parser.o" ];
|
|
||||||
grammar.link.flags = [ "-O3" "-lstdc++" ];
|
|
||||||
|
|
||||||
queries.src = pkgs.fetchFromGitHub {
|
|
||||||
owner = "helix-editor";
|
|
||||||
repo = "helix";
|
|
||||||
rev = "dbd248fdfa680373d94fbc10094a160aafa0f7a7";
|
|
||||||
hash = "sha256-dv/T8ROXmwEdjM71gza1RzF2HoINA7Zl2jmz63kCZyQ=";
|
|
||||||
leaveDotGit = true;
|
|
||||||
};
|
|
||||||
queries.path = "runtime/queries/yaml";
|
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
programs.my-kakoune.package = pkgs.kakoune;
|
programs.my-kakoune.package = pkgs.kakoune;
|
||||||
programs.my-kakoune.rc =
|
programs.my-kakoune.rc =
|
||||||
|
|
|
@ -90,7 +90,7 @@ hook global InsertCompletionHide .* %{
|
||||||
try %{
|
try %{
|
||||||
eval %sh{test -z "$WE_STARTED_KAK" && kak-lsp --kakoune -s $kak_session}
|
eval %sh{test -z "$WE_STARTED_KAK" && kak-lsp --kakoune -s $kak_session}
|
||||||
}
|
}
|
||||||
hook global WinSetOption filetype=(racket|rust|python|go|javascript|typescript|c|cpp|tex|latex|fsharp|ocaml|haskell|nix|scala|typst|html|css|json|markdown) %{
|
hook global WinSetOption filetype=(racket|rust|python|go|javascript|typescript|c|cpp|tex|latex|fsharp|ocaml|haskell|nix|scala|typst|html|css|json|markdown|templ) %{
|
||||||
lsp-enable-window
|
lsp-enable-window
|
||||||
map window lsp N -docstring "Display the next message request" ": lsp-show-message-request-next<ret>"
|
map window lsp N -docstring "Display the next message request" ": lsp-show-message-request-next<ret>"
|
||||||
map window normal <c-l> ": enter-user-mode lsp<ret>"
|
map window normal <c-l> ": enter-user-mode lsp<ret>"
|
||||||
|
@ -98,9 +98,16 @@ hook global WinSetOption filetype=(racket|rust|python|go|javascript|typescript|c
|
||||||
map window normal <c-s-h> ": lsp-hover-buffer<ret>"
|
map window normal <c-s-h> ": lsp-hover-buffer<ret>"
|
||||||
# lsp-auto-hover-insert-mode-enable
|
# lsp-auto-hover-insert-mode-enable
|
||||||
set window lsp_hover_anchor true
|
set window lsp_hover_anchor true
|
||||||
|
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 f '<a-semicolon>lsp-object Function Method<ret>' -docstring 'LSP function or method'
|
||||||
|
map global object t '<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'
|
||||||
}
|
}
|
||||||
|
|
||||||
hook global WinSetOption filetype=(racket|rust|python|go|javascript|typescript|c|cpp|tex|latex|haskell|nix|fsharp) %{
|
hook global WinSetOption filetype=(racket|rust|python|go|javascript|typescript|c|cpp|tex|latex|haskell|nix|fsharp|templ) %{
|
||||||
# Format the document if possible
|
# Format the document if possible
|
||||||
hook window BufWritePre .* %{ lsp-formatting-sync }
|
hook window BufWritePre .* %{ lsp-formatting-sync }
|
||||||
}
|
}
|
||||||
|
@ -206,6 +213,11 @@ hook global BufCreate .*[.]typ %{
|
||||||
add-highlighter buffer/ wrap
|
add-highlighter buffer/ wrap
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hook global BufCreate .*[.]templ %{
|
||||||
|
set-option buffer filetype templ
|
||||||
|
set-option window comment_line "//"
|
||||||
|
}
|
||||||
|
|
||||||
hook global BufOpenFile .* %{
|
hook global BufOpenFile .* %{
|
||||||
modeline-parse
|
modeline-parse
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,52 +4,23 @@ with lib;
|
||||||
let
|
let
|
||||||
lspConfig =
|
lspConfig =
|
||||||
{
|
{
|
||||||
languages = {
|
language_ids = {
|
||||||
bash = {
|
c = "c_cpp";
|
||||||
args = [ "start" ];
|
cpp = "c_cpp";
|
||||||
command = "bash-language-server";
|
javascript = "javascriptreact";
|
||||||
filetypes = [ "sh" ];
|
typescript = "typescriptreact";
|
||||||
roots = [ ".git" ".hg" ];
|
protobuf = "proto";
|
||||||
};
|
sh = "shellscript";
|
||||||
c_cpp = {
|
};
|
||||||
|
|
||||||
|
language_servers = {
|
||||||
|
ccls = {
|
||||||
args = [ "-v=2" "-log-file=/tmp/ccls.log" ];
|
args = [ "-v=2" "-log-file=/tmp/ccls.log" ];
|
||||||
command = "ccls";
|
command = "ccls";
|
||||||
filetypes = [ "c" "cpp" ];
|
filetypes = [ "c" "cpp" ];
|
||||||
roots = [ "compile_commands.json" ".cquery" ".git" ];
|
roots = [ "compile_commands.json" ".cquery" ".git" ];
|
||||||
};
|
};
|
||||||
crystal = {
|
gopls = {
|
||||||
command = "scry";
|
|
||||||
filetypes = [ "crystal" ];
|
|
||||||
roots = [ "shard.yml" ];
|
|
||||||
};
|
|
||||||
css = {
|
|
||||||
args = [ "--stdio" ];
|
|
||||||
command = "css-languageserver";
|
|
||||||
filetypes = [ "css" ];
|
|
||||||
roots = [ "package.json" ];
|
|
||||||
};
|
|
||||||
d = {
|
|
||||||
command = "dls";
|
|
||||||
filetypes = [ "d" "di" ];
|
|
||||||
roots = [ ".git" "dub.sdl" "dub.json" ];
|
|
||||||
};
|
|
||||||
dart = {
|
|
||||||
command = "dart_language_server";
|
|
||||||
filetypes = [ "dart" ];
|
|
||||||
roots = [ "pubspec.yaml" ".git" ];
|
|
||||||
};
|
|
||||||
elm = {
|
|
||||||
args = [ "--stdio" ];
|
|
||||||
command = "elm-language-server";
|
|
||||||
filetypes = [ "elm" ];
|
|
||||||
roots = [ "elm.json" ];
|
|
||||||
};
|
|
||||||
fsharp = {
|
|
||||||
command = "FSharpLanguageServer";
|
|
||||||
filetypes = [ "fsharp" ];
|
|
||||||
roots = [ ".git" "*.fsx" ];
|
|
||||||
};
|
|
||||||
go = {
|
|
||||||
command = "gopls";
|
command = "gopls";
|
||||||
filetypes = [ "go" ];
|
filetypes = [ "go" ];
|
||||||
offset_encoding = "utf-8";
|
offset_encoding = "utf-8";
|
||||||
|
@ -57,32 +28,14 @@ let
|
||||||
settings = { gopls = { hoverKind = "SynopsisDocumentation"; semanticTokens = true; }; };
|
settings = { gopls = { hoverKind = "SynopsisDocumentation"; semanticTokens = true; }; };
|
||||||
settings_section = "gopls";
|
settings_section = "gopls";
|
||||||
};
|
};
|
||||||
haskell = {
|
haskell-language-server = {
|
||||||
args = [ "--lsp" ];
|
args = [ "--lsp" ];
|
||||||
command = "haskell-language-server-wrapper";
|
command = "haskell-language-server-wrapper";
|
||||||
filetypes = [ "haskell" ];
|
filetypes = [ "haskell" ];
|
||||||
roots = [ "Setup.hs" "stack.yaml" "*.cabal" "package.yaml" ];
|
roots = [ "Setup.hs" "stack.yaml" "*.cabal" "package.yaml" ];
|
||||||
settings_section = "haskell";
|
settings_section = "haskell";
|
||||||
};
|
};
|
||||||
html = {
|
texlab = {
|
||||||
args = [ "--stdio" ];
|
|
||||||
command = "html-languageserver";
|
|
||||||
filetypes = [ "html" ];
|
|
||||||
roots = [ "package.json" ];
|
|
||||||
};
|
|
||||||
javascript = {
|
|
||||||
args = [ "lsp" ];
|
|
||||||
command = "flow";
|
|
||||||
filetypes = [ "javascript" ];
|
|
||||||
roots = [ ".flowconfig" ];
|
|
||||||
};
|
|
||||||
json = {
|
|
||||||
args = [ "--stdio" ];
|
|
||||||
command = "json-languageserver";
|
|
||||||
filetypes = [ "json" ];
|
|
||||||
roots = [ "package.json" ];
|
|
||||||
};
|
|
||||||
latex = {
|
|
||||||
command = "texlab";
|
command = "texlab";
|
||||||
filetypes = [ "latex" ];
|
filetypes = [ "latex" ];
|
||||||
roots = [ ".git" "main.tex" "all.tex" ];
|
roots = [ ".git" "main.tex" "all.tex" ];
|
||||||
|
@ -100,12 +53,7 @@ let
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
nim = {
|
nil = {
|
||||||
command = "nimlsp";
|
|
||||||
filetypes = [ "nim" ];
|
|
||||||
roots = [ "*.nimble" ".git" ];
|
|
||||||
};
|
|
||||||
nix = {
|
|
||||||
command = "${pkgs.nil}/bin/nil";
|
command = "${pkgs.nil}/bin/nil";
|
||||||
filetypes = [ "nix" ];
|
filetypes = [ "nix" ];
|
||||||
roots = [ "flake.nix" "shell.nix" ".git" ];
|
roots = [ "flake.nix" "shell.nix" ".git" ];
|
||||||
|
@ -113,43 +61,13 @@ let
|
||||||
formatting.command = [ "${getExe pkgs.nixpkgs-fmt}" ];
|
formatting.command = [ "${getExe pkgs.nixpkgs-fmt}" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
ocaml = {
|
pyls = {
|
||||||
args = [ ];
|
|
||||||
command = "ocamllsp";
|
|
||||||
filetypes = [ "ocaml" ];
|
|
||||||
roots = [ "Makefile" "opam" "*.opam" "dune" ".merlin" ".ocamlformat" ];
|
|
||||||
};
|
|
||||||
php = {
|
|
||||||
args = [ "--stdio" ];
|
|
||||||
command = "intelephense";
|
|
||||||
filetypes = [ "php" ];
|
|
||||||
roots = [ ".htaccess" "composer.json" ];
|
|
||||||
};
|
|
||||||
python = {
|
|
||||||
command = "pyls";
|
command = "pyls";
|
||||||
filetypes = [ "python" ];
|
filetypes = [ "python" ];
|
||||||
offset_encoding = "utf-8";
|
offset_encoding = "utf-8";
|
||||||
roots = [ "requirements.txt" "setup.py" ".git" ".hg" ];
|
roots = [ "requirements.txt" "setup.py" ".git" ".hg" ];
|
||||||
};
|
};
|
||||||
racket = {
|
rust-analyzer = {
|
||||||
args = [ "-l" "racket-langserver" ];
|
|
||||||
command = "racket";
|
|
||||||
filetypes = [ "racket" ];
|
|
||||||
roots = [ ".git" ];
|
|
||||||
};
|
|
||||||
reason = {
|
|
||||||
args = [ "--stdio" ];
|
|
||||||
command = "ocaml-language-server";
|
|
||||||
filetypes = [ "reason" ];
|
|
||||||
roots = [ "package.json" "Makefile" ".git" ".hg" ];
|
|
||||||
};
|
|
||||||
ruby = {
|
|
||||||
args = [ "stdio" ];
|
|
||||||
command = "solargraph";
|
|
||||||
filetypes = [ "ruby" ];
|
|
||||||
roots = [ "Gemfile" ];
|
|
||||||
};
|
|
||||||
rust = {
|
|
||||||
args = [ ];
|
args = [ ];
|
||||||
command = "rust-analyzer";
|
command = "rust-analyzer";
|
||||||
filetypes = [ "rust" ];
|
filetypes = [ "rust" ];
|
||||||
|
@ -191,7 +109,7 @@ let
|
||||||
verbosity = 255;
|
verbosity = 255;
|
||||||
};
|
};
|
||||||
|
|
||||||
languageOption = types.submodule {
|
languageServerOption = types.submodule {
|
||||||
options = {
|
options = {
|
||||||
filetypes = mkOption {
|
filetypes = mkOption {
|
||||||
type = types.listOf types.str;
|
type = types.listOf types.str;
|
||||||
|
@ -262,11 +180,17 @@ in
|
||||||
description = "Server timeout";
|
description = "Server timeout";
|
||||||
};
|
};
|
||||||
|
|
||||||
languages = mkOption {
|
languageServers = mkOption {
|
||||||
type = types.attrsOf languageOption;
|
type = types.attrsOf languageServerOption;
|
||||||
default = { };
|
default = { };
|
||||||
description = "The language options";
|
description = "The language options";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
languageIds = mkOption {
|
||||||
|
type = types.attrsOf types.str;
|
||||||
|
default = { };
|
||||||
|
description = "Language IDs to be sent to the LSP";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
@ -286,7 +210,8 @@ in
|
||||||
server.timeout = cfg.serverTimeout;
|
server.timeout = cfg.serverTimeout;
|
||||||
snippet_support = cfg.enableSnippets;
|
snippet_support = cfg.enableSnippets;
|
||||||
verbosity = 255;
|
verbosity = 255;
|
||||||
language = lspConfig.languages // cfg.languages;
|
language_server = lspConfig.language_servers // cfg.languageServers;
|
||||||
|
language_ids = lspConfig.language_ids // cfg.languageIds;
|
||||||
})
|
})
|
||||||
} \
|
} \
|
||||||
> $out
|
> $out
|
||||||
|
|
Loading…
Reference in a new issue