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

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

Comments

Projects
None yet
4 participants
@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.

@tylerbhughes

This comment has been minimized.

Show comment
Hide comment
@tylerbhughes

tylerbhughes Apr 8, 2015

Member

@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?

Member

tylerbhughes 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

This comment has been minimized.

Show comment
Hide comment
@kentcooper

kentcooper Apr 9, 2015

Member

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

Member

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

This comment has been minimized.

Show comment
Hide comment
@sayedihashimi

sayedihashimi Apr 9, 2015

Member

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.

Member

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

This comment has been minimized.

Show comment
Hide comment
@kentcooper

kentcooper Apr 9, 2015

Member

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

Member

kentcooper commented Apr 9, 2015

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

@sayedihashimi

This comment has been minimized.

Show comment
Hide comment
@sayedihashimi

sayedihashimi Apr 9, 2015

Member

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

Member

sayedihashimi commented Apr 9, 2015

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

@sayedihashimi

This comment has been minimized.

Show comment
Hide comment
@sayedihashimi

sayedihashimi Apr 9, 2015

Member

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.

Member

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

This comment has been minimized.

Show comment
Hide comment
@kentcooper

kentcooper Apr 9, 2015

Member

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.

Member

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

This comment has been minimized.

Show comment
Hide comment
@sayedihashimi

sayedihashimi Apr 9, 2015

Member

@kentcooper oh ok, my bad.

Member

sayedihashimi commented Apr 9, 2015

@kentcooper oh ok, my bad.

@kentcooper

This comment has been minimized.

Show comment
Hide comment
@kentcooper

kentcooper Apr 9, 2015

Member

@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.

Member

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.

@tylerbhughes tylerbhughes removed their assignment Apr 9, 2015

@sayedihashimi

This comment has been minimized.

Show comment
Hide comment
@sayedihashimi

sayedihashimi Apr 9, 2015

Member

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.

Member

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

This comment has been minimized.

Show comment
Hide comment
@kentcooper

kentcooper Apr 9, 2015

Member

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.

Member

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

This comment has been minimized.

Show comment
Hide comment
@sayedihashimi

sayedihashimi Apr 9, 2015

Member

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.

Member

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

This comment has been minimized.

Show comment
Hide comment
@kentcooper

kentcooper Apr 9, 2015

Member

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.

Member

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

This comment has been minimized.

Show comment
Hide comment
@sayedihashimi

sayedihashimi Apr 9, 2015

Member

@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.

Member

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

This comment has been minimized.

Show comment
Hide comment
@sayedihashimi

sayedihashimi Apr 9, 2015

Member

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?

Member

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

This comment has been minimized.

Show comment
Hide comment
@mwhitis

mwhitis Apr 9, 2015

@kentcooper , @sayedihashimi

Thanks for the quick turnaround on this!

mwhitis commented Apr 9, 2015

@kentcooper , @sayedihashimi

Thanks for the quick turnaround on this!

@sayedihashimi

This comment has been minimized.

Show comment
Hide comment
@sayedihashimi

sayedihashimi Apr 22, 2015

Member

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

Member

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

This comment has been minimized.

Show comment
Hide comment
@kentcooper

kentcooper Apr 26, 2015

Member

@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.

Member

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

This comment has been minimized.

Show comment
Hide comment
@sayedihashimi

sayedihashimi Apr 26, 2015

Member

@kentcooper ok just checking that everything is good thanks.

Member

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