@@ -4793,9 +4793,10 @@ func isSolelyIdentifierDefinitionLocation(
47934793 return ast .IsFunctionLike (parent ) && ! ast .IsMethodDeclaration (parent )
47944794 }
47954795
4796+ tokenKind := keywordForNode (contextToken )
47964797 // If the previous token is keyword corresponding to class member completion keyword
47974798 // there will be completion available here
4798- if isClassMemberCompletionKeyword (keywordForNode ( contextToken ) ) && isFromObjectTypeDeclaration (contextToken ) {
4799+ if isClassMemberCompletionKeyword (tokenKind ) && isFromObjectTypeDeclaration (contextToken ) {
47994800 return false
48004801 }
48014802
@@ -4805,15 +4806,15 @@ func isSolelyIdentifierDefinitionLocation(
48054806 // - its name of the parameter and not being edited
48064807 // eg. constructor(a |<- this shouldnt show completion
48074808 if ! ast .IsIdentifier (contextToken ) ||
4808- ast .IsParameterPropertyModifier (keywordForNode ( contextToken ) ) ||
4809+ ast .IsParameterPropertyModifier (tokenKind ) ||
48094810 isCurrentlyEditingNode (contextToken , file , position ) {
48104811 return false
48114812 }
48124813 }
48134814
48144815 // Previous token may have been a keyword that was converted to an identifier.
48154816 switch keywordForNode (contextToken ) {
4816- case ast .KindAbstractKeyword , ast .KindClassKeyword , ast .KindConstKeyword , ast . KindDeclareKeyword ,
4817+ case ast .KindAbstractKeyword , ast .KindClassKeyword , ast .KindDeclareKeyword ,
48174818 ast .KindEnumKeyword , ast .KindFunctionKeyword , ast .KindInterfaceKeyword , ast .KindLetKeyword ,
48184819 ast .KindPrivateKeyword , ast .KindProtectedKeyword , ast .KindPublicKeyword ,
48194820 ast .KindStaticKeyword , ast .KindVarKeyword :
@@ -4848,7 +4849,9 @@ func isSolelyIdentifierDefinitionLocation(
48484849 return true
48494850 }
48504851 }
4851-
4852+ if tokenKind == ast .KindConstKeyword {
4853+ return true
4854+ }
48524855 return ast .IsDeclarationName (contextToken ) &&
48534856 ! ast .IsShorthandPropertyAssignment (parent ) &&
48544857 ! ast .IsJsxAttribute (parent ) &&
0 commit comments