Typescript Support - Resharper 10.0.2 EAP3

Hi, my environment is as follow:
Visual studio 2015 with update 1 official release
Resharper 10.0.2 EAP3

The typescript inspection service from Resharper does not recognize "console", which is showing in red stating Symbol "console" cannot be properly resolved... However, vs does not complain and transpile the ts to js with no issues.

Disablling resharper would obviously get ride of the red color of "console" and visual studio 2015 with typescript 1.7 does not complain.

A work arround would be very much appreciated.

Thank you.

Rex

12 comments
Comment actions Permalink
Official comment

Hello

Please try installing R# 10.1 EAP https://confluence.jetbrains.com/display/ReSharper/ReSharper+10.1+EAP.

Thanks! 

Comment actions Permalink

Please try selecting 1.6 here ReSharper | Tools | Options | Code Editing | TypeScript | Inspections | TS language level.

0
Comment actions Permalink

Resharper 10 does not support ts 1.7+

0
Comment actions Permalink

Your suggestion to use 1.6 does not work.

 

Is this going to be fixed anytime soon?

 

My Workaround...meaning w/o ReSharper is:

I currently have to disable ReSharper for all .ts files and change my intellisense to Visual Studio to get this to stop complaining.

0
Comment actions Permalink

My work around is to exclude the angular app folder.

Cannot believe the problem is there for at least three months without any fixes.

0
Comment actions Permalink

I am using ReSharper Ultimate 2016.1 EAP 8

I am having the problem that ReSharper reports that "symbol cannot be properly resolved" for any types that I have installed using Typings.

Typings is a package manager specifically for managing TypeScript type definition files. It is configured using a typings.json file in the project root. It automatically downloads the required type definition files and puts them in a folder named typings directly off of the project root. It does NOT add the downloaded type definition files to the Visual Studio csproj file.

I am using a tsconfig.json file in the root of my project. It uses the "exclude" option to tell the TypeScript compiler to ignore certain paths. In this configuration, the compiler assumes that any *.ts files that are below the project root and are not excluded are part of the TypeScript compilation.

Both the TSC command line compiler and Visual Studio work as expected with the type definition files even though they aren't declared in the csproj file. ReSharper does not. If I manually add the type definition files to the csproj file (which I do not want to do), ReSharper works as expected. If I remove the type definitions from the csproj file, ReSharper goes back to complaining about symbols that cannot be properly resolved.

Currently I use one of several workarounds depending on how much I miss ReSharper at any given moment.

  • If I only need ReSharper to be quiet for a moment or two, I use Ctrl+Alt+Shift+8 to temporarily turn off ReSharper.

  • If I want to work on TS files for an extended period and I want to use ReSharper, I temporarily add the type definition files to the csproj file to satisfy ReSharper.

  • If I don't care about ReSharper for what I am doing, I tell ReSharper to ignore *.ts files for Code Inspection. This allows me to keep ReSharper for my other files, but turns it off for TypeScript.

None of these workarounds are completely effective as they either require me to not get the full functionality of ReSharper or to reconfigure my project in a way that I do not want.

0
Comment actions Permalink

The new EAP solved this problem, with potential EAP problems lol.

0
Comment actions Permalink

Yuan Huang, when you say "The new EAP", do you mean "2016.1 EAP 8"? That is the one I am using.

0
Comment actions Permalink

Yes it is and the said problem doesnt exist anymore, Resharper recognized the types just fine in my environment with EAP8.

Though I don't use resharper for typescript editing anymore, I find webstorm is far superior in supporting typescript and angular 2, for two reasons: 

1. auto import

2. support of language injection where strings in ts file can be treated as html/css etc.

0
Comment actions Permalink

I'm sorry; I don't understand. What do you mean that the problem doesn't exist anymore? I am using EAP 8 and I am having the problem I described above. 

0
Comment actions Permalink

I tried, console.log does not appeal to be a problem to me, my environment is vs 2015 update 2, resharper latest EAP build. 

I suggest creating a brand new project and try out a clean typescript file and see if console is red with resharper full on.

0
Comment actions Permalink

I'm running RS 2016.3.1 (which was originally EAP 8), and I still have the problem that Bill describes. When TypeScript typings are ambient, ReSharper cannot figure them out. Fortunately, adding the files to the project immediately fixes the issue, so thank you Bill for that tip!

0

Please sign in to leave a comment.