-
Notifications
You must be signed in to change notification settings - Fork 478
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Details
- Library: org.openrewrite:rewrite-javascript:8.66.2
- Class:
org.openrewrite.javascript.rpc.JavaScriptRewriteRpc - Method:
getRecipes()
Problem
When loading TypeScript recipes via RPC, the type field of OptionDescriptor is always null, even though the TypeScript source code explicitly defines a type.
Example
export class ModernizeOctalEscapeSequences extends Recipe {
@Option({
displayName: "Use Unicode escapes",
description: "Use Unicode escape sequences...",
required: false,
example: "true",
})
useUnicodeEscapes: boolean; // ← TYPE IS "boolean"
}
What my RPC calls returns:
Recipe: org.openrewrite.javascript.migrate.es6.modernize-octal-escape-sequences
Option name: useUnicodeEscapes
type: null ← Should be "boolean"
description: Use Unicode escape sequences (`\uXXXX`)...
example: true
required: false
How I'm calling it:
val rpc = JavaScriptRewriteRpc.builder().get()
rpc.installRecipes("@openrewrite/rewrite", "8.66.2")
val descriptors: List<RecipeDescriptor> = rpc.recipes
for (descriptor in descriptors) {
for (option in descriptor.options) {
println("type: ${option.type}") // Prints "null"
}
}
Expected behavior
option.type should be a non-null type such as "boolean" (as a String representation of the TypeScript type)
Actual behavior
option.type is null
Impact
- Documentation generation shows
nullinstead of proper types - Users cannot tell what type of value to provide for recipe options without checking the source code itself
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
No status