You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)?
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).
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].
Run jake from [TypeScript Repo] in your shell.
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
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).
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].
Run jake from [TypeScript Repo] in your shell.
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.
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)
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.
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?
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 Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TypeScript
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.
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.
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.
Activity
mhegazy commentedon Nov 10, 2014
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)?
jednano commentedon Nov 10, 2014
Myself – I would love to use the latest tsc.js from master so I can report any issues as they come up.
DanielRosenwasser commentedon Nov 10, 2014
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
tsc.jsin this directory to somewhere memorable as a backup (you can even keep it in this directory astsc.bak.js).master). The directory you cloned to will from here on be called[TypeScript Repo].jakefrom[TypeScript Repo]in your shell.[TypeScript Repo]\built\local\tsc.jstoC:\Program Files (x86)\Microsoft SDKs\TypeScript\1.1Keep 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
typescriptServices.jsin this directory to somewhere memorable as a backup (you can even keep it in this directory astypescriptServices.bak.js).master). The directory you cloned to will from here on be called[TypeScript Repo].jakefrom[TypeScript Repo]in your shell.[TypeScript Repo]\built\local\typescriptServices.jstoC:\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.ps1to hot-swap the language service.jbondc commentedon Nov 10, 2014
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)
DanielRosenwasser commentedon Nov 11, 2014
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.
mhegazy commentedon Nov 12, 2014
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.
DickvdBrink commentedon Nov 12, 2014
Maybe something like nightlies would also work for the language service (so a nightly for the VS plugin)?
jbondc commentedon Dec 2, 2014
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
Arnavion commentedon Dec 5, 2014
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?
DanielRosenwasser commentedon Dec 5, 2014
Arnav Singh (@Arnavion), sorry about that, but thanks for the tip! I've corrected it.
I'll document replacing your
lib.d.tsso 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.tsinVisual Studio
Like in the above post, there are two places you must update your
lib.d.tsso that it will be consistent across both compilations and within the language services.C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.1C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TypeScriptlib.d.tsfile. Within each directory, make a copy of thatlib.d.tscalledlib.bak.d.ts.lib.d.tsyou 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:bin/and/src/lib.bin/is usually stable,src/lib/is typically newer. Pick one as yourlib.d.ts.lib.d.tsinto both of the specified directories.Note that you won't immediately see changes; you should probably just restart Visual Studio.
DickvdBrink commentedon Mar 12, 2015
I guess this is fixed by the https://github.com/Microsoft/TypeScript/blob/master/scripts/VSDevMode.ps1 script?
mhegazy commentedon Mar 12, 2015
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