sourcegraph / javascript-typescript-langserver

JavaScript and TypeScript code intelligence through the Language Server Protocol
https://sourcegraph.com
Apache License 2.0
793 stars 72 forks source link

Rename runs over node_modules folder? #394

Open ahmedelgabri opened 6 years ago

ahmedelgabri commented 6 years ago

I just installed the language server & tried to rename a React Component inside a file & it went through all my node_modules tree, I had to kill neovim after 15mins of just waiting to finish.

import React from 'react'

const Foo = props => <div> some post </div>

export default Fo|o // cursor position when :call LanguageClient_textDocument_rename() was called
derekstavis commented 6 years ago

I have the same issue here. In an ideal scenario when renaming, files and references in node_modules should be excluded.

whitebyte commented 6 years ago

Any update on this?

lex148 commented 6 years ago

maybe add a way to exclude a folder?

whitebyte commented 6 years ago

Well, it seems there is a way to exclude a folder - put jsconfig.json in the root project folder. File contents:

 {
    "exclude": [
        "node_modules"
    ]
}

Although I don't think this is an elegant solution. jsconfig.json AFAIK is VSCode thing and has nothing to do with other editors (e.g. NeoVim). Besides, there should be the way to exclude node_modules by default, for all projects, because obviously it's not a good idea to mess with its' contents.