Skip to content

Commit 4143d1d

Browse files
Addressed CR feedback.
1 parent 8316369 commit 4143d1d

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/services/services.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4965,7 +4965,8 @@ namespace ts {
49654965
// Compute the meaning from the location and the symbol it references
49664966
let searchMeaning = getIntersectingMeaningFromDeclarations(getMeaningFromLocation(node), declarations);
49674967

4968-
// Get the text to search for, we need to normalize it as external module names will have quotes
4968+
// Get the text to search for.
4969+
// Note: if this is an external module symbol, the name doesn't include quotes.
49694970
let declaredName = getDeclaredName(typeChecker, symbol, node);
49704971

49714972
// Try to get the smallest valid scope that we can limit our search to;
@@ -5019,7 +5020,7 @@ namespace ts {
50195020
});
50205021
}
50215022

5022-
function getInternedName(symbol: Symbol, location: Node, declarations: Declaration[]) {
5023+
function getInternedName(symbol: Symbol, location: Node, declarations: Declaration[]): string {
50235024
// If this is an export or import specifier it could have been renamed using the 'as' syntax.
50245025
// If so we want to search for whatever under the cursor.
50255026
if (isImportOrExportSpecifierName(location)) {
@@ -5036,8 +5037,10 @@ namespace ts {
50365037

50375038
/**
50385039
* Determines the smallest scope in which a symbol may have named references.
5040+
* Note that not every construct has been accounted for. This function can
5041+
* probably be improved.
50395042
*
5040-
* Returns undefined if the scope cannot be determined, often implying that
5043+
* @returns undefined if the scope cannot be determined, implying that
50415044
* a reference to a symbol can occur anywhere.
50425045
*/
50435046
function getSymbolScope(symbol: Symbol): Node {

src/services/utilities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ namespace ts {
653653
});
654654
}
655655

656-
export function getDeclaredName(typeChecker: TypeChecker, symbol: Symbol, location: Node) {
656+
export function getDeclaredName(typeChecker: TypeChecker, symbol: Symbol, location: Node): string {
657657
// If this is an export or import specifier it could have been renamed using the 'as' syntax.
658658
// If so we want to search for whatever is under the cursor.
659659
if (isImportOrExportSpecifierName(location)) {

0 commit comments

Comments
 (0)