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

Provide file & type comments for newly created compilation units #2047

Merged
merged 1 commit into from
Apr 8, 2022

Conversation

rgrunber
Copy link
Contributor

@rgrunber rgrunber commented Apr 6, 2022

This works from the client side when creating a new file, but it never did when creating a compilation unit from a code action.

  • Use the file & type comments (java.templates.typeComment &
    java.templates.fileHeader) settings from the client to construct new
    compilation units
  • Initialize the "newtype" template which will use the file & type
    comment template values

Signed-off-by: Roland Grunberg [email protected]

file_and_type_comments

@rgrunber
Copy link
Contributor Author

rgrunber commented Apr 6, 2022

@snjeza , do you know if there's an easy way to test this ? It's not enough to just set the preferences prior to running. It's the underlying code template store (eg. JavaManipulation.getCodeTemplateStore() that needs to be updated.

@snjeza snjeza self-requested a review April 7, 2022 00:57
@rgrunber
Copy link
Contributor Author

rgrunber commented Apr 7, 2022

Thanks. I was trying to write a test in UnresolvedTypesQuickFixTest, but maybe it makes more sense to do it where you suggest. Also fixing the existing failures.

@rgrunber rgrunber force-pushed the file-and-type-comments branch 2 times, most recently from e3abb6e to 968bb0a Compare April 8, 2022 19:08
- Use the file & type comments (java.templates.typeComment &
  java.templates.fileHeader) settings from the client to construct new
  compilation units
- Initialize the "newtype" template which will use the file & type
  comment template values
- Add testcase

Signed-off-by: Roland Grunberg <[email protected]>
@rgrunber rgrunber force-pushed the file-and-type-comments branch from 968bb0a to 8c4646e Compare April 8, 2022 19:42
@rgrunber rgrunber added the bug label Apr 8, 2022
@rgrunber rgrunber added this to the Early April 2022 milestone Apr 8, 2022
@rgrunber rgrunber merged commit e3f5c74 into eclipse-jdtls:master Apr 8, 2022
@rgrunber rgrunber deleted the file-and-type-comments branch April 8, 2022 22:39
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.

2 participants