Skip to content

Commit 9c3e00b

Browse files
gkzfacebook-github-bot
authored andcommitted
[enums] Add parameter names to enum proto methods
Summary: Just noticed that it looks a bit nicer in the IDE (e.g. signature help) if the methods have a parameter name (see test plan). Reviewed By: panagosg7 Differential Revision: D20396188 fbshipit-source-id: c6d16c238348e313d024e4752638e6c36f28da18
1 parent 34aed35 commit 9c3e00b

3 files changed

Lines changed: 16 additions & 16 deletions

File tree

lib/core.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -936,8 +936,8 @@ declare var console: {
936936
};
937937

938938
type $EnumProto<TEnum, TRepresentation> = {|
939-
cast(TRepresentation): void | TEnum,
940-
isValid(TRepresentation): boolean,
939+
cast(input: TRepresentation): void | TEnum,
940+
isValid(input: TRepresentation): boolean,
941941
members(): Iterable<TEnum>,
942942
__proto__: null,
943943
|}

tests/autocomplete/autocomplete.exp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3032,27 +3032,27 @@ enums.js = {
30323032
{
30333033
"label":"cast",
30343034
"kind":3,
3035-
"detail":"(string) => (void | E)",
3036-
"inlineDetail":"(_: string)",
3035+
"detail":"(input: string) => (void | E)",
3036+
"inlineDetail":"(input: string)",
30373037
"itemType":"void | E",
30383038
"sortText":"00000000000000000001",
30393039
"insertTextFormat":2,
30403040
"textEdit":{
30413041
"range":{"start":{"line":9,"character":2},"end":{"line":9,"character":2}},
3042-
"newText":"cast(${1:_})"
3042+
"newText":"cast(${1:input})"
30433043
}
30443044
}
30453045
{
30463046
"label":"isValid",
30473047
"kind":3,
3048-
"detail":"(string) => boolean",
3049-
"inlineDetail":"(_: string)",
3048+
"detail":"(input: string) => boolean",
3049+
"inlineDetail":"(input: string)",
30503050
"itemType":"boolean",
30513051
"sortText":"00000000000000000001",
30523052
"insertTextFormat":2,
30533053
"textEdit":{
30543054
"range":{"start":{"line":9,"character":2},"end":{"line":9,"character":2}},
3055-
"newText":"isValid(${1:_})"
3055+
"newText":"isValid(${1:input})"
30563056
}
30573057
}
30583058
{

tests/enums/enums.exp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,8 +1635,8 @@ References:
16351635
<BUILTINS>/core.js:938:43
16361636
v-
16371637
938| type $EnumProto<TEnum, TRepresentation> = {|
1638-
939| cast(TRepresentation): void | TEnum,
1639-
940| isValid(TRepresentation): boolean,
1638+
939| cast(input: TRepresentation): void | TEnum,
1639+
940| isValid(input: TRepresentation): boolean,
16401640
941| members(): Iterable<TEnum>,
16411641
942| __proto__: null,
16421642
943| |}
@@ -1655,8 +1655,8 @@ References:
16551655
<BUILTINS>/core.js:938:43
16561656
v-
16571657
938| type $EnumProto<TEnum, TRepresentation> = {|
1658-
939| cast(TRepresentation): void | TEnum,
1659-
940| isValid(TRepresentation): boolean,
1658+
939| cast(input: TRepresentation): void | TEnum,
1659+
940| isValid(input: TRepresentation): boolean,
16601660
941| members(): Iterable<TEnum>,
16611661
942| __proto__: null,
16621662
943| |}
@@ -1693,8 +1693,8 @@ References:
16931693
<BUILTINS>/core.js:938:43
16941694
v-
16951695
938| type $EnumProto<TEnum, TRepresentation> = {|
1696-
939| cast(TRepresentation): void | TEnum,
1697-
940| isValid(TRepresentation): boolean,
1696+
939| cast(input: TRepresentation): void | TEnum,
1697+
940| isValid(input: TRepresentation): boolean,
16981698
941| members(): Iterable<TEnum>,
16991699
942| __proto__: null,
17001700
943| |}
@@ -1713,8 +1713,8 @@ References:
17131713
<BUILTINS>/core.js:938:43
17141714
v-
17151715
938| type $EnumProto<TEnum, TRepresentation> = {|
1716-
939| cast(TRepresentation): void | TEnum,
1717-
940| isValid(TRepresentation): boolean,
1716+
939| cast(input: TRepresentation): void | TEnum,
1717+
940| isValid(input: TRepresentation): boolean,
17181718
941| members(): Iterable<TEnum>,
17191719
942| __proto__: null,
17201720
943| |}

0 commit comments

Comments
 (0)