mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 18:31:35 +00:00
fix(languages/yaml): use mkLuaInline for on_attach
This commit is contained in:
parent
cf58d88545
commit
8da8accdf4
1 changed files with 7 additions and 5 deletions
|
@ -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,17 @@
|
||||||
|
|
||||||
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)
|
||||||
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 +34,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