fix(nvim): load web LSPs properly
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-12-22 14:49:17 -05:00
parent 596f6a22f6
commit a473fb7412

View file

@ -20,11 +20,11 @@ in {
extraLuaConfig = extraLuaConfig =
# lua # lua
'' ''
vim.api.nvim_create_autocmd('FileType', { local lsp = require('lspconfig');
pattern = { 'javascript', 'javascriptreact', 'javascript.jsx', 'typescript', 'typescriptreact', 'typescript.tsx', 'css', 'scss' }, local tsserver = require('typescript-tools');
local default_capabilities = require('cmp_nvim_lsp').default_capabilities();
callback = function() local loadDevShell = function()
vim.cmd[[setlocal ts=4 sw=4 sts=0 expandtab]];
if (devShells['web'] == nil) then if (devShells['web'] == nil) then
devShells['web'] = 1; devShells['web'] = 1;
@ -33,6 +33,15 @@ in {
vim.cmd[[LspStart]]; vim.cmd[[LspStart]];
end); end);
end end
end;
vim.api.nvim_create_autocmd('FileType', {
pattern = { 'javascript', 'javascriptreact', 'javascript.jsx', 'typescript', 'typescriptreact', 'typescript.tsx', 'css', 'scss' },
callback = function()
vim.cmd[[setlocal ts=4 sw=4 sts=0 expandtab]];
loadDevShell();
end, end,
}); });
@ -42,13 +51,7 @@ in {
callback = function() callback = function()
vim.cmd[[setlocal ts=4 sw=4 expandtab]]; vim.cmd[[setlocal ts=4 sw=4 expandtab]];
if (devShells['web'] == nil) then loadDevShell();
devShells['web'] = 1;
require('nix-develop').nix_develop({'${flakeEnv}#web'}, function()
vim.cmd[[LspStart]];
end);
end
end, end,
}); });
@ -57,10 +60,6 @@ in {
command = 'setlocal iskeyword+=@-@', command = 'setlocal iskeyword+=@-@',
}); });
local lsp = require('lspconfig');
local tsserver = require('typescript-tools');
local default_capabilities = require('cmp_nvim_lsp').default_capabilities();
tsserver.setup({ tsserver.setup({
capabilities = default_capabilities, capabilities = default_capabilities,
autostart = false, autostart = false,