-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[SymbolGraphGen] allow SourceKit to print declarations for private stdlib symbols #64556
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
Conversation
Resolves rdar://103112656 Resolves #62457
@swift-ci Please test |
@@ -0,0 +1,9 @@ | |||
// RUN: %sourcekitd-test -req=cursor -req-opts=retrieve_symbol_graph=1 -pos=8:13 %s -- %s |
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 it be useful to check the response here as well?
Also, not required, but I find it easier to follow if the RUN
line is right above the place where you invoke sourcekitd
test and then uses -pos=%(line + 1):13
. That also makes it easier to edit the file because adding new lines above the cursor info position doesn’t shift everything around.
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.
I thought about editing the test to give it a relative line number, but i also copied the test verbatim from the issue, so i didn't want to mess with it too much. 🤷♀️
It would be simple enough to check the response, but IMO the important thing here is that we don't crash.
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.
Makes sense to me 👍🏽
@swift-ci Please test macOS |
} | ||
|
||
func test(lhs: AnyError) { | ||
lhs.error._code |
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.
Could you add some checks that the symbol graph looks reasonable? Could name the test something like private-stdlib-symbol-graph.swift
.
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.
Ah I see Alex beat me to that. I really do think the response is more relevant than the fact it crashed here.
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.
I've added some lines to test the declaration fragments, since that's what was crashing SymbolGraphGen.
@swift-ci Please test |
…dlib symbols (swiftlang#64556) Resolves rdar://103112656 Resolves swiftlang#62457
Resolves rdar://103112656
Resolves #62457
When SourceKit gets a cursor symbol graph for an internal stdlib symbol, the declaration fragment printer hits an assertion because it hasn't actually printed anything. This is because the PrintOptions used by the printer sets
SkipPrivateStdlibDecls
andSkipUnderscoredStdlibProtocols
. This is useful when generating a whole-module symbol graph, but is causing problems for SourceKit. This PR adds an option to SymbolGraphOptions that turns those options off for SourceKit, so that these symbols can get a symbol graph correctly generated.