Reputation: 324
I noticed that VSCode uses only the files that are opened in editors (tabs) for looking up names for code auto complete. It is strange for me. To my mind the more usual behavior is to look up all files in opened folder, but not use only the opened files. Is this behavior by design ?
Upvotes: 0
Views: 452
Reputation: 324
Actually, to consider the opened folder as JS project, the "jsconfig.json" is required. Read more here
Upvotes: 0
Reputation: 65593
Try creating a jsconfig.json
file at the root of your workspace:
{
"exclude": [
"node_modules"
]
}
This tells VSCode to treat all JS files in your workspace as part of a single project, even if the files have not been opened yet. You can find more information about jsconfig.json
files in our documentation
Upvotes: 2