mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Add asserts to type only symbols meaning exclusion (#43382)
Fixes #42180
This commit is contained in:
1 parent
ffe925ddd5
commit
3b06ef1a73
2 files changed
+11
-2
No files matched your search
@@ -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 {
|
||||
|
||||
@@ -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