Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TypeScript IntelliSense not working in VS2012

So I have the typescript extension installed and I can see the new project type ("HTML App with TypeScript" and the ".ts" file type). Everything seems to work (compilation, error highlighting etc.) but I am not able to get IntelliSense to work correctly. Hovering over a parameter displays its type but code completion and "list members" do not work. Doesn't matter if I press Strg + Space or select List Members from the menu, nothing happens.

I tried to disable/enable "auto list members" in the options, I even reset all the options. IntelliSense works fine in C# projects and it even works fine in the .js file that is generated.

like image 393
mbuchetics Avatar asked Feb 19 '23 23:02

mbuchetics


1 Answers

This is a wicked little Visual Studio issue. You need the leading "<" for this to work.

WRONG way to add a .ts reference:
/// reference path="myOtherFile.ts" />

RIGHT way:
/// <reference path="myOtherFile.ts" />

VS 2012 drops in the WRONG text when you drag a file from the solution explorer tree into a text file. Easily fixed but hard to notice the problem in the first place.

like image 147
Steve Millar Avatar answered Feb 21 '23 12:02

Steve Millar