-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Use the same codepath for computing light-bulb actions to determine if hte lightbulb shoudl appear at all. #59599
Merged
CyrusNajmabadi
merged 27 commits into
dotnet:release/dev17.3
from
CyrusNajmabadi:firstFix
Mar 4, 2022
Merged
Changes from 11 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
e26c158
Extract method
CyrusNajmabadi 965a6be
Rename
CyrusNajmabadi 0b8bd0f
Simplify the code for getting the first fix to use to drive the light…
CyrusNajmabadi 2af54ee
Merge branch 'asyncFixes' into firstFix
CyrusNajmabadi aa353fe
Fixup tests
CyrusNajmabadi d7b9f03
Merge branch 'asyncFixes' into firstFix
CyrusNajmabadi 6667775
REstore
CyrusNajmabadi a0a88ae
Rename
CyrusNajmabadi a5d0270
Merge remote-tracking branch 'upstream/main' into firstFix
CyrusNajmabadi 8b5c1ac
Update tests
CyrusNajmabadi 103f92e
Fix test
CyrusNajmabadi 783f777
Delete comment
CyrusNajmabadi 7cce002
Clean up
CyrusNajmabadi d78637b
Merge remote-tracking branch 'upstream/main' into firstFix
CyrusNajmabadi 290b067
Move check to tests
CyrusNajmabadi 96cd892
Merge remote-tracking branch 'upstream/main' into firstFix
CyrusNajmabadi 3ddb4ef
Merge remote-tracking branch 'upstream/main' into firstFix
CyrusNajmabadi ea54284
Simplify
CyrusNajmabadi 52cd3a9
simplify
CyrusNajmabadi 3c7c77d
Named param
CyrusNajmabadi 7b23cee
Clean up docs
CyrusNajmabadi b6d7523
rename
CyrusNajmabadi a739368
Use multi-add
CyrusNajmabadi 1e14889
rename file
CyrusNajmabadi 61092f3
Merge remote-tracking branch 'upstream/main' into firstFix
CyrusNajmabadi 3e3e3fc
Merge remote-tracking branch 'upstream/main' into firstFix
CyrusNajmabadi 8f4c7f0
Merge remote-tracking branch 'upstream/release/dev17.3' into firstFix
CyrusNajmabadi 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,18 +6,18 @@ | |
using System.Collections.Generic; | ||
using System.Collections.Immutable; | ||
using System.ComponentModel.Composition; | ||
using System.Linq; | ||
using Microsoft.CodeAnalysis.CodeActions; | ||
using Microsoft.CodeAnalysis.CodeFixes; | ||
using Microsoft.CodeAnalysis.CodeRefactorings; | ||
using Microsoft.CodeAnalysis.Diagnostics; | ||
using Microsoft.CodeAnalysis.Editor.Shared.Extensions; | ||
using Microsoft.CodeAnalysis.Editor.Shared.Utilities; | ||
using Microsoft.CodeAnalysis.Editor.Tags; | ||
using Microsoft.CodeAnalysis.ErrorReporting; | ||
using Microsoft.CodeAnalysis.Host.Mef; | ||
using Microsoft.CodeAnalysis.Options; | ||
using Microsoft.CodeAnalysis.Shared.TestHooks; | ||
using Microsoft.CodeAnalysis.Shared.Utilities; | ||
using Microsoft.CodeAnalysis.Text; | ||
using Microsoft.VisualStudio.Language.Intellisense; | ||
using Microsoft.VisualStudio.Text; | ||
using Microsoft.VisualStudio.Text.Editor; | ||
|
@@ -37,6 +37,21 @@ namespace Microsoft.CodeAnalysis.Editor.Implementation.Suggestions | |
[SuggestedActionPriority(DefaultOrderings.Lowest)] | ||
internal partial class SuggestedActionsSourceProvider : ISuggestedActionsSourceProvider | ||
{ | ||
private static readonly ImmutableArray<string> s_orderings = ImmutableArray.Create( | ||
DefaultOrderings.Highest, | ||
DefaultOrderings.Default, | ||
DefaultOrderings.Lowest); | ||
|
||
static SuggestedActionsSourceProvider() | ||
{ | ||
// Ensure that the list of orderings on this type matches the set we expose in s_orderings | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for adding this! |
||
var attributes = typeof(SuggestedActionsSourceProvider).GetCustomAttributes(inherit: false) | ||
.OfType<SuggestedActionPriorityAttribute>() | ||
.ToImmutableArray(); | ||
Contract.ThrowIfFalse(attributes.Length == s_orderings.Length); | ||
Contract.ThrowIfFalse(attributes.Select(a => a.Priority).SetEquals(s_orderings)); | ||
} | ||
CyrusNajmabadi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
private static readonly Guid s_CSharpSourceGuid = new Guid("b967fea8-e2c3-4984-87d4-71a38f49e16a"); | ||
private static readonly Guid s_visualBasicSourceGuid = new Guid("4de30e93-3e0c-40c2-a4ba-1124da4539f6"); | ||
private static readonly Guid s_xamlSourceGuid = new Guid("a0572245-2eab-4c39-9f61-06a6d8c5ddda"); | ||
|
@@ -100,5 +115,14 @@ public SuggestedActionsSourceProvider( | |
? new AsyncSuggestedActionsSource(_threadingContext, _globalOptions, this, textView, textBuffer, _suggestedActionCategoryRegistry) | ||
: new SyncSuggestedActionsSource(_threadingContext, _globalOptions, this, textView, textBuffer, _suggestedActionCategoryRegistry); | ||
} | ||
|
||
private static CodeActionRequestPriority? TryGetPriority(string priority) | ||
=> priority switch | ||
{ | ||
DefaultOrderings.Highest => CodeActionRequestPriority.High, | ||
DefaultOrderings.Default => CodeActionRequestPriority.Normal, | ||
DefaultOrderings.Lowest => CodeActionRequestPriority.Lowest, | ||
_ => (CodeActionRequestPriority?)null, | ||
}; | ||
} | ||
} |
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
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
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.
should be viewed with whitespace off.