javascript-typescript-langserver
javascript-typescript-langserver copied to clipboard
Scanning "node_modules" slowing operations down
I'm using the Neovim plugin: LanguageClient-neovim to interact with this language server. Operations such as going to a definition or finding all references are slowed down a great deal since it seems the server scans through the node_modules folder during the operation. I end up getting a ton of messages such as:
[Warning] readFile /project-dir/node_modules/eslint-plugin-flowtype/node_modules/lodash/fp/__.js requested by TypeScript but content not available
Is there a way to ignore the node_modules folder during these type of operations?
https://github.com/sourcegraph/javascript-typescript-langserver/issues/394 This is a hack though, not the real solution
Does that hack even work though? Most of this LSP server ignores what you put in the excludes.
Well, it wiorks for https://github.com/sourcegraph/javascript-typescript-langserver
This makes LanguageClient-neovim unusable. +1 for some sort of exclude option.
Still relevant, and that hack seem to only work for VSCode, not NeoVim.
To be able to work with NeoVim and LanguageClient-neovim, right now I have to make sure to keep the code in a subdir next to node_modules (e.g. src) and then point it out as project root by having a rootmarker there. Either a .root file or for example App.js.
let g:LanguageClient_rootMarkers = ['App.js', '.git']
@whitebyte
Well, it wiorks for https://github.com/sourcegraph/javascript-typescript-langserver
Are you sure about this? With logging turned on and javascript-typescript-langserver + LanguageClient-neovim, I still see a bunch of attempts to access files under node_modules like this one:
12:41:50 INFO reader-Some("typescript") src/rpcclient.rs:83 <= Some("typescript") {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":2,"message":"readFile /Users/glh/code/corpus/node_modules/@types/jest-diff/index.d.ts requested by TypeScript but content not available"}}
(And that message is puzzling in any case, because the file exists on file system and has legit-looking contents to me.)
@wincent no idea, this ticket is more than 1 year old and I already don't remember