Skip to content

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

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

Merged
merged 1 commit into from
Dec 10, 2021

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Dec 9, 2021

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 ahoppen requested a review from akyrtzi December 9, 2021 20:25
@ahoppen
Copy link
Member Author

ahoppen commented Dec 9, 2021

@swift-ci Please smoke test

@bnbarham bnbarham self-requested a review December 10, 2021 00:36
@bnbarham bnbarham merged commit 9dabad4 into main Dec 10, 2021
@bnbarham bnbarham deleted the revert-40353-pr/no-semantic-info-if-not-requested branch December 10, 2021 00:39
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.

2 participants