I have an JS sdk, which the users aren't using require to load it in their JS script. I'd like to offer intellisense / autocomplete of the SDK in VSCode, without requiring the user to do any difficult actions except installing an extension or setting something easy in jsconfig.
They have a js module with the SDK in a path other than the workspace. I've checked the following solutions:
- snippets - but it doesn't support auto complete object properties
- custom type definition - since it's not in the workspace. It doesn't load it (especially since the script is not doing a
require
orimport
statement) - Language server - seems over the top
Any suggestions?
Following this How to Import Intellisense files into vsCode (Visual Studio Code) , I've done the following:
added the following into my
jsconfig.js
but it didn't affect the autocomplete at all:"typeAcquisition": { "enable": true, "include": [ "C:\\test.d.ts" ]
}
Once I added
/// <reference path="C:\test.d.ts" />
it was resolved
Is there a way to automate this using an extension? or avoid requiring the reference path at all?