Skip to content

VS2017 TypeScript intellisense and syntax coloring incorrect - 2.4.1 installed but reports as 2.3.4 #18130

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
daiplusplus opened this issue Aug 29, 2017 · 7 comments
Assignees
Labels
Bug A bug in TypeScript Needs More Info The issue still hasn't been fully clarified Visual Studio Integration with Visual Studio

Comments

@daiplusplus
Copy link

I recently upgraded to VS 2017 15.3.3 and I've noticed my TypeScript files are not being handled correctly in Visual Studio. I don't know if the two are related as I haven't worked on TypeScript files recently.

Inside Visual Studio 2017, Help > About lists TypeScript as version 2.3.4.0, even though in Control Panel > Programs and Features it only lists TypeScript 2.4.1.0 - I don't know where the 2.3.4.0 number is coming from. I don't see a TypeScript version selection control in the VS Options window which only appears when you have multiple versions installed.

The actual problem is when a .ts file is open in the editor I only get basic syntax highlighting for language keywords, strings, numbers, comments, et cetera - but no coloring of type-names, for example - and of course, no .js and .map files are being generated on-save unless I build my project. The navigation bar at the top of the editor has 3 empty drop-down lists even though I'm in a project and my caret inside a class member function, and the Ctrl+Space and other commands does not open any kind of auto-complete or suggestions - it feels like it's loaded in a basic TextMate-only editor. I disabled the built-in TextMate Grammar extension and restarted Visual Studio and indeed, my .ts files now open in the Plain Text editor with no highlighting at all - so for some reason the TextMate Grammar editor is hijacking TypeScript. So I reinstalled the TypeScript 2.4.1.0 SDK, but that had no effect, as opening .ts files causes the TextMate-only editor to open them still. I note that after reinstalling the TypeScript SDK my .ts files are no-longer recompiled to .js/.map when I build my project anymore.

I noticed when I opened Tools > Options > Text Editor > File Extension the list is completely empty, regardless of the Editor I select - bizarre.

I also ran devenv /setup from an elevated VS Command Prompt, no effect was observed.

I'm assuming this is a corrupt VS configuration - but my bug/feature-request is for the TypeScript tooling to self-diagnose an incorrect file-type-to-editor assignment within Visual Studio.

@BillZiss
Copy link

I am having the same issue.

@amcasey
Copy link
Member

amcasey commented Aug 30, 2017

Seeing a stale version number under Help > About is a known issue that we're working on now. You can ignore it for now.

@amcasey
Copy link
Member

amcasey commented Aug 30, 2017

@Jehoel @BillZiss Can you please provide some background?

  1. Which version of VS did you upgrade from?
  2. Which versions of the TS SDK have you manually installed, if any?
  3. Which version(s) of TS are selected in your projects?
  4. Did you Open Folder or Open Project?
  5. Have you enabled Lightweight Solution Load?

Having copies of your projects would be very helpful, but we could get an overview from a command like dir /s *.ts *.js *.tsx *.jsx *html *.json.

Thanks!

@daiplusplus
Copy link
Author

daiplusplus commented Aug 31, 2017

I completely nuked my computer's multiple Visual Studio (2015 and 2017) installations yesterday and did a clean install of just VS2017 15.3.3 directly from MSDN and then installed the TypeScript 2.4.1.0 SDK and it's working fine now, but I'll answer your questions from memory:

  1. Version 15.3.2.
  2. I had version 2.4.0 manually installed, then I installed 2.4.1 on top of it. I don't remember doing anything special during the upgrade process. This would have been a few weeks ago.
  3. It's an ASP.NET Web Application project. I remember the project had 2.4 set because it asked me to upgrade the project from 2.3 earlier in the month. As a side-note: on my new now-working installation it says "2.4 (Unavailable)" even though it builds fine.
  4. Open Project
  5. No
  6. I experienced the symptoms regardless of the context in which a .ts file was opened - the editor was broken for every project, including project-less standalone .ts files. My projects do not have a .tsconfig file at present.

@amcasey
Copy link
Member

amcasey commented Aug 31, 2017

6 is particularly interesting. Thanks for taking the time to reduce the repro!

@mhegazy mhegazy added the Bug A bug in TypeScript label Aug 31, 2017
@mhegazy mhegazy added this to the Visual Studio 15.4 milestone Aug 31, 2017
@mhegazy mhegazy added the Visual Studio Integration with Visual Studio label Aug 31, 2017
@amcasey
Copy link
Member

amcasey commented Aug 31, 2017

@BillZiss Are your answers the same?

@amcasey amcasey added the Needs More Info The issue still hasn't been fully clarified label Sep 7, 2017
@amcasey
Copy link
Member

amcasey commented Sep 7, 2017

I'm going to close this issue since we have a fix in progress for a related issue and @Jehoel is no longer having problems. @BillZiss, can you please reactivate this issue or file a new one (and tag me) if you continue to have problems?

@amcasey amcasey closed this as completed Sep 7, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Needs More Info The issue still hasn't been fully clarified Visual Studio Integration with Visual Studio
Projects
None yet
Development

No branches or pull requests

4 participants