Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 369335 - Allow renaming of unresolved names
Summary: Allow renaming of unresolved names
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-refactoring (show other bugs)
Version: 8.0.1   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-22 12:52 EST by Marc-André Laperle CLA
Modified: 2020-09-04 15:20 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marc-André Laperle CLA 2012-01-22 12:52:05 EST
Using 8.0.1

int main() {
  foo(); //note that foo is not declared!
  return 0;
}

1. Initiate Rename refactoring on foo (alt+shift+r)
2. Rename foo to something else. Press enter.
3. Message is shown "The selected name cannot be renamed"

Instead, this message could be shown as soon as Rename is invoked (alt+shift+r).
Comment 1 Sergey Prigogin CLA 2012-01-22 17:24:31 EST
JDT is less strict in a situation like this and allows unresolved names to be renamed. It even renames other unresolved names that are somewhat similar:

class A {
}

class B {
  A a;
  void test() {
    a.foo();
    a.foo(1);
  }
}

JDT renames both instances of foo. We don't have to be as lax as JDT, but shouldn't be too strict either.
Comment 2 Marc-André Laperle CLA 2012-01-22 19:47:25 EST
Oh I didn't know JDT did that. I think we should try to do something similar, I'll change the title to reflect that.