0

I'm working on a huge project consisting of C# and Javascript files and I'm using VS2019 with ReSharper.

Everything works well except that Intellisense can't find global variables, objects or functions defined in other files.

When I load this project in VSCode, it works super fine, finds everything, shows variables and functions inside globally defined objects and even displays a tooltip for parameters.

Is there any workaround like adding a config file to the project or changing a setting in VS or ReSharper to make it find the definition, references, and make ctrl+click to work?

P.S. switching to Typescript is not an option.

Thanks

Ash
  • 20
  • 4
  • Is your project a asp net net framework project? – Mr Qian Mar 04 '21 at 08:11
  • Hi Ash, any update about this issue? If my answer helps you handle the issue, please do not forget to [accept it](https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work). And if not, please feel free to let us know:) – Mr Qian Mar 05 '21 at 08:13
  • Thank you but it didn't help. Although ctrl+click works and it jumps to the definition in another file, the tooltip is still saying "any" instead of showing the whole definition including the parameters. – Ash Mar 05 '21 at 13:42
  • Could you please share a pic with us to describe the issue? In my side, it could [work well](https://i.stack.imgur.com/7brbH.png) and I could see the definition of the variable. Did you use any `const`,instead, use `var`. – Mr Qian Mar 08 '21 at 08:06

1 Answers1

0

If you want to use the functions,variables,... from another js files, you could first add these reference node on top of the main js file:

///<reference path="xxxx\xxx.js"(the full path of the referenced js file) />

Then, you can get the functions, variables from that file.

Besides, there is a similar issue.

Mr Qian
  • 21,064
  • 1
  • 31
  • 41