Skip to content
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

Fix UI freeze due to extract to local computations #1186

Merged
merged 2 commits into from
Feb 10, 2024

Conversation

jjohnstn
Copy link
Contributor

@jjohnstn jjohnstn commented Feb 9, 2024

  • fixes UI lag: ChangedValueChecker.hasConflict() #1185
  • don't run checkFinalConditions() from QuickAssistProcessor to see if extract to local variable proposals are valid
  • override the preview for extract to local variable and extract to local variable (replace all occurrences) so they just display a message instead of creating the change
  • fix ExtractTempRefactoring.checkFinalConditions() to recognize an invalid change in which case add an error status with a code that is RefactoringStatus.INFO
  • modify RefactoringCorrectionProposalCore to recognize an error refactoring status in which case create a dummy edit and if the INFO code is found, then also create a log entry to note that the extraction will not occur
  • fix AssistQuickFixTest tests proposal counts

What it does

Fixes UI freezes in quick assist processor due to Extract to local variable proposal logic by replacing the preview with a message and also reverting the logic of #1176 to not show invalid proposals.

How to test

Hover over selections that might be extracted to local variable and note the time lag.

Author checklist

- fixes eclipse-jdt#1185
- don't run checkFinalConditions() from QuickAssistProcessor to see if
  extract to local variable proposals are valid
- override the preview for extract to local variable and extract to
  local variable (replace all occurrences) so they just display a
  message instead of creating the change
- fix ExtractTempRefactoring.checkFinalConditions() to recognize an
  invalid change in which case add an error status with a code that
  is RefactoringStatus.INFO
- modify RefactoringCorrectionProposalCore to recognize an error
  refactoring status in which case create a dummy edit and if
  the INFO code is found, then also create a log entry to note that
  the extraction will not occur
- fix AssistQuickFixTest tests proposal counts
@jjohnstn jjohnstn self-assigned this Feb 9, 2024
@jjohnstn jjohnstn added bug Something isn't working performance Issues related to performance. labels Feb 9, 2024
@jjohnstn jjohnstn added this to the 4.31 M3 milestone Feb 9, 2024
- change error code to fatal
- check if LinkedProposalModel not null before clearing
- use RefactoringStatusCodes instead of making one up
@jjohnstn jjohnstn merged commit fe167c1 into eclipse-jdt:master Feb 10, 2024
4 of 7 checks passed
@jjohnstn jjohnstn deleted the fixuifreeze branch February 10, 2024 04:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working performance Issues related to performance.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI lag: ChangedValueChecker.hasConflict()
1 participant