In my projects I use a third-party JavaScript library. I cannot import it explicitly in my code, this library is provided by JavaScript engine at runtime. I want to make coding easier by extending VSCode Intellisense by this library on all my project. I have a JavaScript file with function signatures of this library. What are the ways to do this? I already tried:
- write
/// <reference path=''>
to file in project. It works but it’s not very convenient to write it in all files. - use jsconfig.json file. This method did not work for me. Maybe I did
something wrong. - create extension with
vscode.codeCompletionProvider
. It works but VSCode does not perceive the input code as an object, interpreting it like text.
That's why after dot symbol VSCode offers other text that I entered as part of the program and my completion item located below this
text.
I have the following directory structure
.
├── project1
│ ├── ...
│ └── modules
├── project2/
│ ├── ...
│ └── modules
├── projectN/
│ ├── ...
│ └── modules
├── types
│ └── lib.js (file that I want to add to Intellisense)
├── .gitignore
└── jsconfig.json
And I tried the following file contents of jsconfig.json
:
{
"include": ["types/**/*"] // (also tried ["types/lib.js"] and ["types/**/*.js"])
}
Please help to deal with this issue. Maybe I'm missing something. Is there a way to expand the Intellisense? Thanks