diff --git a/adev/src/content/tools/language-service.md b/adev/src/content/tools/language-service.md index 5b99eb5b298..6c022c21e6a 100644 --- a/adev/src/content/tools/language-service.md +++ b/adev/src/content/tools/language-service.md @@ -131,7 +131,42 @@ Either directly install the "Eclipse IDE for Web and JavaScript developers" pack ### Neovim -Angular language service can be used with Neovim by using the [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig) plugin. +#### Conquer of Completion with Node.js + +The Angular Language Service uses the tsserver, which doesn't follow the LSP specifications exactly. Therefore if you are using neovim or vim with JavaScript or TypeScript or Angular you may find that [Conquer of Completion](https://github.com/neoclide/coc.nvim) (COC) has the fullest implementation of the Angular Language Service and the tsserver. This is because COC ports the VSCode implementation of the tsserver which accommodates the tsserver's implementation. + +1. [Setup coc.nvim](https://github.com/neoclide/coc.nvim) + +2. Configure the Angular Language Service + + Once installed run the `CocConfig` vim command line command to open the config file `coc-settings.json` and add the angular property. + + Make sure to substitute the correct paths to your global `node_modules` such that they go to directories which contain `tsserver` and the `ngserver` respectively. + + + { + "languageserver": { + "angular": { + "command": "ngserver", + "args": [ + "--stdio", + "--tsProbeLocations", + "/usr/local/lib/node_modules/typescript/lib/CHANGE/THIS/TO/YOUR/GLOBAL/NODE_MODULES", + "--ngProbeLocations", + "/usr/local/lib/node_modules/@angular/language-server/bin/CHANGE/THIS/TO/YOUR/GLOBAL/NODE_MODULES" + ], + "filetypes": ["ts", "typescript", "html"], + "trace.server.verbosity": "verbose" + } + } + } + + +HELPFUL: `/usr/local/lib/node_modules/typescript/lib` and `/usr/local/lib/node_modules/@angular/language-server/bin` above should point to the location of your global node modules, which may be different. + + +#### Built In Neovim LSP +Angular Language Service can be used with Neovim by using the [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig) plugin. 1. [Install nvim-lspconfig](https://github.com/neovim/nvim-lspconfig?tab=readme-ov-file#install) @@ -155,4 +190,4 @@ The Angular Language Services then looks at `data.---` within its context, asks ## More information * For more in-depth information on the implementation, see the [Angular Language Service source](https://github.com/angular/angular/blob/main/packages/language-service/src) -* For more on the design considerations and intentions, see [design documentation here](https://github.com/angular/vscode-ng-language-service/wiki/Design) \ No newline at end of file +* For more on the design considerations and intentions, see [design documentation here](https://github.com/angular/vscode-ng-language-service/wiki/Design)