JSConfig for SmartBear TestComplete for Intellisense, Autocomplete and JSDoc documentation support in VSCode

53 Views Asked by At

My team is using TestComplete for test automation and the scripts are written in Javascript. The built-in editor is severely lacking and doesn't support autocomplete with module imports (require syntax).

The annoying thing is that TestComplete maintains its own virtual filesystem structure (regardless of how they're organized in the OS filesystem) and essentially puts all files in the same folder during compilation, so there are no folder names and every file needs to have a unique name.

This was OK up until we decided to start organizing the files into OS filesystem folders for ease of access in VSCode.

I'd like it if VSCode's JS LSP would provide suggestions and auto-imports for modules using the filename only and, once imported, load the module into the LSP to provide autocomplete suggestions based on the module's contents and JSDoc's typing documentation. Also, VSCode intellisense doesn't provide autocomplete for the require, module or module.exports keywords currently.

This is what my JSConfig looks like at the moment:

{
   "compilerOptions": {
      "module": "commonJS",
      // "target": "es2015",
      "target": "es6",
      // "checkJs": true,
      "strict": true,
      "strictFunctionTypes": false,
      // "moduleResolution": "classic",
      "moduleResolution": "node",
      "rootDirs": ["./**/*"],
      "paths": {
         "*": ["./*" ]
      },
      "baseUrl": "./**/*"
   }
}

This does allow for module name suggestions when writing in require(...) (with no directories) but auto-import suggestions still use the path with directories and once the import is added using just the filename for the module, module contents are not suggested when using the module.

For this module:

example module

module name intellisense

module auto-import

Results in:

result relative module import

What combination of rootDirs, paths, and baseUrl options do I need to achieve what I want? Essentially, every file in every directory needs to be considered in the same, root directory of the compilation for the LSP, as far as I understand.

I've even written a script to add every directory to the paths."*" array but that hasn't gotten me what I want either.

Any help or suggestions is appreciated.

0

There are 0 best solutions below