Skip to content

Commit

Permalink
Add as completions (#36359)
Browse files Browse the repository at this point in the history
  • Loading branch information
sandersn authored Jan 23, 2020
1 parent 75f88ee commit ef5573b
Show file tree
Hide file tree
Showing 3 changed files with 8 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 @@ -1152,6 +1152,7 @@ namespace FourSlashInterface {
"let",
"package",
"yield",
"as",
"asserts",
"any",
"async",
Expand Down Expand Up @@ -1352,6 +1353,7 @@ namespace FourSlashInterface {
"let",
"package",
"yield",
"as",
"asserts",
"any",
"async",
Expand Down
1 change: 1 addition & 0 deletions src/services/completions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2461,6 +2461,7 @@ namespace ts.Completions {
|| kind === SyntaxKind.ModuleKeyword
|| kind === SyntaxKind.TypeKeyword
|| kind === SyntaxKind.NamespaceKeyword
|| kind === SyntaxKind.AsKeyword
|| isTypeKeyword(kind) && kind !== SyntaxKind.UndefinedKeyword;
case KeywordCompletionFilters.FunctionLikeBodyKeywords:
return isFunctionLikeBodyKeyword(kind);
Expand Down
5 changes: 5 additions & 0 deletions tests/cases/fourslash/completionTypeAssertion.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference path="fourslash.ts" />

//// var x = this as/*1*/

verify.completions({marker: "1", exact: completion.globalsPlus(["x"]) })

0 comments on commit ef5573b

Please sign in to comment.