-
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
Component debugger #738
Component debugger #738
Conversation
- add data source to obtain command line args - use data source in extension method - extract out shared logic into launchsettingsmanager - clean up VM code
@davkean here's the cleaned up implementation based on yesterdays work. It's still using the 'private' rule name, but otherwise I think is ready to go. Would you mind casting your eye over it again to make sure it's still doing things correctly? |
namespace Roslyn.ComponentDebugger | ||
{ | ||
[Export(typeof(IDebugProfileLaunchTargetsProvider))] | ||
[AppliesTo(Constants.RoslynComponentCapability)] |
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.
Do we want to update the projects in the templates to have this capability?
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.
src/VisualStudio.Roslyn.SDK/ComponentDebugger/DebugProfileProvider.cs
Outdated
Show resolved
Hide resolved
src/VisualStudio.Roslyn.SDK/ComponentDebugger/DebuggerOptionsViewModel.cs
Outdated
Show resolved
Hide resolved
src/VisualStudio.Roslyn.SDK/ComponentDebugger/DebuggerOptionsViewModel.cs
Outdated
Show resolved
Hide resolved
src/VisualStudio.Roslyn.SDK/ComponentDebugger/DebuggerOptionsViewModel.cs
Outdated
Show resolved
Hide resolved
src/VisualStudio.Roslyn.SDK/ComponentDebugger/DebuggerOptionsViewModel.cs
Outdated
Show resolved
Hide resolved
src/VisualStudio.Roslyn.SDK/ComponentDebugger/DebuggerOptionsViewModel.cs
Outdated
Show resolved
Hide resolved
src/VisualStudio.Roslyn.SDK/ComponentDebugger/CommandLineArgumentsDataSource.cs
Outdated
Show resolved
Hide resolved
private readonly IActiveConfiguredProjectSubscriptionService activeProjectSubscriptionService; | ||
|
||
[ImportingConstructor] | ||
public CommandLineArgumentsDataSource(IProjectThreadingService projectThreadingService, IActiveConfiguredProjectSubscriptionService activeProjectSubscriptionService) |
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.
public CommandLineArgumentsDataSource(IProjectThreadingService projectThreadingService, IActiveConfiguredProjectSubscriptionService activeProjectSubscriptionService) | |
public CommandLineArgumentsDataSource(IProjectThreadingServicea? projectThreadingService, IActiveConfiguredProjectSubscriptionService activeProjectSubscriptionService) |
Given the projectThreadingService?.
below this seems to be the correct annotation
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.
Hmm, its not. the ?
is just to shut up the analyzer which doesn't seem to be nullable aware :/
I'll explicitly suppress it though, to make it clear.
|
||
public const string CommandName = "DebugRoslynComponent"; | ||
|
||
public const string TargetProjectPropertyName = "targetProject"; |
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.
Is this an MSBuild property? If so should be Pascal cased
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. Its the name of the property in the json launch settings file, which should be camelCased. I'll try and think of a clearer name.
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.
Ah okay, yeah camelCase is the only answer then.
|
||
private async Task<string?> GetCompilerRootAsync(SVsServiceProvider? serviceProvider) | ||
{ | ||
await _threadingService.SwitchToUIThread(); |
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.
Why do we not need a ConfigureAwait
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.
The explicit point of this is to change the captured context: .ConfigureAwait(true)
would be incorrect, .ConfigureAwait(false)
would be redundant, so the analyzer doesn't complain about it.
|
||
<!-- https://github.com/dotnet/roslyn-sdk/issues/730 : Localization --> | ||
<Label Margin="4,4,3,5">Target Project:</Label> | ||
<ComboBox Grid.Column="1" Margin="5,7,2,6" ItemsSource="{Binding ProjectNames}" SelectedIndex="{Binding SelectedProjectIndex, Mode=TwoWay}" /> |
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.
Chris is a WPF / XAM expert for the compiler team. That is my take away 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.
Haha, I used to be paid to write windows phone apps... sooo.
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.
Oh wow, I was joking ... but you are an expert. Now I know who to assign all our WPF bugs too ... ;)
private readonly UnconfiguredProject owningProject; | ||
private readonly IDebugTokenReplacer tokenReplacer; |
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.
private readonly UnconfiguredProject owningProject; | |
private readonly IDebugTokenReplacer tokenReplacer; | |
private readonly UnconfiguredProject _owningProject; | |
private readonly IDebugTokenReplacer _tokenReplacer; |
// check if the args contain the project as an analyzer ref | ||
foreach (var arg in await targetProjectUnconfigured.GetCompilationArgumentsAsync().ConfigureAwait(false)) | ||
{ | ||
if (arg.StartsWith("/analyzer", StringComparison.OrdinalIgnoreCase) |
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.
if (arg.StartsWith("/analyzer", StringComparison.OrdinalIgnoreCase) | |
if (arg.StartsWith("/analyzer:", StringComparison.OrdinalIgnoreCase) |
To be consistent with the StartsWith
above.
Follows on from #726.
CapabilityProvider
and we'll set it through the roslyn targets instead. I'll issue a follow up PR on the roslyn side