-
Notifications
You must be signed in to change notification settings - Fork 304
Show container name as the detail of a call hierarchy item #1165
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
Show container name as the detail of a call hierarchy item #1165
Conversation
@swift-ci Please test |
@@ -2472,14 +2472,28 @@ extension IndexSymbolKind { | |||
} | |||
} | |||
|
|||
fileprivate extension IndexSymbolKind { | |||
/// Whether this symbol should be considered as a container in `SymbolOccurrence.containerName` | |||
var isContainer: Bool { |
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.
Feels like this should have something to do with type in its name (though also includes module/namespace...) given it doesn't include functions. Same with containerName
.
Also union
should probably be included in the true
case either way.
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.
Would probably be best to avoid using the word container
too, to avoid confusion with the containedBy
relation. Maybe something like hasChildren
? Or canHaveChildren
?
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.
Really this is just: Should this be considered for containerName
and I think it’s actually easier to just have the switch
inside the filter
of containerName
.
@@ -2143,7 +2143,7 @@ extension SourceKitLSPServer { | |||
return CallHierarchyIncomingCall( | |||
from: indexToLSPCallHierarchyItem( | |||
symbol: related.symbol, | |||
moduleName: definitionSymbolLocation?.moduleName, | |||
containerName: definition?.containerName, |
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 module be the fallback if there is no container?
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, I think it’s better to leave the containerName
empty for top-level functions. That way it’s also easier to tell top-level functions apart from member functions.
The container name, showing the class a method is defined on, is more useful than the module name.
224900d
to
30bc65a
Compare
@swift-ci Please test |
@swift-ci Please test Windows |
@swift-ci Please test macOS |
@swift-ci Please test Windows |
The container name, showing the class a method is defined on, is more useful than the module name.