openrewrite / openrewrite/rewrite

Recipe or Marker for Missing TypeAttribution

Open
#4,783 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
3.7k
Forks
570
Avg merge
13h 12m
Merged PRs (30d)
261

Description

What problem are you trying to solve?

In certain scenarios, OpenRewrite fails to add type attribution to some expressions. Currently, it does not provide any information about such expressions after parsing. When running a recipe on source files with these un-attributed expressions, it can result in inaccurate changes or recipe failures with exceptions.

Describe the solution you'd like

Similar to the FindParseFailures recipe, which generates a ParseError data table, we can introduce a TypeAttribution recipe. This recipe would scan all expressions with missing type attribution and generate a data table. This feature would help identify and debug issues in OpenRewrite's code. Additionally, when recipes make inaccurate changes, users could refer to this data table to rule out recipe-specific issues instead of having to analyze the recipe code.

Are you interested in [contributing this feature to OpenRewrite]

Yes

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the existing FindParseFailures recipe and its ParseError data table implementation, then trace how expressions expose missing type attribution after parsing. Done means a comparable TypeAttribution recipe reports all such expressions in a data table, with tests demonstrating the reported output.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.