Skip to content

Commit 806843d

Browse files
committed
Add FindSymbols
1 parent 4ce95cc commit 806843d

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

  • rewrite-java/src/main/resources/META-INF/rewrite

rewrite-java/src/main/resources/META-INF/rewrite/recipes.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ maven,org.openrewrite:rewrite-java,org.openrewrite.java.search.FindMethodDeclara
8383
maven,org.openrewrite:rewrite-java,org.openrewrite.java.search.FindMethods,Find method usages,Find method calls by pattern.,1,Search,Java,,Basic building blocks for transforming Java code.,"[{""name"":""methodPattern"",""type"":""String"",""displayName"":""Method pattern"",""description"":""A [method pattern](https://docs.openrewrite.org/reference/method-patterns) is used to find matching method invocations. For example, to find all method invocations in the Guava library, use the pattern: `com.google.common..*#*(..)`.<br/><br/>The pattern format is `<PACKAGE>#<METHOD_NAME>(<ARGS>)`. <br/><br/>`..*` includes all subpackages of `com.google.common`. <br/>`*(..)` matches any method name with any number of arguments. <br/><br/>For more specific queries, like Guava's `ImmutableMap`, use `com.google.common.collect.ImmutableMap#*(..)` to narrow down the results."",""example"":""java.util.List add(..)"",""required"":true},{""name"":""matchOverrides"",""type"":""Boolean"",""displayName"":""Match on overrides"",""description"":""When enabled, find methods that are overrides of the method pattern.""}]","[{""name"":""org.openrewrite.java.table.MethodCalls"",""displayName"":""Method calls"",""description"":""The text of matching method invocations."",""columns"":[{""name"":""sourceFile"",""type"":""String"",""displayName"":""Source file"",""description"":""The source file that the method call occurred in.""},{""name"":""method"",""type"":""String"",""displayName"":""Method call"",""description"":""The text of the method call.""},{""name"":""className"",""type"":""String"",""displayName"":""Class name"",""description"":""The class name of the method call.""},{""name"":""methodName"",""type"":""String"",""displayName"":""Method name"",""description"":""The method name of the method call.""},{""name"":""argumentTypes"",""type"":""String"",""displayName"":""Argument types"",""description"":""The argument types of the method call.""}]}]"
8484
maven,org.openrewrite:rewrite-java,org.openrewrite.java.search.FindMissingTypes,Find missing type information on Java LSTs,This is a diagnostic recipe to highlight where LSTs are missing type attribution information.,1,Search,Java,,Basic building blocks for transforming Java code.,"[{""name"":""checkDocumentation"",""type"":""boolean"",""displayName"":""Check documentation"",""description"":""When set to `true` any references in documentation (i.e. Javadoc for Java) will also be checked. Default is `false`."",""value"":false}]",
8585
maven,org.openrewrite:rewrite-java,org.openrewrite.java.search.FindRepeatableAnnotations,Find uses of `@Repeatable` annotations,Java 8 introduced the concept of `@Repeatable` annotations.,1,Search,Java,,Basic building blocks for transforming Java code.,,
86+
maven,org.openrewrite:rewrite-java,org.openrewrite.java.search.FindSymbols,Find symbols,"Lists all symbols (classes, methods, fields, etc.) declared in the codebase. Results are emitted into a data table with symbol kind, name, parent type, signature, and visibility.",1,Search,Java,,Basic building blocks for transforming Java code.,"[{""name"":""sourcePath"",""type"":""String"",""displayName"":""Source path"",""description"":""Optional source path to limit the search to a single file."",""example"":""src/main/java/com/example/MyClass.java""}]","[{""name"":""org.openrewrite.java.table.SymbolsTable"",""displayName"":""Symbols overview"",""description"":""All symbols (classes, methods, fields) declared in the codebase."",""columns"":[{""name"":""sourcePath"",""type"":""String"",""displayName"":""Source path"",""description"":""The path to the source file containing this symbol.""},{""name"":""kind"",""type"":""String"",""displayName"":""Symbol kind"",""description"":""The kind of symbol: CLASS, INTERFACE, ENUM, RECORD, ANNOTATION, METHOD, CONSTRUCTOR, or FIELD.""},{""name"":""name"",""type"":""String"",""displayName"":""Name"",""description"":""The simple name of the symbol.""},{""name"":""parentFqn"",""type"":""String"",""displayName"":""Parent type"",""description"":""The fully qualified name of the enclosing type, if any.""},{""name"":""signature"",""type"":""String"",""displayName"":""Signature"",""description"":""For methods: the method signature. For fields: the field type.""},{""name"":""visibility"",""type"":""String"",""displayName"":""Visibility"",""description"":""The access modifier: PUBLIC, PROTECTED, PRIVATE, or PACKAGE_PRIVATE.""}]}]"
8687
maven,org.openrewrite:rewrite-java,org.openrewrite.java.search.FindTypes,Find types,Find type references by name.,1,Search,Java,,Basic building blocks for transforming Java code.,"[{""name"":""fullyQualifiedTypeName"",""type"":""String"",""displayName"":""Fully-qualified type name"",""description"":""A fully-qualified type name, that is used to find matching type references. Supports glob expressions. `java..*` finds every type from every subpackage of the `java` package."",""example"":""java.util.List"",""required"":true},{""name"":""checkAssignability"",""type"":""Boolean"",""displayName"":""Check for assignability"",""description"":""When enabled, find type references that are assignable to the provided type.""}]","[{""name"":""org.openrewrite.java.table.TypeUses"",""displayName"":""Type uses"",""description"":""The source code of matching type uses."",""columns"":[{""name"":""sourceFile"",""type"":""String"",""displayName"":""Source file"",""description"":""The source file that the method call occurred in.""},{""name"":""code"",""type"":""String"",""displayName"":""Source"",""description"":""The source code of the type use.""},{""name"":""concreteType"",""type"":""String"",""displayName"":""Concrete type"",""description"":""The concrete type in use, which may be a subtype of a searched type.""}]}]"
8788
maven,org.openrewrite:rewrite-java,org.openrewrite.java.search.HasBuildToolVersion,Find files with a particular build tool version,Finds Java source files built with a particular build tool. This is useful especially as a precondition for other recipes.,1,Search,Java,,Basic building blocks for transforming Java code.,"[{""name"":""type"",""type"":""Type"",""displayName"":""Build tool type"",""description"":""The build tool to search for."",""example"":""Maven"",""required"":true},{""name"":""version"",""type"":""String"",""displayName"":""Build tool version"",""description"":""An exact version number or node-style semver selector used to select the version number."",""example"":""3.6.0-9999"",""required"":true}]",
8889
maven,org.openrewrite:rewrite-java,org.openrewrite.java.search.HasJavaVersion,Find files compiled at a specific Java version,Finds Java source files matching a particular language level. This is useful especially as a precondition for other recipes.,1,Search,Java,,Basic building blocks for transforming Java code.,"[{""name"":""version"",""type"":""String"",""displayName"":""Java version"",""description"":""An exact version number or node-style semver selector used to select the version number."",""example"":""17.X"",""required"":true},{""name"":""checkTargetCompatibility"",""type"":""Boolean"",""displayName"":""Version check against target compatibility"",""description"":""The source and target compatibility versions can be different. This option allows you to check against the target compatibility version instead of the source compatibility version."",""example"":""17.X""}]",

0 commit comments

Comments
 (0)