-
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
Include CodeLens on remaining types and members #69608
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,7 @@ public override void VisitInterfaceDeclaration(InterfaceDeclarationSyntax node) | |
public override void VisitEnumDeclaration(EnumDeclarationSyntax node) | ||
{ | ||
_memberBuilder.Add(new CodeLensMember(node, node.Identifier.Span)); | ||
base.VisitEnumDeclaration(node); | ||
} | ||
|
||
public override void VisitPropertyDeclaration(PropertyDeclarationSyntax node) | ||
|
@@ -83,5 +84,41 @@ public override void VisitRecordDeclaration(RecordDeclarationSyntax node) | |
_memberBuilder.Add(new CodeLensMember(node, node.Identifier.Span)); | ||
base.VisitRecordDeclaration(node); | ||
} | ||
|
||
public override void VisitDelegateDeclaration(DelegateDeclarationSyntax node) | ||
{ | ||
_memberBuilder.Add(new CodeLensMember(node, node.Identifier.Span)); | ||
} | ||
|
||
public override void VisitEnumMemberDeclaration(EnumMemberDeclarationSyntax node) | ||
{ | ||
_memberBuilder.Add(new CodeLensMember(node, node.Identifier.Span)); | ||
} | ||
|
||
public override void VisitFieldDeclaration(FieldDeclarationSyntax node) | ||
{ | ||
foreach (var variable in node.Declaration.Variables) | ||
{ | ||
_memberBuilder.Add(new CodeLensMember(variable, variable.Identifier.Span)); | ||
} | ||
} | ||
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.
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.
I'm not sure how to test the UI in VS Code, but I would expect it to be able to handle this since today it's already possible to declare multiple properties on the same line of code.
This has no impact on Visual Studio. This is a VS Code feature. 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.
@dibarbet can you guide sam on this? 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.
If you mean seeing the actual code lens items inside vscode, it should be relatively straightforward. Basically:
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. |
||
|
||
public override void VisitEventFieldDeclaration(EventFieldDeclarationSyntax node) | ||
{ | ||
foreach (var variable in node.Declaration.Variables) | ||
{ | ||
_memberBuilder.Add(new CodeLensMember(variable, variable.Identifier.Span)); | ||
} | ||
} | ||
|
||
public override void VisitEventDeclaration(EventDeclarationSyntax node) | ||
{ | ||
_memberBuilder.Add(new CodeLensMember(node, node.Identifier.Span)); | ||
} | ||
|
||
public override void VisitDestructorDeclaration(DestructorDeclarationSyntax node) | ||
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. note: won't ever have results. so this may be likely to annoy people as it will always have "0 references" showing for it. Would prefer to not do this. 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. I think that's fine, for a few reasons:
|
||
{ | ||
_memberBuilder.Add(new CodeLensMember(node, node.Identifier.Span)); | ||
} | ||
} | ||
} |
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.
definitely approve of this.