mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-01-15 15:07:48 +00:00
Merge f528a7a552 into ceaae0eb2e
This commit is contained in:
commit
a1b3fc04f9
2 changed files with 65 additions and 6 deletions
|
|
@ -36,3 +36,16 @@
|
||||||
[Libadoxon](https://github.com/Libadoxon):
|
[Libadoxon](https://github.com/Libadoxon):
|
||||||
|
|
||||||
- `toggleterm` open map now also works when in terminal mode
|
- `toggleterm` open map now also works when in terminal mode
|
||||||
|
|
||||||
|
[sumrdev](https://github.com/sumrdev):
|
||||||
|
|
||||||
|
- Added `vtsls` typescript language server with vue integration
|
||||||
|
- Add with
|
||||||
|
`nix
|
||||||
|
vim.languages.ts = {
|
||||||
|
enable = true;
|
||||||
|
extraVueSupport = true;
|
||||||
|
lsp = {
|
||||||
|
servers = ["vtsls"];
|
||||||
|
};
|
||||||
|
};`
|
||||||
|
|
|
||||||
|
|
@ -66,8 +66,50 @@
|
||||||
end
|
end
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
vtsls = {
|
||||||
|
cmd = [(getExe pkgs.vtsls) "--stdio"];
|
||||||
|
filetypes = [
|
||||||
|
"javascript"
|
||||||
|
"javascriptreact"
|
||||||
|
"javascript.jsx"
|
||||||
|
"typescript"
|
||||||
|
"typescriptreact"
|
||||||
|
"typescript.tsx"
|
||||||
|
"vue"
|
||||||
|
];
|
||||||
|
root_markers = ["tsconfig.json" "jsconfig.json" "package.json" ".git"];
|
||||||
|
settings = {
|
||||||
|
typescript = {
|
||||||
|
updateImportsOnFileMove.enabled = "always";
|
||||||
|
tsserver.maxTsServerMemory = 8192;
|
||||||
|
};
|
||||||
|
vtsls = {
|
||||||
|
enableMoveToFileCodeAction = true;
|
||||||
|
experimental.completion.enableServerSideFuzzyMatch = true;
|
||||||
|
enableTakeOverMode = true;
|
||||||
|
tsserver.globalPlugins = [
|
||||||
|
{
|
||||||
|
name = "@vue/typescript-plugin";
|
||||||
|
location = "${lib.getBin pkgs.vue-language-server}/lib/language-tools/packages/language-server";
|
||||||
|
languages = ["vue"];
|
||||||
|
configNamespace = "typescript";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
on_attach = mkLuaInline ''
|
||||||
|
function(client, bufnr)
|
||||||
|
-- Disable semantic tokens for Vue files to prevent highlighting conflicts
|
||||||
|
if vim.bo[bufnr].filetype == 'vue' then
|
||||||
|
client.server_capabilities.semanticTokensProvider = nil
|
||||||
|
else
|
||||||
|
client.server_capabilities.semanticTokensProvider.full = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
};
|
||||||
in {
|
in {
|
||||||
inherit ts_ls;
|
inherit ts_ls vtsls;
|
||||||
# Here for backwards compatibility. Still consider tsserver a valid
|
# Here for backwards compatibility. Still consider tsserver a valid
|
||||||
# configuration in the enum, but assert if it's set to *properly*
|
# configuration in the enum, but assert if it's set to *properly*
|
||||||
# redirect the user to the correct server.
|
# redirect the user to the correct server.
|
||||||
|
|
@ -213,12 +255,14 @@ in {
|
||||||
_file = ./ts.nix;
|
_file = ./ts.nix;
|
||||||
options.vim.languages.ts = {
|
options.vim.languages.ts = {
|
||||||
enable = mkEnableOption "Typescript/Javascript language support";
|
enable = mkEnableOption "Typescript/Javascript language support";
|
||||||
|
extraVueSupport = mkEnableOption "Vue support for vtsls";
|
||||||
|
|
||||||
treesitter = {
|
treesitter = {
|
||||||
enable = mkEnableOption "Typescript/Javascript treesitter" // {default = config.vim.languages.enableTreesitter;};
|
enable = mkEnableOption "Typescript/Javascript treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||||
tsPackage = mkGrammarOption pkgs "typescript";
|
tsPackage = mkGrammarOption pkgs "typescript";
|
||||||
tsxPackage = mkGrammarOption pkgs "tsx";
|
tsxPackage = mkGrammarOption pkgs "tsx";
|
||||||
jsPackage = mkGrammarOption pkgs "javascript";
|
jsPackage = mkGrammarOption pkgs "javascript";
|
||||||
|
vuePackage = mkGrammarOption pkgs "vue";
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
|
|
@ -275,11 +319,13 @@ in {
|
||||||
config = mkIf cfg.enable (mkMerge [
|
config = mkIf cfg.enable (mkMerge [
|
||||||
(mkIf cfg.treesitter.enable {
|
(mkIf cfg.treesitter.enable {
|
||||||
vim.treesitter.enable = true;
|
vim.treesitter.enable = true;
|
||||||
vim.treesitter.grammars = [
|
vim.treesitter.grammars =
|
||||||
cfg.treesitter.tsPackage
|
[
|
||||||
cfg.treesitter.tsxPackage
|
cfg.treesitter.tsPackage
|
||||||
cfg.treesitter.jsPackage
|
cfg.treesitter.tsxPackage
|
||||||
];
|
cfg.treesitter.jsPackage
|
||||||
|
]
|
||||||
|
++ lib.optional cfg.extraVueSupport cfg.treesitter.vuePackage;
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.lsp.enable {
|
(mkIf cfg.lsp.enable {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue