Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FSharp Template interfering with Add New Class in C# app #251

Closed
mwhitis opened this issue Apr 8, 2015 · 19 comments
Closed

FSharp Template interfering with Add New Class in C# app #251

mwhitis opened this issue Apr 8, 2015 · 19 comments

Comments

@mwhitis
Copy link

@mwhitis mwhitis commented Apr 8, 2015

I've got SideWaffle 1.16 from 3/10/15 installed on VS 2013 SP4.

After the installation, the "Add New Class" functionality is broken via the right-click menu item and the shortcut (shift+alt+c) in a C# app. Instead of opening the "Add New Item" window, with Class selected, as expected, I get the Add New Item Window, with FSharp selected.

image

The only thing under the FSharp menu is the SideWaffle Template.

image

If I disable SideWaffle, the functionality goes back to being as expected.

@PallasStreams
Copy link
Member

@PallasStreams PallasStreams commented Apr 8, 2015

@mwhitis I've been noticing this too. I'm not aware of any changes that should have affected this, but I'll look into it.

@sayedihashimi any suggestions on what might have made this change?

@kentcooper
Copy link
Member

@kentcooper kentcooper commented Apr 9, 2015

Strange thing is that F# template shouldn't even be included. It's suppose to exclude templates that start with an underscore.

@sayedihashimi
Copy link
Member

@sayedihashimi sayedihashimi commented Apr 9, 2015

Can you try it with the latest version from sidewaffle.com? I just downloaded and cannot repro it. Maybe we published a bad build out there. That shouldn't happen anymore since we have now automated the publish process.

@kentcooper
Copy link
Member

@kentcooper kentcooper commented Apr 9, 2015

I can reproduce it. It only happens for me on Web Projects though.

sayedihashimi added a commit that referenced this issue Apr 9, 2015
@sayedihashimi
Copy link
Member

@sayedihashimi sayedihashimi commented Apr 9, 2015

I just deleted the item template. It was just a sample anyway.

@sayedihashimi
Copy link
Member

@sayedihashimi sayedihashimi commented Apr 9, 2015

Once the release build https://ci.appveyor.com/project/sayedihashimi/side-waffle/build/1.0.184 completes it should be published, will close after I verify it.

@kentcooper
Copy link
Member

@kentcooper kentcooper commented Apr 9, 2015

I did some digging on TemplateBuilder and it doesn't actually exclude templates that start with underscore. It excludes templates that start with _Sample. I tried it on my local and Add Class is still broken. It just picks the Visual Basic template now instead of the F# one.

@sayedihashimi
Copy link
Member

@sayedihashimi sayedihashimi commented Apr 9, 2015

@kentcooper oh ok, my bad.

@kentcooper
Copy link
Member

@kentcooper kentcooper commented Apr 9, 2015

@sayedihashimi okay so I messed around with this for the past couple hours and as far as I can tell it has to do with the order the languages are displayed in. In a web project with SideWaffle installed for whatever reason the non native language is displayed first. And it seems that add>class is trying to pick a template called Class from the first language in the list and the class template isn't there.

@PallasStreams PallasStreams removed their assignment Apr 9, 2015
@sayedihashimi
Copy link
Member

@sayedihashimi sayedihashimi commented Apr 9, 2015

Yeah Web projects have a custom implementation for Add Class. It seems like there may be an issue with that. I've never heard it reported before so I think it's not a common scenario.

Here is a build with that sample template included https://dl.dropboxusercontent.com/u/40134810/SideWaffle/issue-251/TemplatePack-582e9f55.vsix.

@kentcooper
Copy link
Member

@kentcooper kentcooper commented Apr 9, 2015

Well I have a potential work around. If you use the AppliesTo element in the template definition to actually filter the languages so that the VB templates aren't showing up on the C# project and vice versa than it seems to resolve the problem. Problem is that's a lot of templates that need updating.

@sayedihashimi
Copy link
Member

@sayedihashimi sayedihashimi commented Apr 9, 2015

I didn't realize AppliesTo would make VB templates show up for C#. I thought AppliesTo was about the project type, so that is strange.

@kentcooper
Copy link
Member

@kentcooper kentcooper commented Apr 9, 2015

Well most of the AppliesTo elements on the Web and Misc types are set to <AppliesTo>ABC | (!ABC)</AppliesTo> Which causes them to show up in the New Item Dialog for every project type. If we change that to <AppliesTo>CSharp</AppliesTo> in the CSharp.vstemplate and <AppliesTo>VisualBasic</AppliesTo> in the VB.vstemplate files that would cause them not to show up in the dialog except for the specific projects.

@sayedihashimi
Copy link
Member

@sayedihashimi sayedihashimi commented Apr 9, 2015

@kentcooper ok I think I see what you are saying.

Here is what I think we should do.

  • Update csharp templates applies to to <AppliesTo>!VisualBasic</AppliesTo>
  • Update vb templates applies to to <AppliesTo>!csharp</AppliesTo>

That way the templates still show up for cordova and asp.net 5.

@sayedihashimi
Copy link
Member

@sayedihashimi sayedihashimi commented Apr 9, 2015

The script I used to update the element is at https://gist.github.com/sayedihashimi/fd04142e167fffef514b maybe we could use that to achieve the items above?

@mwhitis
Copy link
Author

@mwhitis mwhitis commented Apr 9, 2015

@kentcooper , @sayedihashimi

Thanks for the quick turnaround on this!

@sayedihashimi
Copy link
Member

@sayedihashimi sayedihashimi commented Apr 22, 2015

@kentcooper I noticed you used <AppliesTo>!VB</AppliesTo> instead of <AppliesTo>!VisualBasic</AppliesTo> was that on purpose, does it work?

@kentcooper
Copy link
Member

@kentcooper kentcooper commented Apr 26, 2015

@sayedihashimi yes it was on purpose. I messed it up when it posted it before. Oh and yes it does work I just tested again just to make sure.

@sayedihashimi
Copy link
Member

@sayedihashimi sayedihashimi commented Apr 26, 2015

@kentcooper ok just checking that everything is good thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants
You can’t perform that action at this time.