Skip to content

Commit

Permalink
languages/typescript: prevent ts_ls from formatting (#495)
Browse files Browse the repository at this point in the history
* ts_ls: prevent from formatting

prevent ts_ls from touching the formating.

ts formatting: remove useless indent

* fix unnecessary whitespace

---------

Co-authored-by: raf <[email protected]>
  • Loading branch information
Vagahbond and NotAShelf authored Dec 20, 2024
1 parent e715463 commit 99a4eaf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions modules/plugins/languages/ts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@
package = pkgs.typescript-language-server;
lspConfig = ''
lspconfig.ts_ls.setup {
capabilities = capabilities;
on_attach = attach_keymaps,
capabilities = capabilities,
on_attach = function(client, bufnr)
attach_keymaps(client, bufnr);
client.server_capabilities.documentFormattingProvider = false;
end,
cmd = ${
if isList cfg.lsp.package
then expToLua cfg.lsp.package
Expand Down Expand Up @@ -79,6 +82,7 @@
ls_sources,
null_ls.builtins.formatting.prettier.with({
command = "${cfg.format.package}/bin/prettier",
filetypes = { "typescript" },
})
)
'';
Expand Down

0 comments on commit 99a4eaf

Please sign in to comment.