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

Refactor ChangeUtil: universal API converting Change to WorkspaceEdit #1106

Merged
merged 4 commits into from
Jul 15, 2019

Conversation

Eskibear
Copy link
Contributor

Currently for each type of Change, there's a corresponding public method located in ChangeUtil, which is not elegant or consistent. E.g.

  • void convertCompositeChange(Change change, WorkspaceEdit edit)
  • void convertResourceChange(ResourceChange resourceChange, WorkspaceEdit edit)
  • void convertTextChange(WorkspaceEdit root, IJavaElement element, TextChange textChange)
  • etc.

Anytime you want to convert a Change to a WorkspaceEdit, you have to explicitly call the corresponding utility based on the type of Change.

This PR refactors the utility and use ChangeUtil.convertToWorkspaceEdit(Change change) as the only entry to convert Change to WorkspaceEdit.

Copy link
Contributor

@testforstephen testforstephen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@fbricon fbricon added the debt label Jul 15, 2019
@fbricon fbricon added this to the Mid July 2019 milestone Jul 15, 2019
@fbricon fbricon merged commit 9f7687e into eclipse-jdtls:master Jul 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants