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

Allow to customize the insertion location for the code generated by source actions #1713

Merged
merged 1 commit into from
Apr 9, 2021

Conversation

testforstephen
Copy link
Contributor

@testforstephen testforstephen commented Apr 1, 2021

Add a preference "java.codeGeneration.insertionLocation" to control the location where the generated code via source actions is inserted.

Below are allowed values:

  • "lastMember" - Insert the generated code as the last member of the target type.
  • "beforeCursor" - Insert the generated code before the member where the cursor is located.
  • "afterCursor" - Insert the generated code after the member where the cursor is located. This is the default behavior.

And this preference only applies to the source actions below:

  • Override/Implement Methods
  • Generate Getters and Setters
  • Generate hashCode() and equals()
  • Generate toString()
  • Generate Constructors
  • Generate Delegate Methods

@testforstephen
Copy link
Contributor Author

Here is a demo based on vscode client implementation.

Screen.Recording.2021-04-01.at.16.17.44.mov

Copy link
Contributor

@jdneo jdneo left a comment

Choose a reason for hiding this comment

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

Played around and LGTM.

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