mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-04-17 01:49:41 -05:00
Add asserts to type only symbols meaning exclusion (#43382)
Fixes #42180
This commit is contained in:
committed by
GitHub
parent
ffe925ddd5
commit
3b06ef1a73
@@ -1659,8 +1659,9 @@ namespace ts.Completions {
|
||||
|
||||
function isContextTokenValueLocation(contextToken: Node) {
|
||||
return contextToken &&
|
||||
contextToken.kind === SyntaxKind.TypeOfKeyword &&
|
||||
(contextToken.parent.kind === SyntaxKind.TypeQuery || isTypeOfExpression(contextToken.parent));
|
||||
((contextToken.kind === SyntaxKind.TypeOfKeyword &&
|
||||
(contextToken.parent.kind === SyntaxKind.TypeQuery || isTypeOfExpression(contextToken.parent))) ||
|
||||
(contextToken.kind === SyntaxKind.AssertsKeyword && contextToken.parent.kind === SyntaxKind.TypePredicate));
|
||||
}
|
||||
|
||||
function isContextTokenTypeLocation(contextToken: Node): boolean {
|
||||
|
||||
8
tests/cases/fourslash/completionsAsserts.ts
Normal file
8
tests/cases/fourslash/completionsAsserts.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
////declare function assert(argument1: any): asserts a/**/
|
||||
|
||||
verify.completions({
|
||||
marker: "",
|
||||
includes: { name: "argument1" }
|
||||
});
|
||||
Reference in New Issue
Block a user