[SourceKit] Map line and column using the latest snapshot #37547
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
During a cursor info request, the resolved offset was mapped to line and
column using the buffer inside
SwiftDocumentSyntaxInfo
.However, prior to 54683ca,
editorReplaceText
was not updating the syntax info. This meant thatsnapshots would be more up to date than the buffer in the syntax info,
allowing for the possibility of an invalid offset.
While 54683ca would also fix this,
snapshots actually have a
getLineAndColumn
anyway. Use that instead ofgrabbing the buffer from syntax info.
Resolves rdar://78161348.