ReSharper TypeScript seems to be not working at all in my VS 2015 installation

匿名 (未验证) 提交于 2019-12-03 02:50:02

问题:

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?

回答1:

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.



回答2:

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.



回答3:

Since the problem occurs in more than one version including latest as of writing, you also have the option to switch off TypeScript support in ReSharper. After all, if a feature is broken, why use it?

How to switch it off according to their web site:

If necessary, you can disable/enable ReSharper features in TypeScript files by clearing the corresponding check box on the Environment | Products & Feature page of ReSharper options.

Source: JetBrains help page for ReSharper (retrieved 29 March 2018)

After this change you may have to restart Visual Studio for the new settings to take effect.



易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!