问题描述:

ReSharper TypeScript seems to be not working at all in my VS 2015 installation. Despite of the correctly placed TypeScript definitions ReSharper does not recognize the defined types, gives zillion red underlines, and of course intellisense does not work on the variables.

The error message is for example: Could not find symbol 'JQuery'

Some more diagnostics:

  • Compiling the project in VS 2015 compiles with no error. Making an intentional error in the source then build generates one correct error message
  • Intentionally making a spell in the type definition file paths, it underlined with red correctly. When correcting the path, underline diasppears
  • Opening the very same project in VS 2013 all works like a charm, ReSharper is working correctly
  • Originally used ReSharper 9.1.2 this issue was there. Now upgraded to the latest 9.1.3 and the issue remained.

Any ideas?

网友答案:

If you see this kind of behaviour - lots of red, but clean compile, especially after an upgrade - you should try to clean the caches. Go to ReSharper → Options → General → Clean caches, then restart Visual Studio.

网友答案:

I have found that sometimes, the Visual Studio Project file is corrupted, containing multiple references to .ts files. This can cause a different, but related error, where ReSharper thinks there are multiple declarations of a symbol.

To resolve, if you are using version control, it is simple.

  • Make a commit
  • Delete the folder containing the duplicated files
  • Revert changes to the repository
  • Add the folder back to Visual Studio
  • Save the project file

As I mentioned, this doesn't solve the original problem, but can help in situations where ReSharper reports duplicate symbols.

相关阅读:
Top