Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent Visual Studio from nesting Typescript files

How do I prevent VS2015 from nesting files in an ASP.NET v5 project?

Here's what I'm getting:

enter image description here

I looked at un-nesting with Mads Kristensen's nesting extension, but he's said in an bug report on Github that it's not relevant to .NET5 projects because there is no .csproj to store the file relationships in. So it must be VS doing it itself. How do I stop it?

like image 971
Sean Avatar asked Aug 20 '15 19:08

Sean


People also ask

How to disable TypeScript in Visual Studio?

Currently, there are a few ways to "disable TypeScript" in VS. You could go to Tools > Options > Text Editor > JavaScript/TypeScript > Project and uncheck the Project Analysis options. Or you could change your TS files to be JS files, as the language service only runs on TS files.

How do I enable nesting in Visual Studio?

The precedence for merging file nesting settings is: Visual Studio > Solution > Project. You can tell Visual Studio to ignore solution-specific and project-specific settings, even if the files exist on disk, by enabling the option Ignore solution and project settings under Tools > Options > ASP.NET Core > File Nesting.

Can you code JavaScript in Visual Studio?

Visual Studio 2022 provides rich support for JavaScript development, both using JavaScript directly, and also using the TypeScript programming language, which was developed to provide a more productive and enjoyable JavaScript development experience, especially when developing projects at scale.


1 Answers

If anyone is still looking for an answer to this I accomplished it by manually editing the toolSettings.json file for VS as per this discussion https://github.com/aspnet/Tooling/issues/889

If you remove the rules for .ts files in the 'extensionToExtension' section it will stop the nesting. As the discussion says this is a temporary solution.

like image 116
Andrew Alderson Avatar answered Oct 17 '22 20:10

Andrew Alderson