Added a "treat aspx file as folder" feature

Oct 19, 2011 at 8:46 AM

First off, great work on this plugin. We are using it extensively in our environment.

I've made a small change to the code and was wondering if you'd like me to add that to your code, or perhaps I could send you the changes. It's as follows:

In-house, we have created registry entries so that .js files that have the same name as an .aspx file in the same path, are nested below the aspx file. So, let's say you have an aspx page called "users.aspx" and you have a javascript file used in that page, called "users.aspx.js", in your project view in the IDE, it will get nested in the users.aspx page, the same way traditionally your .cs files would get nested. We have done this because our application does not use code behind at all - instead we have javascript that makes calls to a WCF layer.

The way your plugin currently works, or rather the way the IDE works, is that when you have this sort of nested scenario, the nested .js files are not found and thus never "jslinted". I added an option called "ASPXIsFolder" and then added the following condition in the Connect.cs "GetFileType" method:

            //If the user has chosen to "Treat ASPX as folder" then we need to return it

			if (filename.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.InvariantCultureIgnoreCase) ||

                (filename.EndsWith(".aspx", StringComparison.InvariantCultureIgnoreCase) && Options.Current.ASPXIsFolder))
				return IncludeFileType.Folder;
Now, when we run your plugin, ad it reaches a ASPX file, it checks to see if there are any .js files nested below it and lints them too.