mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-02-24 12:28:32 +00:00
kotlin: cleanup
This commit is contained in:
parent
c5235ae8fb
commit
c90f6659cb
1 changed files with 0 additions and 46 deletions
|
@ -31,31 +31,6 @@
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
defaultFormat = "ktlint";
|
|
||||||
formats = {
|
|
||||||
ktlint = {
|
|
||||||
package = pkgs.ktlint;
|
|
||||||
nullConfig = ''
|
|
||||||
table.insert(
|
|
||||||
ls_sources,
|
|
||||||
null_ls.builtins.formatting.ktlint.with({
|
|
||||||
command = "${cfg.format.package}/bin/ktlint",
|
|
||||||
})
|
|
||||||
)
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
ktfmt = {
|
|
||||||
package = pkgs.ktfmt;
|
|
||||||
nullConfig = ''
|
|
||||||
table.insert(
|
|
||||||
ls_sources,
|
|
||||||
null_ls.builtins.formatting.ktlint.with({
|
|
||||||
command = "${cfg.format.package}/bin/ktfmt",
|
|
||||||
})
|
|
||||||
)
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
defaultDiagnosticsProvider = ["ktlint"];
|
defaultDiagnosticsProvider = ["ktlint"];
|
||||||
diagnosticsProviders = {
|
diagnosticsProviders = {
|
||||||
ktlint = {
|
ktlint = {
|
||||||
|
@ -89,22 +64,6 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
format = {
|
|
||||||
enable = mkEnableOption "Kotlin document formatting" // {default = config.vim.languages.enableFormat;};
|
|
||||||
|
|
||||||
type = mkOption {
|
|
||||||
description = "Kotlin formatter to use";
|
|
||||||
type = enum (attrNames formats);
|
|
||||||
default = defaultFormat;
|
|
||||||
};
|
|
||||||
|
|
||||||
package = mkOption {
|
|
||||||
description = "Kotlin formatter package";
|
|
||||||
type = package;
|
|
||||||
default = formats.${cfg.format.type}.package;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
extraDiagnostics = {
|
extraDiagnostics = {
|
||||||
enable = mkEnableOption "extra Kotlin diagnostics" // {default = config.vim.languages.enableExtraDiagnostics;};
|
enable = mkEnableOption "extra Kotlin diagnostics" // {default = config.vim.languages.enableExtraDiagnostics;};
|
||||||
|
|
||||||
|
@ -121,11 +80,6 @@ in {
|
||||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||||
})
|
})
|
||||||
|
|
||||||
# (mkIf cfg.format.enable {
|
|
||||||
# vim.lsp.null-ls.enable = true;
|
|
||||||
# vim.lsp.null-ls.sources.kotlin-format = formats.${cfg.format.type}.nullConfig;
|
|
||||||
# })
|
|
||||||
|
|
||||||
(mkIf cfg.extraDiagnostics.enable {
|
(mkIf cfg.extraDiagnostics.enable {
|
||||||
vim.lsp.null-ls.enable = true;
|
vim.lsp.null-ls.enable = true;
|
||||||
vim.lsp.null-ls.sources = diagnosticsToLua {
|
vim.lsp.null-ls.sources = diagnosticsToLua {
|
||||||
|
|
Loading…
Add table
Reference in a new issue