-
Notifications
You must be signed in to change notification settings - Fork 229
Better handle parameter attribute directive completion #12473
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
Merged
ToddGrun
merged 14 commits into
dotnet:main
from
ToddGrun:dev/toddgrun/BetterHandleParameterAttributeDirectiveCompletion
Nov 12, 2025
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
d1c179b
1) Move directive attribute parameter completion code to same file as…
ToddGrun 9c66e3b
Merge DirectiveAttributeParameterCompletionItemProvider into Directiv…
ToddGrun 1f23803
Remove ':' as commit char
ToddGrun 47f3598
1) Add DirectiveAttributeCompletionContext to simplify passing data a…
ToddGrun 0963699
Move logic for creating completion items to it's own method
ToddGrun 785f1e7
Change GetAttributeParameterCompletions to take in a context and prep…
ToddGrun 4744a9f
Add parameter completions as part of GetAttributeCompletions
ToddGrun ec82b01
Use indexers to contribute to parameter completions in attribute name…
ToddGrun aea0359
Fixup existing tests and remove a couple that no longer are applicabl…
ToddGrun 5b0dc82
Add new tests
ToddGrun b5a6da8
1) Fix test that didn't do what it claimed
ToddGrun 02c7a36
Add comment regarding indexer descriptor usage
ToddGrun e0c49d0
Ensure ExistingAttributes IA is never default
ToddGrun 60691c8
Require object initializer syntax instead of using big ctor
ToddGrun 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 hidden or 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
17 changes: 17 additions & 0 deletions
17
...Microsoft.CodeAnalysis.Razor.Workspaces/Completion/DirectiveAttributeCompletionContext.cs
This file contains hidden or 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,17 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using System.Collections.Immutable; | ||
|
|
||
| namespace Microsoft.CodeAnalysis.Razor.Completion; | ||
|
|
||
| internal record DirectiveAttributeCompletionContext | ||
| { | ||
| public required string SelectedAttributeName { get; init; } | ||
| public string? SelectedParameterName { get; init; } | ||
| public ImmutableArray<string> ExistingAttributes { get; init => field = value.NullToEmpty(); } = []; | ||
| public bool UseSnippets { get; init; } = true; | ||
| public bool InAttributeName { get; init; } = true; | ||
| public bool InParameterName { get; init; } | ||
| public RazorCompletionOptions Options { get; init; } | ||
| } |
440 changes: 276 additions & 164 deletions
440
...soft.CodeAnalysis.Razor.Workspaces/Completion/DirectiveAttributeCompletionItemProvider.cs
Large diffs are not rendered by default.
Oops, something went wrong.
127 changes: 0 additions & 127 deletions
127
...Analysis.Razor.Workspaces/Completion/DirectiveAttributeParameterCompletionItemProvider.cs
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Uh oh!
There was an error while loading. Please reload this page.