1
0
Fork 0

Compare commits

...

2 commits

Author SHA1 Message Date
b4ee9d0b8a
Replace ts_ls with typescript-tools 2025-07-02 06:29:17 +00:00
242dccba12
Change how diagnostic signs are defined in Neovim 2025-07-02 06:29:03 +00:00

View file

@ -4,17 +4,14 @@
enable = true;
keymaps.lspBuf."<leader>ca" = "code_action";
luaConfig.post = ''
local signs = {
Error = "",
Warn = "",
Hint = "",
Info = ""
}
for type, icon in pairs(signs) do
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, {text = icon, texthl = hl, numhl = hl})
end
vim.diagnostic.config({
signs = {
Error = "",
Warn = "",
Hint = "",
Info = ""
}
});
'';
servers = {
cssls.enable = true;
@ -22,7 +19,6 @@
jdtls.enable = true;
nil_ls.enable = true;
pyright.enable = true;
ts_ls.enable = true;
rust_analyzer = {
enable = true;
installCargo = false;
@ -31,14 +27,44 @@
svelte.enable = true;
volar = {
enable = true;
tslsIntegration = true;
# extraOptions.init_options.vue.hybridMode = false;
extraOptions.on_init.__raw = ''
function(client)
client.handlers['tsserver/request'] = function(_, result, context)
local clients = vim.lsp.get_clients({ bufnr = context.bufnr, name = 'vtsls' })
if #clients == 0 then
vim.notify('Could not found `vtsls` lsp client, vue_lsp would not work without it.', vim.log.levels.ERROR)
return
end
local ts_client = clients[1]
local param = unpack(result)
local id, command, payload = unpack(param)
ts_client:exec_cmd({
command = 'typescript.tsserverRequest',
arguments = {
command,
payload,
},
}, { bufnr = context.bufnr }, function(_, r)
local response_data = { { id, r.body } }
---@diagnostic disable-next-line: param-type-mismatch
client:notify('tsserver/response', response_data)
end)
end
end,
'';
};
};
};
typescript-tools = {
enable = true;
settings = {
filetypes = [ "javascript" "typescript" "vue" ];
settings = {
single_file_support = false;
tsserver_plugins = [ "@vue/typescript-plugin" ];
};
};
};
# nvim-jdtls = {
# enable = true;
# data = "~/.cache/jdtls/workspace";
# };
};
}