Skip to content

[5.3][CodeCompletion] Give up fast-completion if dependent files are modified #31547

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

rintaro
Copy link
Member

@rintaro rintaro commented May 4, 2020

  • Explanation: Fix a regression caused by fast-completion mode. Fast completion mode could not detect the modification in dependent files such as imported module file, header files in clang modules. Fix the problem by adding some logic to check if the decencies are modified
  • Scope: Code completion inside function bodies or single file scripts
  • Risk: Low-Mid. Increase chances to invalidate fast-completion. But the changes are closed in code completion, it should not affect other parts.
  • Issue: rdar://problem/62336432
  • Testing: Added regression test cases to check modifications are correctly propagated.
  • Reviewer: Ben Langmuir (@benlangmuir )

rintaro added 3 commits May 4, 2020 15:38
Check if dependencies are modified since the last checking.
Dependencies:

 - Other source files in the current module
 - Dependent files collected by the dependency tracker

When:

 - If the last dependency check was over N (defaults to 5) seconds ago

Invalidate if:

 - The dependency file is missing
 - The modification time of the dependecy is greater than the last check
 - If the modification time is zero, compare the content using the file
   system from the previous completion and the current completion

rdar://problem/62336432
(cherry picked from commit 05a87e8)
These test cases use shell variables etc.

(cherry picked from commit e32de78)
@rintaro rintaro requested a review from a team as a code owner May 4, 2020 22:40
@rintaro
Copy link
Member Author

rintaro commented May 4, 2020

@swift-ci Please test

@compnerd compnerd added the r5.3 label May 4, 2020
- Detect same file with bufferID instead of the file name
- Compare virtual in-memory filesystem content with hash value

(cherry picked from commit af5daed)
@rintaro rintaro force-pushed the 5.3-ide-completion-fastcheckdep-rdar62336432 branch from 15a80f1 to b00ef1b Compare May 4, 2020 23:46
@swift-ci
Copy link
Contributor

swift-ci commented May 4, 2020

Build failed
Swift Test Linux Platform
Git Sha - 15a80f1cfaba2dbe8745c4f85e3037420b076298

@swift-ci
Copy link
Contributor

swift-ci commented May 5, 2020

Build failed
Swift Test OS X Platform
Git Sha - 15a80f1cfaba2dbe8745c4f85e3037420b076298

@rintaro
Copy link
Member Author

rintaro commented May 5, 2020

@swift-ci Please test

@swift-ci
Copy link
Contributor

swift-ci commented May 5, 2020

Build failed
Swift Test Linux Platform
Git Sha - 15a80f1cfaba2dbe8745c4f85e3037420b076298

@swift-ci
Copy link
Contributor

swift-ci commented May 5, 2020

Build failed
Swift Test OS X Platform
Git Sha - 15a80f1cfaba2dbe8745c4f85e3037420b076298

@rintaro
Copy link
Member Author

rintaro commented May 5, 2020

@swift-ci Please nominate

1 similar comment
@rintaro
Copy link
Member Author

rintaro commented May 5, 2020

@swift-ci Please nominate

@rintaro rintaro merged commit 7cac40e into swiftlang:release/5.3 May 5, 2020
@rintaro rintaro deleted the 5.3-ide-completion-fastcheckdep-rdar62336432 branch May 5, 2020 17:53
@AnthonyLatsis AnthonyLatsis added swift 5.3 🍒 release cherry pick Flag: Release branch cherry picks labels Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 5.3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants