Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/services/findAllReferences.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1302,7 +1302,7 @@ export namespace Core {
const symbol = node && skipPastExportOrImportSpecifierOrUnion(originalSymbol, node, checker, /*useLocalSymbolForExportSpecifier*/ !isForRenameWithPrefixAndSuffixText(options)) || originalSymbol;

// Compute the meaning from the location and the symbol it references
const searchMeaning = node ? getIntersectingMeaningFromDeclarations(node, symbol) : SemanticMeaning.All;
const searchMeaning = node && options.use !== FindReferencesUse.Rename ? getIntersectingMeaningFromDeclarations(node, symbol) : SemanticMeaning.All;
const result: SymbolAndEntries[] = [];
const state = new State(sourceFiles, sourceFilesSet, node ? getSpecialSearchKind(node) : SpecialSearchKind.None, checker, cancellationToken, searchMeaning, options, result);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -477,16 +477,16 @@
// === findRenameLocations ===
// === /a.ts ===
// <|type /*RENAME*/[|TRENAME|] = number;|>
// namespace T {
// <|namespace [|TRENAME|] {
// export type U = string;
// }
// }|>
// <|export = [|TRENAME|];|>



// === findRenameLocations ===
// === /a.ts ===
// type T = number;
// <|type [|TRENAME|] = number;|>
// <|namespace /*RENAME*/[|TRENAME|] {
// export type U = string;
// }|>
Expand Down
9 changes: 9 additions & 0 deletions tests/baselines/reference/renameNamespace.baseline.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// === findRenameLocations ===
// === /tests/cases/fourslash/renameNamespace.ts ===
// <|namespace /*RENAME*/[|NSRENAME|] {
// export const enum E {
// A = 'a'
// }
// }|>
//
// const a: [|NSRENAME|].E = [|NSRENAME|].E.A;
11 changes: 11 additions & 0 deletions tests/cases/fourslash/renameNamespace.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/// <reference path='fourslash.ts'/>

////namespace /**/NS {
//// export const enum E {
//// A = 'a'
//// }
////}
////
////const a: NS.E = NS.E.A;

verify.baselineRename("", { });