mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-02-23 20:12:00 +00:00
Merge branch 'main' into blink.cmp
This commit is contained in:
commit
11a449002a
16 changed files with 495 additions and 29 deletions
3
.github/typos.toml
vendored
3
.github/typos.toml
vendored
|
|
@ -9,6 +9,7 @@ default.extend-ignore-words-re = [
|
|||
"edn",
|
||||
"esy",
|
||||
"BA", # somehow "BANanaD3V" is valid, but BA is not...
|
||||
"Emac"
|
||||
"Emac",
|
||||
"tese" # for glsl shaders
|
||||
]
|
||||
|
||||
|
|
|
|||
7
.github/workflows/check.yml
vendored
7
.github/workflows/check.yml
vendored
|
|
@ -100,6 +100,13 @@ jobs:
|
|||
substituters = https://cache.nixos.org/ https://feel-co.cachix.org
|
||||
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= feel-co.cachix.org-1:nwEFNnwZvtl4KKSH5LDg+/+K7bV0vcs6faMHAJ6xx0w=
|
||||
|
||||
- uses: cachix/cachix-action@v16
|
||||
with:
|
||||
authToken: ${{ secrets.CACHIX_TOKEN }}
|
||||
extraPullNames: nix-community
|
||||
name: nvf
|
||||
pushFilter: '(ndg-\d+\.\d+\.\d+$)'
|
||||
|
||||
- name: Set default git branch (to reduce log spam)
|
||||
run: git config --global init.defaultBranch main
|
||||
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ isMaximal: {
|
|||
# Languages that are enabled in the maximal configuration.
|
||||
bash.enable = isMaximal;
|
||||
clang.enable = isMaximal;
|
||||
cmake.enable = isMaximal;
|
||||
css.enable = isMaximal;
|
||||
html.enable = isMaximal;
|
||||
json.enable = isMaximal;
|
||||
|
|
@ -75,6 +76,7 @@ isMaximal: {
|
|||
xml.enable = isMaximal;
|
||||
|
||||
# Language modules that are not as common.
|
||||
arduino.enable = false;
|
||||
assembly.enable = false;
|
||||
astro.enable = false;
|
||||
nu.enable = false;
|
||||
|
|
@ -84,6 +86,7 @@ isMaximal: {
|
|||
scala.enable = false;
|
||||
r.enable = false;
|
||||
gleam.enable = false;
|
||||
glsl.enable = false;
|
||||
dart.enable = false;
|
||||
ocaml.enable = false;
|
||||
elixir.enable = false;
|
||||
|
|
|
|||
|
|
@ -27,6 +27,20 @@
|
|||
|
||||
[Snoweuph](https://github.com/snoweuph)
|
||||
|
||||
- "Correct `languages.go.treesitter` to contain all Go file types.
|
||||
`languages.go.treesitter.package` is now `languages.go.treesitter.goPackage`.
|
||||
New are:
|
||||
|
||||
- `languages.go.treesitter.goPackage`.
|
||||
|
||||
- `languages.go.treesitter.gomodPackage`.
|
||||
|
||||
- `languages.go.treesitter.gosumPackage`.
|
||||
|
||||
- `languages.go.treesitter.goworkPackage`.
|
||||
|
||||
- `languages.go.treesitter.gotmplPackage`.
|
||||
|
||||
- Fix `vim.assistant.codecompanion-nvim.setupOpts.display.diff.provider` to only
|
||||
allow valid options. `default` is no longer valid. `inline` and `split` are
|
||||
two new valid options.
|
||||
|
|
@ -169,15 +183,30 @@
|
|||
- Added [Selenen](https://github.com/kampfkarren/selene) for more diagnostics in
|
||||
`languages.lua`.
|
||||
|
||||
- Added [`mdformat`](https://mdformat.rtfd.io/) support to `languages.python`.
|
||||
|
||||
- Added XML syntax highlighting, LSP support and formatting
|
||||
|
||||
- Added [mypy](https://www.mypy-lang.org/) to `languages.python` for extra
|
||||
diagnostics.
|
||||
|
||||
- Added [tera](https://keats.github.io/tera/) language support (syntax
|
||||
highlighting only).
|
||||
|
||||
- Added Debugging support to `languages.odin` with
|
||||
[nvim-dap-odin](https://github.com/NANDquark/nvim-dap-odin).
|
||||
|
||||
- Added [`golangci-lint`](https://golangci-lint.run/) for more diagnostics.
|
||||
|
||||
- updated default filetypes for
|
||||
[harper-ls](https://github.com/Automattic/harper) to match what they are
|
||||
supposed to be.
|
||||
|
||||
- Added Makefile support via `languages.make`.
|
||||
|
||||
- Fix `languages.hcl` init, depending on `comment-nvim` by checking if it is
|
||||
enabled. Fixes a crash (#1350).
|
||||
|
||||
- Added Debugging support to `languages.php`.
|
||||
|
||||
- Added Formatting support to `languages.php` via
|
||||
|
|
@ -208,4 +237,18 @@ https://github.com/gorbit99/codewindow.nvim
|
|||
|
||||
- Changed `withRuby` to not be enabled by default
|
||||
|
||||
[horriblename](https://github.com/horriblename):
|
||||
|
||||
- Ignore terminals by default in spell-checking
|
||||
|
||||
[poz](https://poz.pet):
|
||||
|
||||
[neocmakelsp]: https://github.com/neocmakelsp/neocmakelsp
|
||||
[arduino-language-server]: https://github.com/arduino/arduino-language-server
|
||||
[glsl_analyzer]: https://github.com/nolanderc/glsl_analyzer
|
||||
|
||||
- Add CMake support with [neocmakelsp].
|
||||
- Add Arduino support with [arduino-language-server].
|
||||
- Add GLSL support with [glsl_analyzer].
|
||||
|
||||
<!-- vim: set textwidth=80: -->
|
||||
|
|
|
|||
|
|
@ -4,13 +4,14 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (builtins) length;
|
||||
inherit (lib.modules) mkIf mkRenamedOptionModule;
|
||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
||||
inherit (lib.strings) concatLines concatStringsSep optionalString;
|
||||
inherit (lib.strings) concatLines concatStringsSep;
|
||||
inherit (lib.attrsets) mapAttrsToList;
|
||||
inherit (lib.types) listOf str attrsOf;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.nvim.dag) entryAfter;
|
||||
inherit (lib.types) listOf str attrsOf bool;
|
||||
inherit (lib.lists) optional;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
|
||||
cfg = config.vim.spellcheck;
|
||||
in {
|
||||
|
|
@ -86,6 +87,12 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
ignoreTerminal = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
description = "Disable spell checking in terminal.";
|
||||
};
|
||||
|
||||
programmingWordlist.enable = mkEnableOption ''
|
||||
vim-dirtytalk, a wordlist for programmers containing
|
||||
common programming terms.
|
||||
|
|
@ -144,20 +151,25 @@ in {
|
|||
spelllang = concatStringsSep "," cfg.languages;
|
||||
};
|
||||
|
||||
# Register an autocommand to disable spellchecking in buffers with given filetypes.
|
||||
# If the list is empty, the autocommand does not need to be registered.
|
||||
luaConfigRC.spellcheck = entryAfter ["basic"] (optionalString (cfg.ignoredFiletypes != []) ''
|
||||
-- Disable spellchecking for certain filetypes
|
||||
-- as configured by `vim.spellcheck.ignoredFiletypes`
|
||||
vim.api.nvim_create_augroup("nvf_autocmds", {clear = false})
|
||||
vim.api.nvim_create_autocmd({ "FileType" }, {
|
||||
group = "nvf_autocmds",
|
||||
pattern = ${toLuaObject cfg.ignoredFiletypes},
|
||||
callback = function()
|
||||
vim.opt_local.spell = false
|
||||
end,
|
||||
augroups = [{name = "nvf_spellcheck";}];
|
||||
autocmds =
|
||||
(optional cfg.ignoreTerminal {
|
||||
event = ["TermOpen"];
|
||||
group = "nvf_spellcheck";
|
||||
callback = mkLuaInline ''
|
||||
function() vim.opt_local.spell = false end
|
||||
'';
|
||||
})
|
||||
'');
|
||||
++ (optional (length cfg.ignoredFiletypes > 0) {
|
||||
event = ["FileType"];
|
||||
group = "nvf_spellcheck";
|
||||
pattern = cfg.ignoredFiletypes;
|
||||
callback = mkLuaInline ''
|
||||
function()
|
||||
vim.opt_local.spell = false
|
||||
end
|
||||
'';
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
95
modules/plugins/languages/arduino.nix
Normal file
95
modules/plugins/languages/arduino.nix
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (builtins) attrNames;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
inherit (lib.meta) getExe getExe';
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.types) enum listOf str;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
inherit (lib.nvim.types) mkGrammarOption;
|
||||
|
||||
cfg = config.vim.languages.arduino;
|
||||
|
||||
defaultServers = ["arduino-language-server"];
|
||||
servers = {
|
||||
arduino-language-server = {
|
||||
enable = true;
|
||||
cmd =
|
||||
[
|
||||
(getExe pkgs.arduino-language-server)
|
||||
"-clangd"
|
||||
(getExe' pkgs.clang-tools "clangd")
|
||||
"-cli"
|
||||
(getExe pkgs.arduino-cli)
|
||||
"-cli-config"
|
||||
"$HOME/.arduino15/arduino-cli.yaml"
|
||||
]
|
||||
++ cfg.lsp.extraArgs;
|
||||
filetypes = ["arduino"];
|
||||
root_dir =
|
||||
mkLuaInline
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
function(bufnr, on_dir)
|
||||
local fname = vim.api.nvim_buf_get_name(bufnr)
|
||||
on_dir(util.root_pattern("*.ino")(fname))
|
||||
end
|
||||
'';
|
||||
capabilities = {
|
||||
textDocument = {
|
||||
semanticTokens = mkLuaInline "vim.NIL";
|
||||
};
|
||||
workspace = {
|
||||
semanticTokens = mkLuaInline "vim.NIL";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
in {
|
||||
options.vim.languages.arduino = {
|
||||
enable = mkEnableOption "Arduino support";
|
||||
|
||||
treesitter = {
|
||||
enable = mkEnableOption "Arduino treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||
package = mkGrammarOption pkgs "arduino";
|
||||
};
|
||||
|
||||
lsp = {
|
||||
enable = mkEnableOption "Arduino LSP support" // {default = config.vim.lsp.enable;};
|
||||
servers = mkOption {
|
||||
type = listOf (enum (attrNames servers));
|
||||
default = defaultServers;
|
||||
description = "Arduino LSP servers to use";
|
||||
};
|
||||
|
||||
extraArgs = mkOption {
|
||||
type = listOf str;
|
||||
default = [];
|
||||
description = "Extra arguments passed to the Arduino LSP";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf cfg.treesitter.enable {
|
||||
vim.treesitter.enable = true;
|
||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||
})
|
||||
|
||||
(mkIf cfg.lsp.enable {
|
||||
vim.lsp.servers =
|
||||
mapListToAttrs (n: {
|
||||
name = n;
|
||||
value = servers.${n};
|
||||
})
|
||||
cfg.lsp.servers;
|
||||
})
|
||||
]);
|
||||
}
|
||||
96
modules/plugins/languages/cmake.nix
Normal file
96
modules/plugins/languages/cmake.nix
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (builtins) attrNames;
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.types) enum listOf package;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
inherit (lib.nvim.types) mkGrammarOption;
|
||||
|
||||
cfg = config.vim.languages.cmake;
|
||||
|
||||
defaultServers = ["neocmakelsp"];
|
||||
servers = {
|
||||
neocmakelsp = {
|
||||
enable = true;
|
||||
cmd = [(getExe pkgs.neocmakelsp) "--stdio"];
|
||||
filetypes = ["cmake"];
|
||||
root_markers = [".gersemirc" ".git" "build" "cmake"];
|
||||
capabilities = {
|
||||
textDocument.completion.completionItem.snippetSupport = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
defaultFormat = "gersemi";
|
||||
formats = {
|
||||
gersemi = {
|
||||
package = pkgs.gersemi;
|
||||
};
|
||||
};
|
||||
in {
|
||||
options.vim.languages.cmake = {
|
||||
enable = mkEnableOption "CMake language support";
|
||||
|
||||
treesitter = {
|
||||
enable = mkEnableOption "CMake treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||
package = mkGrammarOption pkgs "cmake";
|
||||
};
|
||||
|
||||
lsp = {
|
||||
enable = mkEnableOption "CMake LSP support" // {default = config.vim.lsp.enable;};
|
||||
servers = mkOption {
|
||||
type = listOf (enum (attrNames servers));
|
||||
default = defaultServers;
|
||||
description = "CMake LSP servers to use";
|
||||
};
|
||||
};
|
||||
|
||||
format = {
|
||||
enable = mkEnableOption "CMake formatting" // {default = config.vim.languages.enableFormat;};
|
||||
|
||||
type = mkOption {
|
||||
description = "CMake formatter to use";
|
||||
type = enum (attrNames formats);
|
||||
default = defaultFormat;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
description = "CMake formatter package";
|
||||
type = package;
|
||||
default = formats.${cfg.format.type}.package;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf cfg.treesitter.enable {
|
||||
vim.treesitter.enable = true;
|
||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||
})
|
||||
|
||||
(mkIf cfg.lsp.enable {
|
||||
vim.lsp.servers =
|
||||
mapListToAttrs (n: {
|
||||
name = n;
|
||||
value = servers.${n};
|
||||
})
|
||||
cfg.lsp.servers;
|
||||
})
|
||||
|
||||
(mkIf cfg.format.enable {
|
||||
vim.formatter.conform-nvim = {
|
||||
enable = true;
|
||||
setupOpts.formatters_by_ft.cmake = [cfg.format.type];
|
||||
setupOpts.formatters.${cfg.format.type} = {
|
||||
command = getExe cfg.format.package;
|
||||
};
|
||||
};
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
inherit (lib.nvim.languages) mkEnable;
|
||||
in {
|
||||
imports = [
|
||||
./arduino.nix
|
||||
./asm.nix
|
||||
./astro.nix
|
||||
./bash.nix
|
||||
|
|
@ -10,10 +11,12 @@ in {
|
|||
./dart.nix
|
||||
./clang.nix
|
||||
./clojure.nix
|
||||
./cmake.nix
|
||||
./css.nix
|
||||
./elixir.nix
|
||||
./fsharp.nix
|
||||
./gleam.nix
|
||||
./glsl.nix
|
||||
./go.nix
|
||||
./hcl.nix
|
||||
./helm.nix
|
||||
|
|
|
|||
63
modules/plugins/languages/glsl.nix
Normal file
63
modules/plugins/languages/glsl.nix
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (builtins) attrNames;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.nvim.types) mkGrammarOption;
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.types) enum listOf;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
||||
cfg = config.vim.languages.glsl;
|
||||
|
||||
defaultServers = ["glsl_analyzer"];
|
||||
servers = {
|
||||
glsl_analyzer = {
|
||||
enable = true;
|
||||
cmd = [(getExe pkgs.glsl_analyzer)];
|
||||
filetypes = ["glsl" "vert" "tesc" "tese" "frag" "geom" "comp"];
|
||||
root_markers = [".git"];
|
||||
};
|
||||
};
|
||||
in {
|
||||
options.vim.languages.glsl = {
|
||||
enable = mkEnableOption "GLSL language support";
|
||||
|
||||
treesitter = {
|
||||
enable = mkEnableOption "GLSL treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||
package = mkGrammarOption pkgs "glsl";
|
||||
};
|
||||
|
||||
lsp = {
|
||||
enable = mkEnableOption "GLSL LSP support" // {default = config.vim.lsp.enable;};
|
||||
|
||||
servers = mkOption {
|
||||
type = listOf (enum (attrNames servers));
|
||||
default = defaultServers;
|
||||
description = "GLSL LSP server to use";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf cfg.treesitter.enable {
|
||||
vim.treesitter = {
|
||||
enable = true;
|
||||
grammars = [cfg.treesitter.package];
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf cfg.lsp.enable {
|
||||
vim.lsp.servers =
|
||||
mapListToAttrs (n: {
|
||||
name = n;
|
||||
value = servers.${n};
|
||||
})
|
||||
cfg.lsp.servers;
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
servers = {
|
||||
gopls = {
|
||||
cmd = [(getExe pkgs.gopls)];
|
||||
filetypes = ["go" "gomod" "gowork" "gotmpl"];
|
||||
filetypes = ["go" "gomod" "gosum" "gowork" "gotmpl"];
|
||||
root_dir = mkLuaInline ''
|
||||
function(bufnr, on_dir)
|
||||
local fname = vim.api.nvim_buf_get_name(bufnr)
|
||||
|
|
@ -170,7 +170,11 @@ in {
|
|||
treesitter = {
|
||||
enable = mkEnableOption "Go treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||
|
||||
package = mkGrammarOption pkgs "go";
|
||||
goPackage = mkGrammarOption pkgs "go";
|
||||
gomodPackage = mkGrammarOption pkgs "gomod";
|
||||
gosumPackage = mkGrammarOption pkgs "gosum";
|
||||
goworkPackage = mkGrammarOption pkgs "gowork";
|
||||
gotmplPackage = mkGrammarOption pkgs "gotmpl";
|
||||
};
|
||||
|
||||
lsp = {
|
||||
|
|
@ -232,7 +236,13 @@ in {
|
|||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf cfg.treesitter.enable {
|
||||
vim.treesitter.enable = true;
|
||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||
vim.treesitter.grammars = [
|
||||
cfg.treesitter.goPackage
|
||||
cfg.treesitter.gomodPackage
|
||||
cfg.treesitter.gosumPackage
|
||||
cfg.treesitter.goworkPackage
|
||||
cfg.treesitter.gotmplPackage
|
||||
];
|
||||
})
|
||||
|
||||
(mkIf cfg.lsp.enable {
|
||||
|
|
|
|||
|
|
@ -76,9 +76,14 @@ in {
|
|||
end
|
||||
})
|
||||
|
||||
local ft = require('Comment.ft')
|
||||
ft
|
||||
.set('hcl', '#%s')
|
||||
${
|
||||
if config.vim.comments.comment-nvim.enable
|
||||
then ''
|
||||
local ft = require('Comment.ft')
|
||||
ft.set('hcl', '#%s')
|
||||
''
|
||||
else ""
|
||||
}
|
||||
'';
|
||||
}
|
||||
(mkIf cfg.treesitter.enable {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
...
|
||||
}: let
|
||||
inherit (builtins) attrNames;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.meta) getExe getExe';
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.types) bool enum listOf str nullOr;
|
||||
|
|
@ -55,6 +55,14 @@
|
|||
prettierd = {
|
||||
command = getExe pkgs.prettierd;
|
||||
};
|
||||
mdformat = {
|
||||
command = getExe' (pkgs.python313Packages.python.withPackages (p:
|
||||
with p; [
|
||||
mdformat
|
||||
mdformat-gfm
|
||||
mdformat-frontmatter
|
||||
])) "mdformat";
|
||||
};
|
||||
};
|
||||
defaultDiagnosticsProvider = ["markdownlint-cli2"];
|
||||
diagnosticsProviders = {
|
||||
|
|
|
|||
|
|
@ -7,12 +7,15 @@
|
|||
inherit (builtins) attrNames;
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.types) enum;
|
||||
inherit (lib.types) enum package;
|
||||
inherit (lib.nvim.dag) entryAfter;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.nvim.types) mkGrammarOption deprecatedSingleOrListOf;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
||||
cfg = config.vim.languages.odin;
|
||||
|
||||
defaultServers = ["ols"];
|
||||
servers = {
|
||||
ols = {
|
||||
|
|
@ -32,7 +35,19 @@
|
|||
};
|
||||
};
|
||||
|
||||
cfg = config.vim.languages.odin;
|
||||
defaultDebugger = "codelldb";
|
||||
debuggers = {
|
||||
codelldb = {
|
||||
package = pkgs.lldb;
|
||||
dapConfig = ''
|
||||
dap.adapters.codelldb = {
|
||||
type = 'executable',
|
||||
command = '${cfg.dap.package}/bin/lldb-dap',
|
||||
name = 'codelldb'
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
in {
|
||||
options.vim.languages.odin = {
|
||||
enable = mkEnableOption "Odin language support";
|
||||
|
|
@ -51,6 +66,22 @@ in {
|
|||
description = "Odin LSP server to use";
|
||||
};
|
||||
};
|
||||
|
||||
dap = {
|
||||
enable = mkEnableOption "Enable Odin Debug Adapter" // {default = config.vim.languages.enableDAP;};
|
||||
|
||||
debugger = mkOption {
|
||||
description = "Odin debugger to use";
|
||||
type = enum (attrNames debuggers);
|
||||
default = defaultDebugger;
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
description = "Odin debugger package.";
|
||||
type = package;
|
||||
default = debuggers.${cfg.dap.debugger}.package;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
|
|
@ -67,5 +98,16 @@ in {
|
|||
})
|
||||
cfg.lsp.servers;
|
||||
})
|
||||
|
||||
(mkIf cfg.dap.enable {
|
||||
vim = {
|
||||
startPlugins = ["nvim-dap-odin"];
|
||||
debugger.nvim-dap.sources.odin-debugger = debuggers.${cfg.dap.debugger}.dapConfig;
|
||||
pluginRC.nvim-dap-odin = entryAfter ["nvim-dap"] ''
|
||||
require('nvim-dap-odin').setup()
|
||||
'';
|
||||
debugger.nvim-dap.enable = true;
|
||||
};
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.types) enum package bool;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
inherit (lib.nvim.types) deprecatedSingleOrListOf;
|
||||
inherit (lib.nvim.types) deprecatedSingleOrListOf diagnostics;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
inherit (lib.nvim.dag) entryBefore;
|
||||
inherit (lib.trivial) warn;
|
||||
|
|
@ -278,6 +278,14 @@
|
|||
'';
|
||||
};
|
||||
};
|
||||
defaultDiagnosticsProvider = ["mypy"];
|
||||
diagnosticsProviders = {
|
||||
mypy = {
|
||||
config = {
|
||||
cmd = getExe' pkgs.mypy "mypy";
|
||||
};
|
||||
};
|
||||
};
|
||||
in {
|
||||
options.vim.languages.python = {
|
||||
enable = mkEnableOption "Python language support";
|
||||
|
|
@ -335,6 +343,15 @@ in {
|
|||
'';
|
||||
};
|
||||
};
|
||||
|
||||
extraDiagnostics = {
|
||||
enable = mkEnableOption "extra Python diagnostics" // {default = config.vim.languages.enableExtraDiagnostics;};
|
||||
types = diagnostics {
|
||||
langDesc = "Python";
|
||||
inherit diagnosticsProviders;
|
||||
inherit defaultDiagnosticsProvider;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
|
|
@ -404,5 +421,15 @@ in {
|
|||
vim.debugger.nvim-dap.enable = true;
|
||||
vim.debugger.nvim-dap.sources.python-debugger = debuggers.${cfg.dap.debugger}.dapConfig;
|
||||
})
|
||||
|
||||
(mkIf cfg.extraDiagnostics.enable {
|
||||
vim.diagnostics.nvim-lint = {
|
||||
enable = true;
|
||||
linters_by_ft.python = cfg.extraDiagnostics.types;
|
||||
linters =
|
||||
mkMerge (map (name: {${name} = diagnosticsProviders.${name}.config;})
|
||||
cfg.extraDiagnostics.types);
|
||||
};
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,9 +11,47 @@
|
|||
in {
|
||||
config = mkIf (cfg.enable && cfg.harper-ls.enable) {
|
||||
vim.lsp.servers.harper-ls = {
|
||||
root_markers = [".git"];
|
||||
root_markers = [".git" ".harper-dictionary.txt"];
|
||||
cmd = [(getExe pkgs.harper) "--stdio"];
|
||||
settings = {harper-ls = cfg.harper-ls.settings;};
|
||||
filetypes =
|
||||
# <https://writewithharper.com/docs/integrations/language-server#Supported-Languages>
|
||||
[
|
||||
"asciidoc"
|
||||
"c"
|
||||
"clojure"
|
||||
"cmake"
|
||||
"cpp"
|
||||
"cs"
|
||||
"daml"
|
||||
"dart"
|
||||
"gitcommit"
|
||||
"go"
|
||||
"haskell"
|
||||
"html"
|
||||
"ink"
|
||||
"java"
|
||||
"javascript"
|
||||
"javascriptreact"
|
||||
"kotlin"
|
||||
"lhaskell"
|
||||
"lua"
|
||||
"mail"
|
||||
"markdown"
|
||||
"nix"
|
||||
"php"
|
||||
"python"
|
||||
"ruby"
|
||||
"rust"
|
||||
"scala"
|
||||
"sh"
|
||||
"swift"
|
||||
"text"
|
||||
"toml"
|
||||
"typescript"
|
||||
"typescriptreact"
|
||||
"typst"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1873,6 +1873,19 @@
|
|||
"url": "https://github.com/leoluz/nvim-dap-go/archive/b4421153ead5d726603b02743ea40cf26a51ed5f.tar.gz",
|
||||
"hash": "sha256-wg9kiW2eAMmg4bvgqaAS9kt7qaVsIWl36BNqRbhZIgo="
|
||||
},
|
||||
"nvim-dap-odin": {
|
||||
"type": "Git",
|
||||
"repository": {
|
||||
"type": "GitHub",
|
||||
"owner": "NANDquark",
|
||||
"repo": "nvim-dap-odin"
|
||||
},
|
||||
"branch": "main",
|
||||
"submodules": false,
|
||||
"revision": "4df40d467f4ea5195e2f3b813d970eb15172b052",
|
||||
"url": "https://github.com/NANDquark/nvim-dap-odin/archive/4df40d467f4ea5195e2f3b813d970eb15172b052.tar.gz",
|
||||
"hash": "sha256-/bW22gWrPamK4jDMJYDv/3od+vIUb/eYICnHWnv8MVU="
|
||||
},
|
||||
"nvim-dap-ui": {
|
||||
"type": "Git",
|
||||
"repository": {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue