-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[SourceKit] Include generated macro buffers in diagnostic responses #65472
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
test/SourceKit/DocumentStructure/structure.swift.empty.response
Outdated
Show resolved
Hide resolved
test/SourceKit/DocumentStructure/structure.swift.empty.response
Outdated
Show resolved
Hide resolved
if (auto Info = SM.getGeneratedSourceInfo(*BufferID)) { | ||
// Don't include this information for replaced function body buffers, as | ||
// they'll just be referencing the original file. | ||
// FIXME: Does this mean that the location information we'll be giving |
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.
ReplacedFunctionBody
only happens for completion/cursor info at the moment. So we should never end up with that case here. You could add an assertion if you want.
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.
We actually hit this case when doing multiple compile
requests
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.
Oh interesting. @rintaro despite you just talking compile
I didn't think about it here. It does seem like we would be messing up diagnostics then, do we actually send diagnostics back there?
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. But I didn't think much about diagnostics for compile
requests. In our intended use cases, I thought we only wanted to know if there's any error or not (succeeded or not). But anyway compile
request hasn't been maintained well, and probably requires major refinements.
3e86ff3
to
7983719
Compare
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 reasonable to me
7f89aa8
to
9570c77
Compare
8714415
to
968ceb3
Compare
Use this to simplify the writing of ranges into SourceKit responses.
This could cause us to double up on the same note for nested macro expansions, as we'd generate the note, then when recursing back through the function we'd compute the same note again. Also remove the seemingly unused `lastBufferID` param.
Introduce a new key `generated_buffers`, which stores an array of generated buffers. These include the buffer text, as well as its original location and any parent buffers. While here, also fix rdar://107281079 such that only apply the filename fallback logic to the pretty-printed Decl case. We ought to remove this fallback once the editor can handle it though. rdar://107281079 rdar://107952288
@swift-ci please test |
Are the double diagnostics fixed after #65519? |
Yeah, I updated the tests |
Introduce a new key
generated_buffers
, which stores an array of generated buffers. These include the buffer text, as well as its original location and any parent buffers.While here, also fix rdar://107281079 such that only apply the filename fallback logic to the pretty-printed Decl case. We ought to remove this fallback once the editor can handle it though.
rdar://107281079
rdar://107952288