@@ -1013,9 +1013,8 @@ export namespace Core {
10131013 const checker = program . getTypeChecker ( ) ;
10141014 // constructors should use the class symbol, detected by name, if present
10151015 const symbol = checker . getSymbolAtLocation ( isConstructorDeclaration ( node ) && node . parent . name || node ) ;
1016-
10171016 // Could not find a symbol e.g. unknown identifier
1018- if ( ! symbol ) {
1017+ if ( ! symbol || ( isStringLiteralLike ( node ) && isStringLiteralPropertyReference ( node , checker ) ) ) {
10191018 // String literal might be a property (and thus have a symbol), so do this here rather than in getReferencedSymbolsSpecial.
10201019 if ( ! options . implementations && isStringLiteralLike ( node ) ) {
10211020 if ( isModuleSpecifierLike ( node ) ) {
@@ -1389,7 +1388,8 @@ export namespace Core {
13891388 /** Only set if `options.implementations` is true. These are the symbols checked to get the implementations of a property access. */
13901389 readonly parents : readonly Symbol [ ] | undefined ;
13911390 readonly allSearchSymbols : readonly Symbol [ ] ;
1392-
1391+ /** The node that we are searching for. This is used for searching. */
1392+ readonly node : Node | undefined ;
13931393 /**
13941394 * Whether a symbol is in the search set.
13951395 * Do not compare directly to `symbol` because there may be related symbols to search for. See `populateSearchSymbolSet`.
@@ -1474,7 +1474,7 @@ export namespace Core {
14741474 } = searchOptions ;
14751475 const escapedText = escapeLeadingUnderscores ( text ) ;
14761476 const parents = this . options . implementations && location ? getParentSymbolsOfPropertyAccess ( location , symbol , this . checker ) : undefined ;
1477- return { symbol, comingFrom, text, escapedText, parents, allSearchSymbols, includes : sym => contains ( allSearchSymbols , sym ) } ;
1477+ return { symbol, comingFrom, text, escapedText, parents, allSearchSymbols, node : location , includes : sym => contains ( allSearchSymbols , sym ) } ;
14781478 }
14791479
14801480 private readonly symbolIdToReferences : Entry [ ] [ ] = [ ] ;
@@ -1921,7 +1921,15 @@ export namespace Core {
19211921 // 'FindReferences' will just filter out these results.
19221922 state . addStringOrCommentReference ( sourceFile . fileName , createTextSpan ( position , search . text . length ) ) ;
19231923 }
1924-
1924+ // if ( search.node &&!state.checker.getSymbolAtLocation(referenceLocation) && !state.options.implementations && isStringLiteralLike(search.node) && isStringLiteralLike(referenceLocation) )
1925+ // {
1926+ // const type = getContextualTypeFromParentOrAncestorTypeNode(search.node, state.checker)
1927+ // const refType = getContextualTypeFromParentOrAncestorTypeNode(referenceLocation, state.checker)
1928+ // if (type !== state.checker.getStringType() && type === refType)
1929+ // {
1930+ // addReference(referenceLocation, referenceLocation.symbol, state);
1931+ // }
1932+ // }
19251933 return ;
19261934 }
19271935
0 commit comments