-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
open xaml file first in editor #1007
open xaml file first in editor #1007
Conversation
@jmarolf - Please start by opening an issue per guidelines. Let's discuss what you are trying to achieve and we can identify the appropriate solution, timelines etc. fromt there. Same goes for #1005 |
@debonte can you file an issue on this repo and talk to @vatsan-madhavan to justigy this change? |
@jmarolf, two thoughts on this change:
|
@vatsan-madhavan We have to do something about the Blend experience. It is not acceptable for Blend to open a C# file instead of a XAML file when creating a new project. Perhaps there is something we can do with the HostIdentifier condition to get one experience in Blend and another in VS. |
This change seems righteous, we should be striving to have the right user experience in both VS and Blend.
@debonte i don't see a .vstemplate, but from the json schema it looks like you can have multiple |
@stevenbrix I'm not super-concerned where it's done. I just thought the .NET Core SDK team might not want to encode VS/Blend-specific behavior in their templates. I think HostIdentifier may currently be a fixed value for both VS and Blend (VSConfigurationHelpers.DefaultHostId), so I think that would need to be changed first. Btw, from @jmarolf's changes it's not clear to me if its the primaryOutputs or the postActions that actually determines which files are opened.
Look for Wpf.vstemplate either under c:\Program Files (x86)\Microsoft Visual Studio<vs-instance>\Common7\IDE\Extensions or %LOCALAPPDATA%\Microsoft\VisualStudio<vs-instance-id> |
Ah ok i see, i thought this was something in our repo, but those ship with VS.
I think this is a good general goal to strive for. How was this done in framework? |
The .NET Framework .vstemplates are self-contained. They don't call into the dotnet template engine. Those .vstemplates have metadata for each file that is generated, some of which specifies which files should be opened and in which order. See #1017 for a snippet that shows how it controls the MainWindow.xaml/MainWindow.xaml.cs behavior. |
I'll look and see if there is a way to get this behavior in the .NET Core templates. Today this is all the action is doing (essentially DTE.ItemOperations.OpenFile for a given list of files). |
I was able to spend some time looking over the C# template changes - I'll assume that the discussion extends to the VB template symmetrically. "open xaml file first in editor" is exactly what it seems to be doing - good so far. This is what I'm noticing overall relative to the spec #1017:
What kind of testing has this proposed change undergone? |
...oft.Dotnet.Wpf.ProjectTemplates/content/WpfApplication-CSharp/.template.config/template.json
Outdated
Show resolved
Hide resolved
OK, I guess I misunderstood. It looked like this change is needed to open the XAML file but you weren't going to take it because of the NO MERGE label. As long as the XAML file is active in Blend on File->New Project then it is just a minor issue that there is also a C# file in the background. We could address that in a separate issue. |
To clarify, the NO MERGE label was added because the PR didn't have issue description, what was being fixed, testing details etc, and we didn't want an accidental merge before Preview 7 completed. I also reached out @jmarolf by email asking for additional details, and explaining that we just had a regression in project templates and wanted to be careful in Preview 7. Once P7 is done, we'll remove the NO MERGE label. |
Sounds good, thank you. |
Removing NO MERGE since #1100 is completed and master has switched to Preview 8. This PR can continue on with usual due-diligence. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you decided that opening both .xaml
and .cs
simultaneously (with focus on .xaml
) will be an acceptable experience for Blend?
I just chatted with DoRon and as long as the .xaml file ends up being the active one then that would be acceptable for Blend. |
Thanks, that's good to know! @jmarolf, do you have a sense for when we can expect an update from you re: other open questions? |
@vatsan-madhavan ready for review |
@jmarolf - lgtm! |
fixes AB#832526