Skip to content

Commit

Permalink
Catch hover on as const (#43588)
Browse files Browse the repository at this point in the history
* Catch hover on as const

* Update test based on feedback
  • Loading branch information
kunaljaydesai committed Apr 12, 2021
1 parent 5d8a4a1 commit 0487b38
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/services/services.ts
Expand Up @@ -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`
Expand Down
5 changes: 5 additions & 0 deletions tests/cases/fourslash/quickInfoForConstTypeReference.ts
@@ -0,0 +1,5 @@
/// <reference path="fourslash.ts" />

////"" as /**/const;

verify.not.quickInfoExists();

0 comments on commit 0487b38

Please sign in to comment.