Skip to content

Commit 0487b38

Browse files
Catch hover on as const (#43588)
* Catch hover on as const * Update test based on feedback
1 parent 5d8a4a1 commit 0487b38

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/services/services.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1670,7 +1670,7 @@ namespace ts {
16701670
function shouldGetType(sourceFile: SourceFile, node: Node, position: number): boolean {
16711671
switch (node.kind) {
16721672
case SyntaxKind.Identifier:
1673-
return !isLabelName(node) && !isTagName(node);
1673+
return !isLabelName(node) && !isTagName(node) && !isConstTypeReference(node.parent);
16741674
case SyntaxKind.PropertyAccessExpression:
16751675
case SyntaxKind.QualifiedName:
16761676
// Don't return quickInfo if inside the comment in `a/**/.b`
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/// <reference path="fourslash.ts" />
2+
3+
////"" as /**/const;
4+
5+
verify.not.quickInfoExists();

0 commit comments

Comments
 (0)