diff --git a/flake.lock b/flake.lock index df4f2c4..f7fd3a4 100644 --- a/flake.lock +++ b/flake.lock @@ -43,11 +43,11 @@ ] }, "locked": { - "lastModified": 1715077503, - "narHash": "sha256-AfHQshzLQfUqk/efMtdebHaQHqVntCMjhymQzVFLes0=", + "lastModified": 1715930644, + "narHash": "sha256-W9pyM3/vePxrffHtzlJI6lDS3seANQ+Nqp+i58O46LI=", "owner": "nix-community", "repo": "home-manager", - "rev": "6e277d9566de9976f47228dd8c580b97488734d4", + "rev": "e3ad5108f54177e6520535768ddbf1e6af54b59d", "type": "github" }, "original": { @@ -63,11 +63,11 @@ "systems": "systems_2" }, "locked": { - "lastModified": 1714757169, - "narHash": "sha256-bLCxY5hFpnDzXnxwqSkc0GfOvb9PX+dsHCE99T6dDEM=", + "lastModified": 1716258470, + "narHash": "sha256-66C/T8xSpKE1W/FFpW43Gw5GfiSiM+vttTbM3SkJlBQ=", "owner": "lexical-lsp", "repo": "lexical", - "rev": "0234cbcb5a886ac74247bf326d1b9af6fae353cc", + "rev": "64ab159ff035346e66e4b7b26f52afb1120fc6a9", "type": "github" }, "original": { @@ -109,11 +109,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1715037484, - "narHash": "sha256-OUt8xQFmBU96Hmm4T9tOWTu4oCswCzoVl+pxSq/kiFc=", + "lastModified": 1716190602, + "narHash": "sha256-xYRimrR0duWvokWQEvB87bSsICeCvvX9DxpUOzCfsDE=", "owner": "nixos", "repo": "nixpkgs", - "rev": "ad7efee13e0d216bf29992311536fce1d3eefbef", + "rev": "5a5ac83292c7842072318f57d68a48474f8bd34d", "type": "github" }, "original": { diff --git a/home.nix b/home.nix index 75c76ac..e636eb6 100644 --- a/home.nix +++ b/home.nix @@ -78,6 +78,8 @@ pkgs.gopls # Go lsp pkgs.lexical # Elixir lsp pkgs.nodePackages.intelephense # PHP lsp + pkgs.nodePackages.typescript-language-server + pkgs.prettierd ]; }; diff --git a/nvim/lua/my/lsp.lua b/nvim/lua/my/lsp.lua index c658fcc..b651d64 100644 --- a/nvim/lua/my/lsp.lua +++ b/nvim/lua/my/lsp.lua @@ -1,14 +1,6 @@ local lspconfig = require "lspconfig" require "neodev".setup() -local root_dir -for dir in vim.fs.parents(vim.api.nvim_buf_get_name(0)) do - if vim.fn.isdirectory(dir .. "/.git") == 1 then - root_dir = dir - break - end -end - vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = "single" }) local capabilities = {} @@ -20,7 +12,12 @@ end local has_lsp_format, lsp_format = pcall(require, "lsp-format") if has_lsp_format then - lsp_format.setup() + lsp_format.setup { + typescript = { exclude = { "tsserver" } }, + javascript = { exclude = { "tsserver" } }, + typescriptreact = { exclude = { "tsserver" } }, + javascriptreact = { exclude = { "tsserver" } }, + } end local on_attach = function(client, bufnr) @@ -59,21 +56,12 @@ local on_attach = function(client, bufnr) end end -local function prettier_command() - if not root_dir then - return "prettier" - end - - if vim.fs.basename(root_dir .. "node_modules/prettier") then - return "npx prettier" - else - return "prettier" - end -end - local prettier = { - formatCommand = prettier_command() .. [[ --stdin-filepath ${INPUT} ${--tab-width:tab_width}]], + formatCommand = 'prettierd "${INPUT}"', formatStdin = true, + -- env = { + -- string.format('PRETTIERD_DEFAULT_CONFIG=%s', vim.fn.expand('~/.config/nvim/utils/linter-config/.prettierrc.json')), + -- }, } local eslint = { @@ -160,12 +148,7 @@ local servers = { cmd = { "lexical" }, }, gleam = {}, - tsserver = { - settings = { - documentFormatting = false, - }, - }, - -- psalm = {}, + tsserver = {}, intelephense = { settings = { intelephense = { diff --git a/nvim/lua/plugins/init.lua b/nvim/lua/plugins/init.lua index 91c77a0..e43ab37 100644 --- a/nvim/lua/plugins/init.lua +++ b/nvim/lua/plugins/init.lua @@ -41,7 +41,6 @@ return { version = '*', config = function() require "mini.statusline".setup() - require "mini.comment".setup() require "mini.bufremove".setup() end },