mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-10-03 07:23:30 +00:00
Fix yaml-language-server and helm-ls integration (#1125)
* lib/languages: fix typo in server submodule Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I6a6a6964c495ef58a9572ae93715bacf694a6ff5 * wrapper/build: add option examples; put evaluated values in `literalExpression` Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I6a6a69648220a65886994d4cac67f634a61815d5 * languages/yaml: fix on_attach by using mkLuaInline * languages/helm: fix yaml-language-server integration * language/yaml: call default_on_attach in helm version --------- Signed-off-by: NotAShelf <raf@notashelf.dev> Co-authored-by: raf <raf@notashelf.dev>
This commit is contained in:
commit
6447bdf013
3 changed files with 18 additions and 9 deletions
|
@ -289,6 +289,10 @@
|
||||||
- Fix [blink.cmp] breaking when built-in sources were modified.
|
- Fix [blink.cmp] breaking when built-in sources were modified.
|
||||||
- Fix [conform.nvim] not allowing disabling formatting on and after save. Use
|
- Fix [conform.nvim] not allowing disabling formatting on and after save. Use
|
||||||
`null` value to disable them if conform is enabled.
|
`null` value to disable them if conform is enabled.
|
||||||
|
- Fix Helm-YAML language module integration. YAML diagnostics will now remain in
|
||||||
|
`helmfile`s when both are enabled.
|
||||||
|
- Fix YAML language module not activating LSP keybinds if the Helm language
|
||||||
|
module was also enabled.
|
||||||
|
|
||||||
[TheColorman](https://github.com/TheColorman):
|
[TheColorman](https://github.com/TheColorman):
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) attrNames head;
|
inherit (builtins) attrNames head;
|
||||||
inherit (lib.options) mkEnableOption mkOption;
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkDefault mkIf mkMerge;
|
||||||
inherit (lib.meta) getExe;
|
inherit (lib.meta) getExe;
|
||||||
inherit (lib.types) enum;
|
inherit (lib.types) enum;
|
||||||
inherit (lib.nvim.types) mkGrammarOption singleOrListOf;
|
inherit (lib.nvim.types) mkGrammarOption singleOrListOf;
|
||||||
|
@ -27,11 +27,13 @@
|
||||||
dynamicRegistration = true;
|
dynamicRegistration = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
settings = {
|
settings = mkIf (yamlCfg.enable && yamlCfg.lsp.enable) {
|
||||||
helm-ls = {
|
helm-ls = {
|
||||||
yamlls = {
|
yamlls = {
|
||||||
# TODO: Determine if this is a good enough solution
|
# Without this being enabled, the YAML language module will look broken in helmfiles
|
||||||
path = (head yamlCfg.lsp.servers).cmd;
|
# if both modules are enabled at once.
|
||||||
|
enabled = mkDefault yamlCfg.lsp.enable;
|
||||||
|
path = head config.vim.lsp.servers.${head yamlCfg.lsp.servers}.cmd;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) attrNames;
|
inherit (builtins) attrNames;
|
||||||
|
inherit (lib.generators) mkLuaInline;
|
||||||
inherit (lib.options) mkEnableOption mkOption;
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.meta) getExe;
|
inherit (lib.meta) getExe;
|
||||||
|
@ -14,16 +15,18 @@
|
||||||
|
|
||||||
cfg = config.vim.languages.yaml;
|
cfg = config.vim.languages.yaml;
|
||||||
|
|
||||||
onAttach =
|
on_attach = mkLuaInline (
|
||||||
if config.vim.languages.helm.lsp.enable
|
if config.vim.languages.helm.lsp.enable && config.vim.languages.helm.enable
|
||||||
then ''
|
then ''
|
||||||
on_attach = function(client, bufnr)
|
function(client, bufnr)
|
||||||
|
default_on_attach()
|
||||||
local filetype = vim.bo[bufnr].filetype
|
local filetype = vim.bo[bufnr].filetype
|
||||||
if filetype == "helm" then
|
if filetype == "helm" then
|
||||||
client.stop()
|
client.stop()
|
||||||
end
|
end
|
||||||
end''
|
end''
|
||||||
else "on_attach = default_on_attach";
|
else "default_on_attach"
|
||||||
|
);
|
||||||
|
|
||||||
defaultServers = ["yaml-language-server"];
|
defaultServers = ["yaml-language-server"];
|
||||||
servers = {
|
servers = {
|
||||||
|
@ -32,7 +35,7 @@
|
||||||
cmd = [(getExe pkgs.yaml-language-server) "--stdio"];
|
cmd = [(getExe pkgs.yaml-language-server) "--stdio"];
|
||||||
filetypes = ["yaml" "yaml.docker-compose" "yaml.gitlab" "yaml.helm-values"];
|
filetypes = ["yaml" "yaml.docker-compose" "yaml.gitlab" "yaml.helm-values"];
|
||||||
root_markers = [".git"];
|
root_markers = [".git"];
|
||||||
on_attach = onAttach;
|
inherit on_attach;
|
||||||
# -- https://github.com/redhat-developer/vscode-redhat-telemetry#how-to-disable-telemetry-reporting
|
# -- https://github.com/redhat-developer/vscode-redhat-telemetry#how-to-disable-telemetry-reporting
|
||||||
settings = {
|
settings = {
|
||||||
redhat = {
|
redhat = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue