English 中文(简体)
JSConfig for SmartBear TestComplete for Intellisense, Autocomplete and JSDoc documentation support in VSCode
原标题:

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.

问题回答

暂无回答




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签