8

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:

  1. snippets - but it doesn't support auto complete object properties
  2. custom type definition - since it's not in the workspace. It doesn't load it (especially since the script is not doing a require or import statement)
  3. 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:

  1. added the following into my jsconfig.js but it didn't affect the autocomplete at all:

    "typeAcquisition": {
    "enable": true,
    "include": [
        "C:\\test.d.ts"
    ]
    

    }

  2. 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?

Adriano
  • 3,788
  • 5
  • 32
  • 53
YafimK
  • 195
  • 4
  • 15
  • I just added a answer [here](https://stackoverflow.com/a/73161485/7475099), it should be relevant to what you have asked above. – krupesh Anadkat Jul 29 '22 at 04:00

0 Answers0