local.
This would save an unnecessary index query when renaming a function
local symbol in cross-file rename mode.
if (!MainFileRenameEdit)
return MainFileRenameEdit.takeError();
- if (!Opts.AllowCrossFile) {
- // Within-file rename: just return the main file results.
+ // return the main file edit if this is a within-file rename or the symbol
+ // being renamed is function local.
+ if (!Opts.AllowCrossFile || RenameDecl.getParentFunctionOrMethod()) {
return FileEdits(
{std::make_pair(RInputs.MainFilePath,
Edit{MainFileCode, std::move(*MainFileRenameEdit)})});