Catch hover on as const (#43588)

* Catch hover on as const

* Update test based on feedback
This commit is contained in:
Kunal Desai
2021-04-12 11:43:47 +01:00
committed by GitHub
parent 5d8a4a1753
commit 0487b38d06
2 changed files with 6 additions and 1 deletions
+1 -1
View File
@@ -1670,7 +1670,7 @@ namespace ts {
function shouldGetType(sourceFile: SourceFile, node: Node, position: number): boolean {
switch (node.kind) {
case SyntaxKind.Identifier:
return !isLabelName(node) && !isTagName(node);
return !isLabelName(node) && !isTagName(node) && !isConstTypeReference(node.parent);
case SyntaxKind.PropertyAccessExpression:
case SyntaxKind.QualifiedName:
// Don't return quickInfo if inside the comment in `a/**/.b`
@@ -0,0 +1,5 @@
/// <reference path="fourslash.ts" />
////"" as /**/const;
verify.not.quickInfoExists();