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

风格不统一 提交于 2019-12-02 21:57:15

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.

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.

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.

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