Skip to content

Commit

Permalink
fix(49131): allow type keyword inside functions (#49134)
Browse files Browse the repository at this point in the history
  • Loading branch information
a-tarasyuk committed May 24, 2022
1 parent a2b785b commit b57d6e1
Show file tree
Hide file tree
Showing 7 changed files with 349 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/harness/fourslashInterfaceImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1498,6 +1498,7 @@ namespace FourSlashInterface {
"throw",
"true",
"try",
"type",
"typeof",
"var",
"void",
Expand Down Expand Up @@ -1649,6 +1650,7 @@ namespace FourSlashInterface {
"throw",
"true",
"try",
"type",
"typeof",
"var",
"void",
Expand Down
1 change: 1 addition & 0 deletions src/services/completions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3988,6 +3988,7 @@ namespace ts.Completions {
return kind === SyntaxKind.AsyncKeyword
|| kind === SyntaxKind.AwaitKeyword
|| kind === SyntaxKind.AsKeyword
|| kind === SyntaxKind.TypeKeyword
|| !isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind);
}

Expand Down
216 changes: 216 additions & 0 deletions tests/baselines/reference/completionsCommentsClassMembers.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -4223,6 +4223,18 @@
}
]
},
{
"name": "type",
"kind": "keyword",
"kindModifiers": "",
"sortText": "15",
"displayParts": [
{
"text": "type",
"kind": "keyword"
}
]
},
{
"name": "TypeError",
"kind": "var",
Expand Down Expand Up @@ -11284,6 +11296,18 @@
}
]
},
{
"name": "type",
"kind": "keyword",
"kindModifiers": "",
"sortText": "15",
"displayParts": [
{
"text": "type",
"kind": "keyword"
}
]
},
{
"name": "TypeError",
"kind": "var",
Expand Down Expand Up @@ -16098,6 +16122,18 @@
}
]
},
{
"name": "type",
"kind": "keyword",
"kindModifiers": "",
"sortText": "15",
"displayParts": [
{
"text": "type",
"kind": "keyword"
}
]
},
{
"name": "TypeError",
"kind": "var",
Expand Down Expand Up @@ -23159,6 +23195,18 @@
}
]
},
{
"name": "type",
"kind": "keyword",
"kindModifiers": "",
"sortText": "15",
"displayParts": [
{
"text": "type",
"kind": "keyword"
}
]
},
{
"name": "TypeError",
"kind": "var",
Expand Down Expand Up @@ -27224,6 +27272,18 @@
}
]
},
{
"name": "type",
"kind": "keyword",
"kindModifiers": "",
"sortText": "15",
"displayParts": [
{
"text": "type",
"kind": "keyword"
}
]
},
{
"name": "TypeError",
"kind": "var",
Expand Down Expand Up @@ -32445,6 +32505,18 @@
}
]
},
{
"name": "type",
"kind": "keyword",
"kindModifiers": "",
"sortText": "15",
"displayParts": [
{
"text": "type",
"kind": "keyword"
}
]
},
{
"name": "TypeError",
"kind": "var",
Expand Down Expand Up @@ -36464,6 +36536,18 @@
}
]
},
{
"name": "type",
"kind": "keyword",
"kindModifiers": "",
"sortText": "15",
"displayParts": [
{
"text": "type",
"kind": "keyword"
}
]
},
{
"name": "TypeError",
"kind": "var",
Expand Down Expand Up @@ -41639,6 +41723,18 @@
}
]
},
{
"name": "type",
"kind": "keyword",
"kindModifiers": "",
"sortText": "15",
"displayParts": [
{
"text": "type",
"kind": "keyword"
}
]
},
{
"name": "TypeError",
"kind": "var",
Expand Down Expand Up @@ -46860,6 +46956,18 @@
}
]
},
{
"name": "type",
"kind": "keyword",
"kindModifiers": "",
"sortText": "15",
"displayParts": [
{
"text": "type",
"kind": "keyword"
}
]
},
{
"name": "TypeError",
"kind": "var",
Expand Down Expand Up @@ -52081,6 +52189,18 @@
}
]
},
{
"name": "type",
"kind": "keyword",
"kindModifiers": "",
"sortText": "15",
"displayParts": [
{
"text": "type",
"kind": "keyword"
}
]
},
{
"name": "TypeError",
"kind": "var",
Expand Down Expand Up @@ -57302,6 +57422,18 @@
}
]
},
{
"name": "type",
"kind": "keyword",
"kindModifiers": "",
"sortText": "15",
"displayParts": [
{
"text": "type",
"kind": "keyword"
}
]
},
{
"name": "TypeError",
"kind": "var",
Expand Down Expand Up @@ -61362,6 +61494,18 @@
}
]
},
{
"name": "type",
"kind": "keyword",
"kindModifiers": "",
"sortText": "15",
"displayParts": [
{
"text": "type",
"kind": "keyword"
}
]
},
{
"name": "TypeError",
"kind": "var",
Expand Down Expand Up @@ -65422,6 +65566,18 @@
}
]
},
{
"name": "type",
"kind": "keyword",
"kindModifiers": "",
"sortText": "15",
"displayParts": [
{
"text": "type",
"kind": "keyword"
}
]
},
{
"name": "TypeError",
"kind": "var",
Expand Down Expand Up @@ -69482,6 +69638,18 @@
}
]
},
{
"name": "type",
"kind": "keyword",
"kindModifiers": "",
"sortText": "15",
"displayParts": [
{
"text": "type",
"kind": "keyword"
}
]
},
{
"name": "TypeError",
"kind": "var",
Expand Down Expand Up @@ -73542,6 +73710,18 @@
}
]
},
{
"name": "type",
"kind": "keyword",
"kindModifiers": "",
"sortText": "15",
"displayParts": [
{
"text": "type",
"kind": "keyword"
}
]
},
{
"name": "TypeError",
"kind": "var",
Expand Down Expand Up @@ -77602,6 +77782,18 @@
}
]
},
{
"name": "type",
"kind": "keyword",
"kindModifiers": "",
"sortText": "15",
"displayParts": [
{
"text": "type",
"kind": "keyword"
}
]
},
{
"name": "TypeError",
"kind": "var",
Expand Down Expand Up @@ -81662,6 +81854,18 @@
}
]
},
{
"name": "type",
"kind": "keyword",
"kindModifiers": "",
"sortText": "15",
"displayParts": [
{
"text": "type",
"kind": "keyword"
}
]
},
{
"name": "TypeError",
"kind": "var",
Expand Down Expand Up @@ -96035,6 +96239,18 @@
}
]
},
{
"name": "type",
"kind": "keyword",
"kindModifiers": "",
"sortText": "15",
"displayParts": [
{
"text": "type",
"kind": "keyword"
}
]
},
{
"name": "TypeError",
"kind": "var",
Expand Down

0 comments on commit b57d6e1

Please sign in to comment.