Skip to content

Conversation

@benlangmuir
Copy link
Contributor

When performing an insertion (replacement length = 0) inside an existing
annotation, we were forming a closed range instead of a half-open range,
causing us to shift the effected token instead of throwing it out. There
were also no tests for this functionality, so add a bunch of annotations
tests.

One area thing that is not tested is what if there have been multiple
edits since the tokens were created. This is difficult to engineer,
because right now making an edit immediately removes the semantic tokens
and returns them. It could happen if the AST build takes longer than the
edits, but there is no way to guarantee that in the current API.

rdar://65748892

When performing an insertion (replacement length = 0) inside an existing
annotation, we were forming a closed range instead of a half-open range,
causing us to shift the effected token instead of throwing it out. There
were also no tests for this functionality, so add a bunch of annotations
tests.

One area thing that is not tested is what if there have been multiple
edits since the tokens were created. This is difficult to engineer,
because right now making an edit immediately removes the semantic tokens
and returns them. It could happen if the AST build takes longer than the
edits, but there is no way to guarantee that in the current API.

rdar://65748892
@benlangmuir
Copy link
Contributor Author

@swift-ci please test

@benlangmuir benlangmuir requested review from akyrtzi and nathawes July 21, 2020 00:06
@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 01b5cf7

@benlangmuir
Copy link
Contributor Author

@swift-ci please test macOS

@benlangmuir benlangmuir merged commit e9c3157 into swiftlang:master Jul 21, 2020
@benlangmuir benlangmuir deleted the editing-fun branch July 21, 2020 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants