mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +02:00
plugins/clangd-extensions: adapt to new lsp module
Adapt warnings, default settings, and tests to the new lsp module. Also change the previous warning, which I think should target the clangd server directly, and just not `plugins.lsp`, since the clangd server is necessary for clangd-extensions to function.
This commit is contained in:
parent
3f180f35b8
commit
8b3107ad6f
2 changed files with 26 additions and 8 deletions
|
@ -76,18 +76,27 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
||||||
|
|
||||||
extraConfig = cfg: {
|
extraConfig = cfg: {
|
||||||
warnings = lib.nixvim.mkWarnings "plugins.clangd-extensions" {
|
warnings = lib.nixvim.mkWarnings "plugins.clangd-extensions" {
|
||||||
when = !config.plugins.lsp.enable;
|
when = !(config.plugins.lsp.enable || config.lsp.servers.clangd.enable);
|
||||||
|
|
||||||
message = ''
|
message = ''
|
||||||
You have enabled `clangd-extensions` but not the lsp (`plugins.lsp`).
|
You have enabled `clangd-extensions` but not the lsp (`plugins.lsp` or `lsp.servers.clangd`).
|
||||||
You should set `plugins.lsp.enable = true` to make use of the clangd-extensions' features.
|
You should set `plugins.lsp.enable = true` or `lsp.servers.clangd.enable = true` to make use of the clangd-extensions' features.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
lsp = {
|
||||||
|
servers.clangd = {
|
||||||
|
settings = lib.mkIf cfg.enableOffsetEncodingWorkaround {
|
||||||
|
capabilities = {
|
||||||
|
offsetEncoding = [ "utf-16" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
plugins.lsp = {
|
plugins.lsp = {
|
||||||
servers.clangd = {
|
servers.clangd = {
|
||||||
enable = lib.mkDefault true;
|
enable = lib.mkDefault true;
|
||||||
|
|
||||||
extraOptions = lib.mkIf cfg.enableOffsetEncodingWorkaround {
|
extraOptions = lib.mkIf cfg.enableOffsetEncodingWorkaround {
|
||||||
capabilities.__raw = ''
|
capabilities.__raw = ''
|
||||||
vim.tbl_deep_extend(
|
vim.tbl_deep_extend(
|
||||||
|
|
|
@ -1,15 +1,16 @@
|
||||||
{
|
{
|
||||||
empty = {
|
empty = {
|
||||||
|
lsp.servers.clangd.enable = true;
|
||||||
|
|
||||||
plugins = {
|
plugins = {
|
||||||
lsp.enable = true;
|
|
||||||
clangd-extensions.enable = true;
|
clangd-extensions.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
default = {
|
default = {
|
||||||
plugins = {
|
lsp.servers.clangd.enable = true;
|
||||||
lsp.enable = true;
|
|
||||||
|
|
||||||
|
plugins = {
|
||||||
clangd-extensions = {
|
clangd-extensions = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
@ -50,8 +51,9 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
example = {
|
example = {
|
||||||
|
lsp.servers.clangd.enable = true;
|
||||||
|
|
||||||
plugins = {
|
plugins = {
|
||||||
lsp.enable = true;
|
|
||||||
clangd-extensions = {
|
clangd-extensions = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
@ -70,4 +72,11 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
emptyOld = {
|
||||||
|
plugins = {
|
||||||
|
lsp.enable = true;
|
||||||
|
clangd-extensions.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue