Skip to content

Instantly share code, notes, and snippets.

@jbr
Created May 2, 2022 19:47
Show Gist options
  • Save jbr/5e61e52fd4efd2446a0e88c0881580c1 to your computer and use it in GitHub Desktop.
Save jbr/5e61e52fd4efd2446a0e88c0881580c1 to your computer and use it in GitHub Desktop.
how to use emacs-lsp's deno lsp server instead of ts-ls

How to use emacs-lsp's deno lsp server instead of ts-ls, the typescript language server

It was surprisingly difficult to find this documented exactly anywhere on the internet, so I thought I'd post this somewhere so the next person googling for it has a chance of finding it. The lsp docs just say to "create a dir-local for each of the projects" but provides no guidance on how to do that.

Place a file named .dir-locals.el in your deno project root, containing exactly the following elisp:

((typescript-mode . ((lsp-disabled-clients . (ts-ls)))))

This disables the ts-ls backend, which selects lsp-deno as the next viable lsp client/server.

@jberkenbilt
Copy link

This is helpful. Thanks. It's amazing what knowledge is just assumed.

@hhirsch
Copy link

hhirsch commented Aug 18, 2025

Even with that file it still uses ts-ls for me.
Had to add (setq lsp-disabled-clients '(ts-ls)) to my emacs config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment