Skip to content

[5.6] Revert "[SourceKit] Don't build an AST if no semantic info is requested" #40496

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

ahoppen
Copy link
Member

@ahoppen ahoppen commented Dec 10, 2021

Cherry-pick #40491 to release/5.6.


Reverts #40353


The change actually wasn’t correct because we didn’t consider the following scenario:

  • The client makes an edit and had key_enablesyntaxmap = key_enablesubstructure = key_enablediagnostics = 0 and
    syntax tree transfer mode set to off
  • The request returned immediately without providing semantic information but build an AST in the background
  • The client would later retrieve diagnostics using a 0,0 replace text request that had key_enablediagnostics = 1. That request doesn’t cause the AST to rebuild but just returns the latest semantic information.

With the PR that is being reverted we wouldn’t build an AST at all and thus we won’t have any diagnostics to return from the 0,0 replace text request.

rdar://86289587

@ahoppen
Copy link
Member Author

ahoppen commented Dec 10, 2021

@swift-ci Please smoke test

@ahoppen
Copy link
Member Author

ahoppen commented Dec 10, 2021

@swift-ci Please test

@ahoppen ahoppen changed the title Revert "[SourceKit] Don't build an AST if no semantic info is requested" [5.6] Revert "[SourceKit] Don't build an AST if no semantic info is requested" Dec 10, 2021
@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 5260d65

@ahoppen
Copy link
Member Author

ahoppen commented Dec 10, 2021

@swift-ci Please test macOS

@ahoppen ahoppen requested a review from akyrtzi December 10, 2021 17:01
@akyrtzi akyrtzi merged commit da89807 into swiftlang:release/5.6 Dec 10, 2021
@ahoppen ahoppen deleted the pr-5.6/revert-no-semantic-info-if-not-requested branch January 25, 2022 10:48
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.

3 participants