-
Notifications
You must be signed in to change notification settings - Fork 146
Lower severity of source-symbol-not-found diagnostic #966
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
Lower severity of source-symbol-not-found diagnostic #966
Conversation
…ationship is missing
…relationship is missing. Since the solution is for the tool that created the symbol graph file to not emit that relationship, DocC can safely skip it and proceed with the build. This issue isn't severe enough to fail the build.
@swift-ci please test |
source: nil, severity: .warning, range: nil,identifier: "org.swift.docc.SymbolNodeNotFound", | ||
summary: "Source symbol \(relationship.source.singleQuoted) not found locally, from \(relationship.kind.rawValue.singleQuoted) relationship to \(relationship.target.singleQuoted)", | ||
explanation: """ | ||
The "source" of a symbol graph relationship should always refer to a symbol in the same symbol graph file. |
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.
One thing we might want to consider here is direct the user to file a bug report on Swift/Clang with information that can help diagnose the issue (in our case, the symbol graph file or at least a portion of it).
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.
Yes, I was thinking of that but at the point where we're creating these diagnostics we no longer know which symbol graph file a given relationship came from.
We could include information about how to report an issue for both Swift and Clang and let the developer decide which to file a bug report on.
After an offline discussion about this PR I've further reduced the severity to a debug-only assertion in 2e64b4b. |
@swift-ci please test |
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.
Looks great! I'm glad we're taking out this error; it's confusing and unactionable, and creates a situation where an issue in other tools causes Swift-DocC to fail, when it could just as easily continue on.
@swift-ci please test |
Bug/issue #, if applicable:
Summary
This PR makes two changes to the diagnostic when the source symbol of a symbol graph relationship can't be found:
Since the solution to this issue is for the tool that created the symbol graph file to not include this relationship (or move it to a different file), it's safe for DocC to proceed without processing this symbol graph relationship.
Dependencies
None.
Testing
Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
AddedUpdated tests./bin/test
script and it succeededUpdated documentation if necessaryNot applicable