By updating your TypeScript language services file, you can try out the latest features we’re working on before they appear in an official release. Naturally, you might encounter bugs here as the code built in the development branches isn’t as stable or well-tested as the released version.
The majority of the TypeScript editor features are found in a file called typescriptSerivces.js. To update your file, you’ll need to get a new copy and overwrite the existing copy.
Obtaining a new ‘typescriptServices.js’ file
Option 1: Use the LKG
The LKG (“Last Known Good”) version of the compiler is updated somewhat frequently. You can get a copy from CodePlex using the source browser and downloading the typescriptServices.js file from the bin directory.
Option 2: Build Locally
Install git and Node.js
You’ll need some basic tools first
- Install git. Some recommendations for the install options:
- Don’t install the Windows Explorer integration unless you plan to use it
- Select the Run Git from the Windows Command Prompt option on the following page
- Select Checkout as-is, commit as-is option on the following page to minimize any line-ending weirdness
- Install Node.js
Setup a Local Repository
> git clone https://git01.codeplex.com/typescript
This will set up a TypeScript repository in a subfolder of the current folder called ‘typescript’.
Select a Branch
> cd typescript > git checkout develop
If you’re interested in the latest, the develop branch is probably your best bet. There may be other branches with active development; if you know of a branch you’d like to try out instead, replace develop with that branch name.
Get the Development Dependencies
> npm install
This will install a local copy of jake, the build system we use for TypeScript.
> .\node_modules\.bin\jake local
This will produce built\local\typescriptServices.js. Copy that file as indicated below.
If you like, you can simply delete the TypeScript folder created in the first step and be done. However, if you come back at a later time and want a new fresh copy (with the latest changes), you’ll need to run git pull to get the newest sources. After that, just run jake local and copy over the typeScriptServices.js file again.
You’ll need to locate the folder where the TypeScript extension was installed. Look for a file called typescriptServices.js in a folder like:
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\enn4wcm5.z2b\
The highlighted portion at the end there will be different on every machine, but there shouldn’t be too many of them in the Extensions folder. In some rare cases, you might have more than one subfolder that has a TypeScript installation in it; if this is the case, you’ll want to use the newest one (check the Created date).
When you find the one with typescriptServices.js, backup that file and copy in the new version. After you restart Visual Studio, you’ll be working with the updated services file.