summaryrefslogtreecommitdiff
path: root/docs/getting_started
diff options
context:
space:
mode:
authorValentin Anger <syrupthinker@gryphno.de>2020-12-10 22:34:54 +0100
committerGitHub <noreply@github.com>2020-12-10 22:34:54 +0100
commita54ede099d58e8783c6511ff351aefba160b39d9 (patch)
tree1a2a08486e253c63a756b3a629b5647f2abdb24f /docs/getting_started
parentb8bc24d167f2e19482d9dc6d367876c361abf4ea (diff)
docs(tools): add documentation for the deno lsp command (#8676)
Co-authored-by: Yuki Tanaka <uki00a@gmail.com>
Diffstat (limited to 'docs/getting_started')
-rw-r--r--docs/getting_started/setup_your_environment.md44
1 files changed, 44 insertions, 0 deletions
diff --git a/docs/getting_started/setup_your_environment.md b/docs/getting_started/setup_your_environment.md
index 0e31cd914..51f29ab9a 100644
--- a/docs/getting_started/setup_your_environment.md
+++ b/docs/getting_started/setup_your_environment.md
@@ -144,6 +144,50 @@ project (`npm init -y` as necessary), then add the following block to your
}
```
+#### LSP clients
+
+Deno has builtin support for the
+[Language server protocol](https://langserver.org).
+
+If your editor supports the LSP, you can use Deno as a language server for
+TypeScript and JavaScript.
+
+The editor can start the server with `deno lsp`.
+
+##### Example for Kakoune
+
+After installing the [`kak-lsp`](https://github.com/kak-lsp/kak-lsp) LSP client
+you can add the Deno language server by adding the following to your
+`kak-lsp.toml`
+
+```toml
+[language.deno]
+filetypes = ["typescript", "javascript"]
+roots = [".git"]
+command = "deno"
+args = ["lsp"]
+```
+
If you don't see your favorite IDE on this list, maybe you can develop an
extension. Our [community Discord group](https://discord.gg/deno) can give you
some pointers on where to get started.
+
+##### Example for Vim/Neovim
+
+After installing the [`vim-lsp`](https://github.com/prabirshrestha/vim-lsp) LSP
+client you can add the Deno language server by adding the following to your
+`vimrc`/`init.vim`:
+
+```vim
+if executable("deno")
+ augroup LspTypeScript
+ autocmd!
+ autocmd User lsp_setup call lsp#register_server({
+ \ "name": "deno lsp",
+ \ "cmd": {server_info -> ["deno", "lsp"]},
+ \ "root_uri": {server_info->lsp#utils#path_to_uri(lsp#utils#find_nearest_parent_file_directory(lsp#utils#get_buffer_path(), "tsconfig.json"))},
+ \ "whitelist": ["typescript", "typescript.tsx"],
+ \ })
+ augroup END
+endif
+```