-
Notifications
You must be signed in to change notification settings - Fork 195
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
Add support for directive attribute descriptions #625
Conversation
- Updated the `RazorCompletionItem` type to no longer contain a `Documentation`/`Description` property because in completion scenarios descriptions are never readily available and don't make a lot of sense being on the completion item itself. This is also how Roslyn does completions. - We now utilize an item bag on `RazorCompletionItem`s to hold description data. Currently there's just two type of completion descriptions (directive and attribute). Based off of the completion item kind (directive or attribute) we can extract the appropriate description. The goal of this new description type was to represent all data for a completion in an unstructured way so each platform can display it using its own capabilities. - Added a description factory to convert description items into classified containers. Tried to replicate WTE's description look as much as possible. - Left out documentation parsing. Will do this at a later date; however directive attributes rarely have documentation specific pieces that require parsing so we handle the 90% case. - Updated existing tests to reflect the new documentation mechanisms for RazorCompletionItems. - Added new tests to validate the completion source and the description factory. dotnet/aspnetcore#6364
Merging this into the parameter completion PR, will address feedback on the base completion pr (the one for names) to avoid mass re-builds / delays. We're looking to get a VS insertion out today. |
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.
LGTM
// Microsoft.AspnetCore.Components. | ||
tagHelperTypeNamePrefix = tagHelperTypeName.Substring(0, afterLastDot); | ||
|
||
// And the type name looks like BindBinds |
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.
Typo
{ | ||
if (_items == null) | ||
{ | ||
lock (this) |
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.
Use explicit lock object?
} | ||
|
||
[Fact] | ||
public void GetAttributeParameterCompletions_ReturnsCompletion() | ||
{ | ||
// Arrange | ||
var expectedCompletion = new RazorCompletionItem("format", "format", string.Empty, RazorCompletionItemKind.DirectiveAttributeParameter); | ||
|
||
|
||
// Act |
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.
// Arrange & Act
RazorCompletionItem
type to no longer contain aDocumentation
/Description
property because in completion scenarios descriptions are never readily available and don't make a lot of sense being on the completion item itself. This is also how Roslyn does completions.RazorCompletionItem
s to hold description data. Currently there's just two type of completion descriptions (directive and attribute). Based off of the completion item kind (directive or attribute) we can extract the appropriate description. The goal of this new description type was to represent all data for a completion in an unstructured way so each platform can display it using its own capabilities.Note: This accomplishes bullet point six of dotnet/aspnetcore#6364 (comment)
dotnet/aspnetcore#6364