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

Add initial support for java references for yaml #4698

Merged
merged 16 commits into from
Dec 6, 2024

Conversation

nielsdebruin
Copy link
Contributor

@nielsdebruin nielsdebruin commented Nov 21, 2024

What's changed?

This adds initial support for generating references to java type from a Yaml fine in a similar fashion, and with similar limitations, as in:

What's your motivation?

Adding this feature allows existing recipes that support references to be applied to .properties files. For more details see:

Anything in particular you'd like reviewers to focus on?

The focus points are almost on to one with the previously referenced implementation of references to Java type in .properties files.

Anyone you would like to review specifically?

@timtebeek @Laurens-W

Any additional context

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

@nielsdebruin nielsdebruin added the enhancement New feature or request label Nov 21, 2024
@nielsdebruin nielsdebruin self-assigned this Nov 21, 2024
@nielsdebruin nielsdebruin changed the title Add initial support for java references for yaml scalars Add initial support for java references for yaml Nov 21, 2024
@nielsdebruin nielsdebruin linked an issue Nov 21, 2024 that may be closed by this pull request
@nielsdebruin nielsdebruin marked this pull request as ready for review November 22, 2024 09:50
Copy link
Contributor

@knutwannheden knutwannheden left a comment

Choose a reason for hiding this comment

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

I would have expected this PR to only contain the SourceFileWithReferences implementation in Yaml.Documents and not a generic Reference.Provider implementation. But possibly I have missed something here.

@timtebeek
Copy link
Contributor

I'd applied some light polish to the parallel PR in 713ced2 ; would be good to apply those same changes here as well, and resolve the conflicts.

# Conflicts:
#	rewrite-java-test/src/test/java/org/openrewrite/java/ChangeTypeTest.java
#	rewrite-java/src/main/java/org/openrewrite/java/TypeMatcher.java
@knutwannheden
Copy link
Contributor

Yes, would be good to update this PR now that the dust has settled a bit regarding the rename refactoring.

# Conflicts:
#	rewrite-java/src/main/java/org/openrewrite/java/PackageMatcher.java
#	rewrite-java/src/main/java/org/openrewrite/java/TypeMatcher.java
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Contributor

@knutwannheden knutwannheden left a comment

Choose a reason for hiding this comment

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

Left a few small comments.

Copy link
Contributor

@timtebeek timtebeek left a comment

Choose a reason for hiding this comment

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

Great to see this added! Any last concerns before we merge @knutwannheden ?

@timtebeek timtebeek merged commit 104f705 into main Dec 6, 2024
2 checks passed
@timtebeek timtebeek deleted the 4681-expand-reference-to-include-yaml branch December 6, 2024 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Expand Reference to include .properties and .yml
4 participants