-
Notifications
You must be signed in to change notification settings - Fork 256
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
Update component debugger to work for VS 2022 #896
Merged
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/VisualStudio.Roslyn.SDK/ComponentDebugger/ComponentDebuggerLaunchProfile.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<Rule Name="MyLaunchProfile" | ||
Description="Allows a user to debug a Roslyn Component by running it in the context of another projects build." | ||
DisplayName="Roslyn Component" | ||
PageTemplate="commandNameBasedDebugger" | ||
xmlns:sys="clr-namespace:System;assembly=mscorlib" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns="http://schemas.microsoft.com/build/2009/properties"> | ||
|
||
<Rule.Metadata> | ||
<sys:String x:Key="CommandName">DebugRoslynComponent</sys:String> | ||
|
||
<!-- KnownImageIds.ImageCatalogGuid --> | ||
<sys:Guid x:Key="ImageMonikerGuid">AE27A6B0-E345-4288-96DF-5EAF394EE369</sys:Guid> | ||
|
||
<!-- KnownImageIds.Execute --> | ||
<sys:Int32 x:Key="ImageMonikerId">3644</sys:Int32> | ||
</Rule.Metadata> | ||
|
||
<Rule.DataSource> | ||
<DataSource Persistence="LaunchProfile" | ||
HasConfigurationCondition="False" | ||
ItemType="LaunchProfile"/> | ||
</Rule.DataSource> | ||
|
||
<DynamicEnumProperty Name="targetProject" | ||
DisplayName="Target Project" | ||
Description="A project that uses this component, whose compilation will be debugged." | ||
EnumProvider="TargetProjectEnumProvider" /> | ||
|
||
<StringProperty Name="Description" | ||
Description="A Roslyn Component can be debugged in the context of compiling a second project that uses it. Ensure your target project is referencing this component for it to appear in the list."> | ||
<StringProperty.DataSource> | ||
<DataSource PersistedName="Description" | ||
Persistence="ProjectFileWithInterception" | ||
HasConfigurationCondition="False" /> | ||
</StringProperty.DataSource> | ||
<StringProperty.ValueEditors> | ||
<ValueEditor EditorType="Description" /> | ||
</StringProperty.ValueEditors> | ||
</StringProperty> | ||
|
||
</Rule> |
19 changes: 0 additions & 19 deletions
19
src/VisualStudio.Roslyn.SDK/ComponentDebugger/DebuggerOptions.xaml
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
src/VisualStudio.Roslyn.SDK/ComponentDebugger/DebuggerOptions.xaml.cs
This file was deleted.
Oops, something went wrong.
61 changes: 0 additions & 61 deletions
61
src/VisualStudio.Roslyn.SDK/ComponentDebugger/DebuggerOptionsViewModel.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 0 additions & 101 deletions
101
src/VisualStudio.Roslyn.SDK/ComponentDebugger/LaunchSettingsProvider.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/VisualStudio.Roslyn.SDK/ComponentDebugger/RuleExporter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using Microsoft.VisualStudio.ProjectSystem; | ||
using Microsoft.VisualStudio.ProjectSystem.Properties; | ||
|
||
namespace Roslyn.ComponentDebugger | ||
{ | ||
internal static class RuleExporter | ||
{ | ||
/// <summary> | ||
/// Used to export the XAML rule via MEF | ||
/// </summary> | ||
[ExportPropertyXamlRuleDefinition( | ||
xamlResourceAssemblyName: "Roslyn.ComponentDebugger, Version=" + AssemblyVersion.Version + ", Culture=neutral, PublicKeyToken=31bf3856ad364e35", | ||
xamlResourceStreamName: "XamlRuleToCode:ComponentDebuggerLaunchProfile.xaml", | ||
context: PropertyPageContexts.Project)] | ||
[AppliesTo(Constants.RoslynComponentCapability)] | ||
#pragma warning disable CS0649 | ||
public static int LaunchProfileRule; | ||
#pragma warning restore CS0649 | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🤢This is unpleasant, but required for the rules. It seems overkill to make it a generator, but I'm considering writing one to handle the whole rule injection which would remove a lot of the ceremony needed here.
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.
I would prefer a source generator here. Nerdbank.GitVersioning might allow this to be automated without a source generator or project file changes.
@AArnott does NB.GV support setting the AssemblyVersion via the project file instead of the normal approach of automatically determining it from the repo history?
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.
No. NB.GV will steamroll any
AssemblyVersion
property you set with the discovered version.If you wrote build authoring to execute your target in between
GenerateAssemblyVersionInfo
andGetBuildVersion
then you could rewrite that property. But that strikes me as making your car float instead of building a boat.Have you considered letting NB.GV do its thing? 😉
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.
Updated to use a SG