diff options
| author | github-actions <github-actions@github.com> | 2023-04-24 06:41:47 +0000 |
|---|---|---|
| committer | github-actions <github-actions@github.com> | 2023-04-24 06:41:47 +0000 |
| commit | 591d5038552c6cdf6cfc595bc351ccdbb8e62045 (patch) | |
| tree | 180a707fdbcee9cb96d6e073eaad19373092efd7 | |
| parent | feat: add custom elements language server support (#2570) (diff) | |
| download | nvim-lspconfig-591d5038552c6cdf6cfc595bc351ccdbb8e62045.tar nvim-lspconfig-591d5038552c6cdf6cfc595bc351ccdbb8e62045.tar.gz nvim-lspconfig-591d5038552c6cdf6cfc595bc351ccdbb8e62045.tar.bz2 nvim-lspconfig-591d5038552c6cdf6cfc595bc351ccdbb8e62045.tar.lz nvim-lspconfig-591d5038552c6cdf6cfc595bc351ccdbb8e62045.tar.xz nvim-lspconfig-591d5038552c6cdf6cfc595bc351ccdbb8e62045.tar.zst nvim-lspconfig-591d5038552c6cdf6cfc595bc351ccdbb8e62045.zip | |
docs: update server_configurations.md
skip-checks: true
| -rw-r--r-- | doc/server_configurations.md | 62 | ||||
| -rw-r--r-- | doc/server_configurations.txt | 62 |
2 files changed, 124 insertions, 0 deletions
diff --git a/doc/server_configurations.md b/doc/server_configurations.md index 5e99bbd2..3db907f6 100644 --- a/doc/server_configurations.md +++ b/doc/server_configurations.md @@ -37,6 +37,7 @@ autogenerated from the Lua files. You can view this file in Nvim by running - [cssls](#cssls) - [cssmodules_ls](#cssmodules_ls) - [cucumber_language_server](#cucumber_language_server) +- [custom_elements_ls](#custom_elements_ls) - [dafny](#dafny) - [dagger](#dagger) - [dartls](#dartls) @@ -1760,6 +1761,67 @@ require'lspconfig'.cucumber_language_server.setup{} ``` +## custom_elements_ls + +https://github.com/Matsuuu/custom-elements-language-server + +`custom-elements-languageserver` depends on `typescript`. Both packages can be installed via `npm`: +```sh +npm install -g typescript custom-elements-languageserver +``` +To configure typescript language server, add a +[`tsconfig.json`](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) or +[`jsconfig.json`](https://code.visualstudio.com/docs/languages/jsconfig) to the root of your +project. +Here's an example that disables type checking in JavaScript files. +```json +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "checkJs": false + }, + "exclude": [ + "node_modules" + ] +} + +The best way to utilize the Custom Elements Language Server is to enable the [Custom Elements Manifest](https://github.com/webcomponents/custom-elements-manifest)(CEM) in your project by installing +a CEM generator like one provided by [The Open WC Team](https://github.com/open-wc/custom-elements-manifest/tree/master/packages/analyzer). + +Generating a CEM in watch mode will provide you with the best user experience. If your dependencies ship with a Custom Elements Manifest, those will be utilized also. + +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.custom_elements_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "custom-elements-languageserver", "--stdio" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx", "html" } + ``` + - `init_options` : + ```lua + { + hostInfo = "neovim" + } + ``` + - `root_dir` : + ```lua + root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git") + ``` + + ## dafny Support for the Dafny language server. diff --git a/doc/server_configurations.txt b/doc/server_configurations.txt index 5e99bbd2..3db907f6 100644 --- a/doc/server_configurations.txt +++ b/doc/server_configurations.txt @@ -37,6 +37,7 @@ autogenerated from the Lua files. You can view this file in Nvim by running - [cssls](#cssls) - [cssmodules_ls](#cssmodules_ls) - [cucumber_language_server](#cucumber_language_server) +- [custom_elements_ls](#custom_elements_ls) - [dafny](#dafny) - [dagger](#dagger) - [dartls](#dartls) @@ -1760,6 +1761,67 @@ require'lspconfig'.cucumber_language_server.setup{} ``` +## custom_elements_ls + +https://github.com/Matsuuu/custom-elements-language-server + +`custom-elements-languageserver` depends on `typescript`. Both packages can be installed via `npm`: +```sh +npm install -g typescript custom-elements-languageserver +``` +To configure typescript language server, add a +[`tsconfig.json`](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) or +[`jsconfig.json`](https://code.visualstudio.com/docs/languages/jsconfig) to the root of your +project. +Here's an example that disables type checking in JavaScript files. +```json +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "checkJs": false + }, + "exclude": [ + "node_modules" + ] +} + +The best way to utilize the Custom Elements Language Server is to enable the [Custom Elements Manifest](https://github.com/webcomponents/custom-elements-manifest)(CEM) in your project by installing +a CEM generator like one provided by [The Open WC Team](https://github.com/open-wc/custom-elements-manifest/tree/master/packages/analyzer). + +Generating a CEM in watch mode will provide you with the best user experience. If your dependencies ship with a Custom Elements Manifest, those will be utilized also. + +``` + + + +**Snippet to enable the language server:** +```lua +require'lspconfig'.custom_elements_ls.setup{} +``` + + +**Default values:** + - `cmd` : + ```lua + { "custom-elements-languageserver", "--stdio" } + ``` + - `filetypes` : + ```lua + { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx", "html" } + ``` + - `init_options` : + ```lua + { + hostInfo = "neovim" + } + ``` + - `root_dir` : + ```lua + root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git") + ``` + + ## dafny Support for the Dafny language server. |
