Issue detail:
Go to http://www.typescriptlang.org/#download-links
If you click on Visual Studio 2015
, it takes you to the download page for TypeScript for Visual Studio 2015
(https://www.microsoft.com/en-us/download/details.aspx?id=48593).
If you click on Visual Studio 2017
, it takes you to the download page for Visual Studio 2017. The version of TypeScript in Visual Studio 2017 does not appear to be the latest (for example, it can't find the object
type).
Is there an official TypeScript for Visual Studio 2017 plugin, or a way to get it to use a newer TypeScript?
Visual Studio 2017 ships with a built in version of TypeScript. The current version is TS2.1. Newer versions of TS will be available throughout the VS update vehicles in the future; and will not be available as out of band installers like in VS2015 and VS2013.
This means that we'll need to wait for VS 2017 SP1?
TS Refactoring where the the killer feature of VS 2017 for me, snift, snift...
This is terribly disappointing.
So if I wanted to use Typescript 2.2.1 in VS 2017- does this mean I need to then rely on something like using gulp to compile the typescript or wait until whenever the next VS update?
Due to some issue with performance (might be related to #14539) my team either had to use VS2015 or use VS2017 using gulp to compile our typescript - however that leaves me to wonder if VS2017 is still respecting <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
as per https://github.com/Microsoft/TypeScript/issues/2294#issuecomment-129367578
Could using the TS2.2.1 msbuild nuget package be a viable work around in VS2017? https://www.nuget.org/packages/Microsoft.TypeScript.MSBuild/
We currently rely on using solely nuget packages as we have many products with varying versions of typescript running on our build machines and since they started putting out nuget packages it has solved a lot of our issues.
Just a clarifications there are two different parts here, 1. the version of the compiler you build against and 2. the version of the language service in the IDE (i.e. completions and errors).
Normally you would have them both the same, but that is not a requirement; you can build against a different version assuming you have it installed on your machine.
So, if you need TS 2.2.1 for some bug fix that is blocking your build you can, as @Serivy noted, use the nuget package, or you can just update your <TypeScriptToolsVersion>2.2</TypeScriptToolsVersion>
in your project file. assuming you have already installed the TS2.2.1 installer for VS 2015, it should have installed the TS 2.2 SDK to C:\Program Files (x86)\Microsoft SDKs\TypeScript\2.2
and your build should use that instead of TS2.1.
As for updates to the language service; VS 2017 has a revamped setup and the installers we used in previous versions are no longer applicable. We should be publishing updates to VS 2017 soon with newer versions of TS.
@mhegazy,
We should be publishing updates to VS 2017 soon with newer versions of TS.
We would ideally like to see this treated as a higher priority than it appears to be right now. The fact is there is no way for us to use VS 2017 because we have already migrated to TS 2.2. Since this is a significant new version (and not just a bug fix), there is no point upgrading just the build without language service support. We'll just end up with red squigglies all over the IDE.
Are you able to provide a time frame for when the TS 2.2 plugin for VS 2017 is likely to be released?
Has there been any thought in making visual studio plugin use the targeted typescripts language service like we have in VSCode instead of having one plugin per version?
I can only assume something like this is in the pipeline considering tslint disappeared from the list of lints provided from web tools?
https://twitter.com/VisualStudio/status/826437631831597056
Sorry to add a me too, but every time I try to subscribe to this thread it just blinks and doesn't subscribe me.
Same situation - have code already adjusted for 2.2 and now am stuck in VS 2015. VS Code supports 2.2, its a real shame 2017 is lagging and even a guess at an ETA would be welcome.
What a terrible idea.
Now we can't update to VS2017 because we require TS2.2
Even worse, in the future we will need to have all people on same version of VS and same update.
Me today seeing there is an update in VS2017 😄 😄 😄
....me after seeing it does not include TS 2.2 😟 😢 😟
Add me to the whining masses. After incorporating 2.2 features in a VS Code project was surprised to find it gave me the mismatch error when I opened the project on a VS 2017 machine. I installed the VS2015 2.2.1 SDK to see if that would work (did on my origin machine with VS2015), but no!!!
The mismatch I speak of is the warning that VS code shows comparing global tsc with the already updated VS code language service (2.2.1 TS in latest VS code)
echoing @olmobrutall when I installed the VS 2017 update...
Same here, it's a real bummer. On top of that, VS 2017 no longer supports tslint (but it does linting coffescript out of box (In Web Code Analysis menu in Tools), which make no sense. MS is not even supporting their own language for linting)
Thanks for the feedback. We are working hard on resolving this, and will have a supported solution out as soon as we can. There are some installer design constraints and challenges we need to work through in the new model.
In the meantime, there is a workaround you can use to unblock yourself, just know __this is unsupported__, and intended for use internally by our dev team during development. It is however very easily done (and more importantly – undone if you hit issues with it).
There is a registry key the language service in VS checks for that will override the default location it loads the language server (tsserver.js) from. This language server is also provided in the NPM package. Therefore, you can install TypeScript 2.2 from NPM (or build locally), and use the registry to instruct VS to use this version of the language server.
__Note__: This doesn’t update the grammar file VS uses, so new syntax may not colorize correctly. Also, we have not tested this to the level of an "_official_" release, so while we’re unaware of breaking changes, you may hit issues. (For example, automatic type acquisition for loose library files doesn't work without extra steps - so if you have jquery.js
simply copied into your project, you won't see jQuery intellisense automatically).
Here is how I set it up on my machine:
C:\temp\ts22
.npm init -y
, npm install --save typescript
).TypeScriptLanguageService
.CustomTSServerLocation
, with the value being the full path to the tsserver.js installed in the above NPM package.Your registry should appear something like:
If you launch VS 2017 now and open a TypeScript file, you should notice you are using TypeScript 2.2, e.g. the below code is from the 2.2 release blog:
If you open Task Manager, you can also check the Node.exe process powering the language service is using the tsserver.js using the path specified in the registry, e.g.:
To undo this change, simply delete or rename the CustomTSServerLocation
registry property.
Note that building in VS will still use the TS 2.1 compiler by default. You’ll need to either build outside VS, or install the 2.2 SDK and set the MSBuild property as Mohamed outlined above. (Compile on save will use the newly pointed to language server however).
Again, this should be seen as a temporary workaround, not a solution! This is not a product "_feature_", but a capability we use to develop internally - but it should unblock you for now until we have the fully baked solution in place.
Thanks for sticking with us, and sorry for the inconvenience.
Works like a charm! this is Awesome 👍 👍
@billti, thanks for the workaround. Do you have a rough ETA for when the TS 2.2. plugin for 2017 will be available?
Sorry, to be a pain, but this kind of workaround is not feasible for everyone.
@mhegazy How are we expected to install TSC on our build servers? Do you have to install the complete VS 2017 or just the Build Tools 2017?
The installer for VS 2015 should install the build tools only if VS is not installed on the machine.
We also recommend using the nuget package for build server scenarios.
Just read their blog post which gives us an update on this issue: https://blogs.msdn.microsoft.com/typescript/2017/03/27/typescripts-new-release-cadence/
Sounds like they are planning to allow us to update as soon as its avaliable which is great.
"We’ve heard feedback from several users about their need to move to TypeScript v2.2 in Visual Studio 2017 and understand the confusion and pain this has caused. As a team, we’re actively working on the problem and hope to have a fix available soon. We’ll keep the community updated as we make progress. Once implemented, developers will have full flexibility to update as soon as a new version of TypeScript is available. We apologize for the confusion and want to assure you that fixing this issue is a top priority."
I hope the extension targets the nuget packages language service or something flexible like that. Juggling the installed versions has always been a pain and back with the msi issue in version <1.8 we had a lot of headaches. I like how wix has broken their vs experience into an extension and then the installer just installs the sdk (of which nuget can be used for specfic projects and build servers). http://robmensching.com/blog/posts/2017/3/7/wix-v3.11-release-candidate/
"We’ve heard feedback from several users about their need to move to TypeScript v2.2 in Visual Studio 2017 and understand the confusion and pain this has caused. As a team, we’re actively working on the problem and hope to have a fix available soon. We’ll keep the community updated as we make progress. Once implemented, developers will have full flexibility to update as soon as a new version of TypeScript is available. We apologize for the confusion and want to assure you that fixing this issue is a top priority."
Thanks @DanielRosenwasser for writing this blog post, and @Serivy for posting the link! I eagerly await
being able to use VS 2017 with the latest TypeScript!
Another update for VS came through and yet again my TypeScript is still 2.1.5
Is there an ETA already? Or at least an ETA for the ETA ;)
Yet another update for vs2017, again Typescript remains at 2.1.5
Support for new versions of TypeScript (side-by-side) in VS 2017 will be out soon (i.e. hopefully within a week) in the Preview channel (https://www.visualstudio.com/vs/preview/). Once it has had some miles on it there and there are no major issues (it is quite a big change internally), it will move to the "main" VS release channel.
@billti great news, it took some time but with the regedit hack was not too bad.
Will the new setup allow to automatically change the TS version when the branch changes? A common issue our team is to move to an old branch just to realize that with a newer TS version the old code does not compile anymore...
I'm not sure what you mean by "..automatically change the TS version when the branch changes". Can you expand on this?
A common issue our team is to move to an old branch just to realize that with a newer TS version the old code does not compile anymore...
Can you detail some specific examples of this? (Code would be ideal). We try hard to maintain back compat, and put any breaking changes behind a flag, so definitely want to avoid this from being necessary. Our goal is that people just move forward without any friction.
By automatically I mean depending on the configuration on the source control, for example the TS version on the *.csproj, or the version of typescript module in project.json
I can not give you exact examples of this problem, since those issues didn't happen in my project and the version of TS was about 1.4 or 1.5
What you mean by backwards compatibility?. In TS 2.2 with strictNullChecks now there are more issues raised with arithmetic operators. I'm glad that there are new errors for potentially erroneous cases, but this is a breaking change IMO
Currently if you have the <TypeScriptToolsVersion>
set in your .csproj, then the build should honor that (assuming you have that version installed on the machine).
With the upcoming change, the editor version is selected from those available via Tools / Options, and hot reloads when changed (i.e. you don't need to reload the project, or even close/reopen files, when changed). We're debating how complex it would be to have the editor honor the project version also (which has a number of non-trivial problems to solve - e.g. if a solution contains multiple projects with different versions, etc.).
Visual Studio Code supports switching typescript versions between different projects, https://code.visualstudio.com/Docs/languages/typescript#_using-newer-typescript-versions
Can Visual Studio 2017 support a similar concept?
As @billti comments and reading the notes on
https://www.visualstudio.com/en-us/news/releasenotes/vs2017-Preview-relnotes#15.2.26412.01
"By default, the version of TypeScript used by IntelliSense and by the build will be the latest installed. To change the version used by IntelliSense, use the "Tools / Options / Text Editor / JavaScript/TypeScript / IntelliSense" setting shown below."
I appreciate at least the ability to switch I have got to admit, as someone who switches between multiple solutions with multiple versions of typescript (patch versions) its going to be annoying to have to go to options every time.
For this update the editor version is set in Tools / Options (build still uses the project version). The plan is to have a future update automatically switch the editor version based on the project setting on solution load, but that is more work that we could fit in the time frame for this update, unfortunately.
Is there an ETA for this?
@billti A week has passed :) Whats the status - this is blocking us ;) Really dont want to instruct the hole team to fiddle with registry.
Really dont want to instruct the hole team to fiddle with registry.
Exactly. Solutions like the one above are provided in order to imply that a "work around" exists so that the issue can be deprioritised.
That's just not great.
@pksorensen @NoelAbrahams Rest assured this is still a priority. TypeScript 2.2 is already available in Visual Studio 15.2 Preview
Well, not optimal - but running the vs17 preview side by side works very well and can unblock for now
Can't help but laugh when I read that Typescript 2.3 was released but VS2017 users will have to use Update 2 Preview.
I can understand the idea of having TS being pushed out via VS instead of using the out of band installers but at the same time sort of makes you wish the option was there for those who want to make use of the newest release... or perhaps not announce releases when it still isn't ready for the main vs release.
TS has its own release timeline...
@minestarks, it's issues like the following that suggest that Visual Studio issues are really low priority for your team.
Some of these are actual regressions and yet still remain apparently a low priority. I am personally quite disappointed these issues have not been fixed as they affect productivity significantly.
This is not the first time the fact that TS is neglecting Visual Studio has been brought to your attention. See #2656.
Agreed. I am at a point now where I feel VS Code has much better tooling and release cycle than VS Enterprise.
Now all we have to do is migrate our legacy code to stop paying Microsoft for enterprise licenses. Then we can be fully in the open-source world where the support is apparently better.
Visual Studio feature updates to the main channel (not the Preview channel) are unlikely to match the speed of VS Code releases or TypeScript publishing to NPM. Those are both much lighter weight products with much smaller teams compared to the effort needed across dozens of teams with hundreds of developers to push out a Visual Studio release.
That said, with the work we have in the pipeline for the next Visual Studio release (hopefully within the next few weeks - or available now in the Preview channel), from then on as soon as TypeScript publishes a release, you will be able to download and install it and use it in Visual Studio 2017 just as you can with Visual Studio 2015, and will also be able to easily switch between multiple installed TypeScript versions (something you can't do with VS 2015).
This is a point in time problem, and the problem will soon be in the past. We all wish we could click our fingers and resolve these issues immediately, but engineering takes effort. That effort is happening.
@billti, I'm not sure that the fundamental problem has been addressed in your post. Are you able to confirm the following:
Your team will never release a version of TypeScript unless a plugin for the latest version of Visual Studio (or ideally the latest two versions) is also available (unless it is bug fix affecting other IDEs)
Also would you mind letting my know why the following affecting Visual Studio (some of them regressions) are languishing in the pipleline?
Thanks.
Due to engineering changes (esp. the new VS 2017 setup model) and release timelines, your statement is exactly what happened with VS 2017 and TypeScript 2.2 & 2.3, so confirming that will never happen is obviously not realistic.
There are currently 1,990 issues open on the TypeScript repo, and more in our internal database that tracks feedback from other channels. This includes bugs, suggestions, questions, etc... We address issues in the order we believe has the most cost/benefit with the time & resources we have, not in the order logged.
As the 2.2 & 2.3 SDK is now downloadable for VS 2017, I'll close this issue. The TypeScript work is done. The VS work is also done and is available in the Preview channel, and will be promoted to the "release" channel in the near future.
Okay, I give up.
On the one hand it is claimed that supporting TypeScript in Visual Studio is a priority, but in practice it is "obviously" not. We have been told to expect releases in the future without Visual Studio support.
The reason there are 1,990 issues open on the TypeScript repo is exactly my point: when this project started back in 2012, Visual Studio was the main focus as an outlet. But now there is a desire to add TypeScript support for every damn thing. That is of course natural. However, my point is, that that support should not be at the expense of your core Visual Studio users.
Next time someone comes around asking me about my Visual Studio experience, this is going to be top of mind.
I don't exactly agree with you about the release plan but I at least can feel the pain after I clicked your three issues.
Any timeline on when this will get promoted to release channel? I'd prefer to not have to tell the whole team to install VS preview, given that you have to have VS closed during the duration of the long install. If its a month out still I may push for people to install it.
@cchamberlain , thanks for asking. Visual Studio 15.2 is live today.
@minestarks awesome!!
So... don't shoot the messenger....
Downloaded Visual Studio 15.2, I have the option to change the TypeScript version... only options I see are 2.1 & 2.2.
I visited the typescriptlang.org site, see that TypeScript 2.3 is now available. Click Download which takes me to http://www.typescriptlang.org/#download-links, click Visual Studio 2017 and get a link to the annoucement of the RC - https://blogs.msdn.microsoft.com/typescript/2017/03/27/typescripts-new-release-cadence/
Still can't download 2.3 so technically this is still an issue. Sorry.
@06b Good catch. You can install 2.3 from the download link referenced in this blog post (scroll down to where it says "simply installing it from here"). Looks like the website needs updated. Will look into that.
After you install 2.3 go back to VS 2017 settings and you should see 2.3 in the list.
Still can't install Typescript 2.3 for VS 2017. Links still broke. Link in blog post mentioned above is only for VS 2015. Please advise.
The file name says Dev14Full but it still should work.
I'm afraid it doesn't for me for either VS 2017 v15.2 or VS 2017 Preview v15.3.
Did you check this new option? You may have to switch to 2.3 manually.
Ah. Setting it in options manually worked. I certainly didn't know to look there and set it, so I hope the next installer works better.
@SaschaNaz Thanks!
That intellisense option is very confusing. Why would anyone want an intellisense version that is different than the build version (defined in the .csproj
file)?
Maybe @minestarks or @billti could comment on why VS intellisense doesn't default to the version in .csproj
file.
That intellisense option is very confusing. Why would anyone want an intellisense version that is different than the build version (defined in the .csproj file)?
That's indeed strange...
And what if you have different projects in your solution with different TypeScript versions?
@styfle @304NotModified Our long term plan is in fact to base the language service version off of what's specified in the .csproj
file to match the build. @HakanL with multiple projects simultaneously open with different TypeScript versions, we'd end up choosing one version and running with that. It's not our goal to have multiple language services running at the same time -- the memory and scalability issues it presents are not worth the value added. I'd recommend upgrading all projects in the same solution to use the same TS version.
@minestarks
Our long term plan is in fact to base the language service version off of what's specified in the
.csproj
file to match the build.
That sounds great! But what does "long term" mean? 1 month, 1 year, 5 years, 10 years? Currently VS Code already supports this feature so if this feature never comes to VS Enterprise, my long term goal will be moving our developers to VS Code.
@styfle exact timelines are beyond my control but I'll tell you I'm working on it :)
@minestarks the MSDN blog site is down, any direct link to grab the 2.3 definitions for VS 2017?
Is there possibility to force VS17 use tsc from node_modules (for IntelliSense and build) like VS Code does?
Most helpful comment
This is terribly disappointing.