4

I've installed TypeScript and Web Essential for Visual Studio 2012.

In a new TypeScript Project were created 3 files:

  • default.html
  • app.css
  • app.ts

In all tutorials, VS 2012 automatically create dropdown for app.ts file in explorer, where is hidden app.js file.

Like on the image below:

enter image description here

But in my case it doesn't happen for "app.ts", and for new TypeScript file "file1.ts":

enter image description here

What I need to do in settings for VS 2012, to automatically creating and viewing outputed js files?

DTupalov
  • 145
  • 8
  • If you look in the folder can you see any JavaScript files there that perhaps aren't showing up in the solutions? This will tell us whether it is a compilation problem (i.e. TypeScript isn't compiling your project) or whether it is just a problem with your solution not showing the files. – Fenton Nov 20 '13 at 11:52
  • TypeScript compiling in JS files, but it does not displaying in my Solutions. – DTupalov Nov 20 '13 at 11:59

2 Answers2

2

There is a quick fix to show the files inside the solution.

If you click the "Show Hidden Files" icon in Solution Explorer you'll see the files appear and you can right-click and select "Add file to solution".

The slight problem here is that they won't be correctly nested against your TypeScript file - they'll appear on their own. You can fix this by editing the project file to show the dependency between the files - I have shown two files that both depend on app.ts as an example, you may only need the JavaScript file to depend on the TypeScript file:

<Content Include="app.d.ts">
  <DependentUpon>app.ts</DependentUpon>
</Content>
<Content Include="app.js">
  <DependentUpon>app.ts</DependentUpon>
</Content>
Fenton
  • 241,084
  • 71
  • 387
  • 401
2

There is a Visual Studio extension to do what you need: File Nesting

This extension allows you to specify which files are nested under which other files in the Solution Explorer. You can have files nested manually or by defining file name-based nesting rules.

Here is an example screenshot of what you can do with the plugin:

Nesting files with the "File Nesting" Visual Studio extension

Chris
  • 6,914
  • 5
  • 54
  • 80
Rajab Shakirov
  • 7,265
  • 7
  • 28
  • 42
  • This is a plugin to nest files into directories. This question, however, is about displaying already existing (correctly nested) files in Visual Studio. – Chris Jan 14 '15 at 20:08