File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,4 +14,10 @@ array = [
1414"key2",
1515"key3"
1616]
17- test_placeholder = "This is a {placeholder} test."
17+ # it should not generate placeholder for array types
18+ test_placeholder = "This is a {placeholder} test."
19+ tested_array = [
20+ "value1",
21+ "value2 with {placeholder}",
22+ "value3",
23+ ]
Original file line number Diff line number Diff line change 33
44/* eslint-disable */
55export interface Lang {
6+ /** This is a {placeholder} test. */
7+ 'test_placeholder' : ( args : { placeholder : string } ) => string ;
8+ /**
9+ * [
10+ * "value1",
11+ * "value2 with {placeholder}",
12+ * "value3",
13+ * ]
14+ */
15+ 'tested_array' : string [ ] ;
16+ /** hello world */
17+ 'hello' : string ;
618 /**
719 * "this is
820 * a multi-line
921 * string
1022 * test"
1123 */
1224 'test' : string ;
13- /** hello world */
14- 'hello' : string ;
15- /** This is a {placeholder} test. */
16- 'test_placeholder' : ( args : { placeholder : string } ) => string ;
1725 /**
1826 * [
1927 * "key1",
Original file line number Diff line number Diff line change @@ -238,7 +238,7 @@ pub fn generate_typescript_defs(
238238 }
239239 }
240240 }
241- if !placeholders. is_empty ( ) && should_gen_placeholder {
241+ if !placeholders. is_empty ( ) && should_gen_placeholder && !trimmed . starts_with ( '[' ) {
242242 defs. push_str ( & format ! ( " '{}': (args: {{ " , key) ) ;
243243 for ( i, p) in placeholders. iter ( ) . enumerate ( ) {
244244 if i > 0 {
You can’t perform that action at this time.
0 commit comments