Sometimes Code
Sometimes Code

Reputation: 601

VS2015 does not have TypeScript template and it is not supporting typescript

I am working on Visual Studio 2015 professional. I have installed TypeScript using npm. TypeScript 2.0.3 installed. Then i tried to add a TypeScript file using Right Click on a tsScript Folder of my Project -> Add New Item but i did not find any TS file template. Then I make a workaround by adding a text file and changed its extension from .txt to .ts and pasted some TypeScript code in this file. When i am running the application, application is able to generate jsfile from this ts file. But the problem is : the text color in the ts file is all black. There is no coloring, no intellisense, no modularation . It is just plain text.

What can i do to make this ts file recognized to visual studio. Below is the screenshot.

enter image description here

tsconfig.json File :

{
  "compilerOptions": {
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "module": "commonjs",
    "noEmitOnError": true,
    "noImplicitAny": false,
    "outDir": "../Scripts/",
    "removeComments": false,
    "sourceMap": true,
    "target": "es5",
    "moduleResolution": "node"
  },
  "exclude": [
    "node_modules",
    "typings/index",
    "typings/index.d.ts"
  ]
}

EDIT: The issue resolved by updating my Visual Studio 2015 to Visual Studio 2015 Update 3.

Upvotes: 2

Views: 1222

Answers (3)

Burt_Harris
Burt_Harris

Reputation: 6874

If you have already installed the TypeScript 2.03 plugin, and still don't see what you want, you may need the NodeJS tools for Visual Studio, Version 1.02 (or later) from https://www.visualstudio.com/vs/node-js/.

The TypeScript starters I use are under Project/Add New Item dialog Installed/NodeJS. You probably need to be in a NodeJS project to get these to work.

Upvotes: 1

jjokela
jjokela

Reputation: 337

Try to install TypeScript for Visual Studio 2015 plugin if not already installed.

If that doesn't help, there's a thread on the msdn forums that instruct to reinstall the templates with devenv.exe /InstallVSTemplates command.

Hopefully this helps.

Upvotes: 0

Prithvi Uppalapati
Prithvi Uppalapati

Reputation: 800

Try Visual Studio Code https://code.visualstudio.com

Install Visual Studio Code 0.10.1 or higher

Launch Code

From the command palette Ctrl-Shift-P (Windows, Linux) or Cmd-Shift-P (OSX)

Select Install Extension

Choose the extension

Reload Visual Studio Code

For mode details check this github page

https://github.com/johnpapa/vscode-angular2-snippets

Upvotes: 0

Related Questions