Personal Nix setup

Add flow language server

Changed files
+16 -1
modules
+1 -1
modules/nvim/default.nix
···
cssls = '${pkgs.vscode-langservers-extracted}/bin/vscode-css-language-server',
htmlls = '${pkgs.vscode-langservers-extracted}/bin/vscode-html-language-server',
jsonls = '${pkgs.vscode-langservers-extracted}/bin/vscode-json-language-server',
-
+
npx = '${pkgs.nodejs-18_x}/bin/npx',
ripgrep = '${pkgs.ripgrep}/bin/rg',
astrols = '${pkgs.nodePackages."@astrojs/language-server"}/bin/astro-ls',
rustanalyzer = '${pkgs.rust-analyzer}/bin/rust-analyzer',
+15
modules/nvim/init.lua
···
-- lspconfig
local lsp = require('lspconfig')
+
local lsp_util = require('lspconfig.util')
local function lsp_on_attach(client, buf)
if client.config.flags then
···
lsp_setup('tsserver', {
cmd = { nix_bins.tsserver, "--stdio" },
flags = { debounce_text_changes = 200 },
+
single_file_support = false,
settings = {
disableAutomaticTypingAcquisition = true,
preferences = {
importModuleSpecifierPreference = 'project-relative',
},
},
+
root_dir = function(fname)
+
if lsp_util.root_pattern('.flowconfig')(fname) ~= nil then
+
return nil
+
else
+
return lsp_util.root_pattern('tsconfig.json', 'package.json', 'jsconfig.json', '.git')(fname)
+
end
+
end,
+
})
+
+
lsp_setup('flow', {
+
cmd = { nix_bins.npx, "--no-install", "flow", "lsp" },
+
flags = { debounce_text_changes = 200 },
+
single_file_support = false,
})
lsp_setup('eslint', {