More TypeScript Support in ReSharper 8.2

When we announced TypeScript Support in ReSharper 8.1, we promised you a lot more to come. It’s time to deliver on that promise. Here are some of the things we’ve added in ReSharper 8.2:

  • Support for generics as well as many improvements to ReSharper’s type resolution mechanisms.
  • Create from usage lets you start using code constructs first and create them later.
    ReSharper 8.2 TypeScript Create from usage
    This mechanism supports creation of many different constructs such as creation of modules or enum members from usage. ReSharper now also honors Member Generation settings for usage-generated TypeScript code.
  • Compiler-defined errors (only syntax errors, for now) are highlighted. These errors are accompanied with over 50 quick-fixes:
    ReSharper 8.2 TypeScript Make all overloads public or private
  • Naming support has been added: ReSharper will now check your code against the TypeScript naming settings:
    ReSharper 8.2 TypeScript Inconsistent naming inspection
    and will offer to fix things for you:
    ReSharper 8.2 TypeScript Naming quick-fix
  • Navigation up and down the inheritance hierarchy (Alt+Home and Alt+End respectively) now works for both type declarations as well as type members.
  • Support for modules in navigation (Go to Symbol Shift+Alt+T/Go to Everything Ctrl+T):
  • The Import Module context action lets you automatically add the right import statements when an external module is used:
    ReSharper 8.2 TypeScript Import Module
  • Smart completion support (Ctrl+Alt+Space): ReSharper can filter out a completion list leaving only structurally compatible subtypes, as shown below:
    ReSharper TypeScript Smart Completion
  • Jasmine support, including support for version 2.0:
    ReSharper 8.2 TypeScript Jasmine Support

    To add support for Jasmine via TypeScript, simply include both original Jasmine (jasmine.js) as well as the DefinitelyTyped package (jasmine.d.ts) and then reference the .d.ts file via the <reference> construct, and you’re good to go. Your project will likely look something similar to this:

    ReSharper TypeScript Jasmine Project Structure

As always, we aim to deliver additional new features (and improvements to existing ones) in the near future. Meanwhile, we hope you enjoy this update that is available starting ReSharper 8.2 EAP. Until next time!

This entry was posted in How-To's and tagged , , . Bookmark the permalink.

16 Responses to More TypeScript Support in ReSharper 8.2

  1. peter says:

    When i try to run jasmine debugger within visual studio 2013 a get such error:

    What should i have installed to be able to run jasmine test runner?

    • Victor Kropp says:

      Peter, please check that path to phantomjs is correctly set in ReSharper – Options – Unit Testing – JS Tests. Also, please note, that debugging of tests written in JavaScript/TypeScript is not yet supported.

  2. David Hanson says:

    This is fantastic! Loving typescript support!!

  3. Pingback: ReSharper 8.2リリース – dotTrace、dotCoverもアップデート | JetBrains ブログ

  4. T.J. says:

    This is great, we make heavy use of TypeScript, and support was lacking.
    I tried writing tests in TS (jasmine says it’s supported), but how do I include libraries and the test source? In the past I included them with a reference, but the TypeScript compiler doesn’t allow me to reference a js file. Let’s say I need angular or underscore for my tests, how would I include them?

    • Dmitri Nesteruk says:

      It would appear that you have contacted our support engineers directly with regards to this issue. If this is so, they should be able to help you further.

      • P.M. says:

        I filed a feature request some time ago regarding this exact issue:

        Unfortunately it was closed as duplicate, but in the other issue it wasn’t picked up.

      • Mike Chaliy says:

        I have the same issue, I cannot find any way to include js file under the test.
        Chutzpah test adapter to solve this issue adds additional section:

        This makes test runner to peak up correct JS file and successfully run tests.

        Personally for me is blocking issue, I just cannot see any way how to use tests without being able to reference library.

  5. Neeraj says:

    In typescript support, the intellisense for the functions/members of super class are not showing up.

  6. I cannot seem to get Import Module feature to work. Interestingly enough, it works for my sample project that was created in a separate solution, however it doesn’t seem to work for our main. Am I missing some settings?

    • Dmitri Nesteruk says:

      The feature should generally work out of the box. Would you mind posting to with the details of your problem – thanks!

      • Rodion Pronin says:

        I have actually figured out the problem, however I tend to think ReSharper should be able to handle that.

        The problem is that if I have module names dot separated:
        Ex: module A.B.C {} TypeScript will unfold this into nested modules like:
        module A{
        module B {
        module C { }
        So in other words, if I have classes defined in nested modules, ReSharper doesn’t seem to analyze that tree, and does not offer me module import hint.

        Also, because we have a lot of TypeScript files, but our ts files get compiled into a single .js file, we have to make sure our ts dependencies (/// clauses) are setup correctly. And we’re doing that manually, would enormously helpful if ReSharper did that for us!

        Thanks for your reply!

  7. Hello,
    I have one message. When I attempt to refractory ( mostly rename ) typescript file then Resharper also analyzes C Sharp files and waste lots of time. Is there anyway to tell resharper that I am refactoring typescript file so do not bother CSharp File.

Leave a Reply

Your email address will not be published. Required fields are marked *