Skip to content

Visual Studio, use latest tsc release #1110

Closed

Description

@jbondc

How would I go about using the latest TypeScript with Visual Studio?

C:\Program Files\Microsoft SDKs\TypeScript\1.0\tsc.js

Or making a patch and testing the Visual Studio integration with a locally built TypeScript?

Activity

  1. mhegazy commented on Nov 10, 2014

    @mhegazy
    Contributor

    Jon (@jbondc) do you want to use the latest tsc.js form master or latest public release (1.1)? and do you want to just build or you mean for the VS language service (like completion and quick info)?

  2. jednano commented on Nov 10, 2014

    @jednano
    Contributor

    Myself – I would love to use the latest tsc.js from master so I can report any issues as they come up.

  3. DanielRosenwasser commented on Nov 10, 2014

    @DanielRosenwasser
    Member

    You can do it, but this is really at your own risk - we provide no guarantees if you do decide to try it out, but generally you should be fine. 😄

    Using the Latest TypeScript Build in
    Visual Studio

    Replacing the Compiler

    If you have the latest TypeScript bits for VS, you should have a directory like

    C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.1
    
    1. Copy the file tsc.js in this directory to somewhere memorable as a backup (you can even keep it in this directory as tsc.bak.js).
    2. Clone our repo, check out the desired branch (you probably just want master). The directory you cloned to will from here on be called [TypeScript Repo].
    3. Run jake from [TypeScript Repo] in your shell.
    4. Copy [TypeScript Repo]\built\local\tsc.js to C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.1

    Keep in mind that if you use localized messages, the compiler may fall back to using English for newer errors.

    Replacing the Language Service

    If you'd like to swap out the language service, the procedure is similar. You should have a directory like

    C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TypeScript
    
    1. Copy the file typescriptServices.js in this directory to somewhere memorable as a backup (you can even keep it in this directory as typescriptServices.bak.js).
    2. Clone our repo, check out the desired branch (you probably just want master). The directory you cloned to will from here on be called [TypeScript Repo].
    3. Run jake from [TypeScript Repo] in your shell.
    4. Copy [TypeScript Repo]\built\local\typescriptServices.js to C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TypeScript.

    Keep in mind this is less stable; if our services interface changes, the VS-specific bits might not be in sync and can fail hard. Still, it's usually reliable enough that I have a script called updateLS.ps1 to hot-swap the language service.

  4. jbondc commented on Nov 10, 2014

    @jbondc
    ContributorAuthor

    Ahh thanks Daniel Rosenwasser (@DanielRosenwasser).

    Mohamed Hegazy (@mhegazy) I'm interested in both (compiling with latest tsc & using language services).

    jake build
    jake updateVisualStudio :)

    Or the other way around, if I could configure the paths that Visual Studio points to
    [TypeScript Repo]\built\local\tsc.js
    [TypeScript Repo]\built\local\typescriptServices.js

    I'm ok with things breaking, would make it easier to experiment with the language & test new features (union)

  5. DanielRosenwasser commented on Nov 11, 2014

    @DanielRosenwasser
    Member

    Yes, Mohamed Hegazy (@mhegazy) did suggest this as an alternate option, and he would be more knowledgeable in doing something like this.

    I'm not 100% certain, but I think that would only be possible for using the latest compiler in Visual Studio, not for the latest language service. Using the latest language service might require the same steps that I mentioned above.

  6. mhegazy commented on Nov 12, 2014

    @mhegazy
    Contributor

    i like the idea of making VS pick the latest form your local enlistments. it is not clear to me what is the best way to define these values.

  7. added
    Needs ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.
    on Nov 12, 2014
  8. DickvdBrink commented on Nov 12, 2014

    @DickvdBrink
    Contributor

    Maybe something like nightlies would also work for the language service (so a nightly for the VS plugin)?

  9. jbondc commented on Dec 2, 2014

    @jbondc
    ContributorAuthor

    I went with 'jake link-vs' and 'jake unlink-vs', seems to work with 1.4 and latest power build:
    https://visualstudiogallery.msdn.microsoft.com/955e0262-0858-40c9-ab5a-1acc680e9bfd

  10. Arnavion commented on Dec 5, 2014

    @Arnavion

    Hi Daniel Rosenwasser (@DanielRosenwasser) , in the "Replacing the Language Service" part of your post, I think you meant to replace typescriptServices.js in step 4, not tsc.js. Could you fix that?

    Also, can you add a step of copying over lib.d.ts to both parts as well?

  11. DanielRosenwasser commented on Dec 5, 2014

    @DanielRosenwasser
    Member

    Arnav Singh (@Arnavion), sorry about that, but thanks for the tip! I've corrected it.

    I'll document replacing your lib.d.ts so that you can get more up-to-date and/or accurate typings in the Visual Studio language service and compiler.

    Using an alternative lib.d.ts in
    Visual Studio

    Like in the above post, there are two places you must update your lib.d.ts so that it will be consistent across both compilations and within the language services.

    • C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.1
    • C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TypeScript
    1. In each of the above directories, there should be a lib.d.ts file. Within each directory, make a copy of that lib.d.ts called lib.bak.d.ts.
    2. Identify the alternative lib.d.ts you want to use in Visual Studio. Typically, you may want to grab the latest version from our repository. If this is the case, follow the following steps:
      • In the repository, there are two directories to choose from: bin/ and /src/lib. bin/ is usually stable, src/lib/ is typically newer. Pick one as your lib.d.ts.
    3. Copy your chosen lib.d.ts into both of the specified directories.

    Note that you won't immediately see changes; you should probably just restart Visual Studio.

  12. DickvdBrink commented on Mar 12, 2015

    @DickvdBrink
    Contributor
  13. mhegazy commented on Mar 12, 2015

    @mhegazy
    Contributor

    yup your are right.. as always thanks Dick van den Brink (@DickvdBrink) :)

    For future searches, here is the wiki for enabling the dev mode: https://github.com/Microsoft/TypeScript/wiki/Dev-Mode-in-Visual-Studio

  14. locked and limited conversation to collaborators on Jun 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixedA PR has been merged for this issueNeeds ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions