This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Often in automatic tests we create empty project and add existing file from external directory. In this case "Introduce Function" action breaks code assistance. C++ code: int main(int argc, char** argv) { int i = 1; i++; i++; return 0; } Scenario: - Create empty C++ Application in /export/files/NB (/export/files/NB/CppApplication_1 folder will appear) - Add existing /export/files/test.cpp file via "Add Existing Item..." menu item - Select "i++;" line and press Alt-Shift-M (Introduce Function) - Press Refactor button ==> a lot of unresolved identifiers
Other related bug. C++ code: int foo1() { return 0; } int main(int argc, char** argv) { foo1(); return 0; } Scenario: - Create empty C++ Application in /export/files/NB (/export/files/NB/CppApplication_1 folder will appear) - Add existing /export/files/test.cpp file via "Add Existing Item..." menu item - Select "foo1();" line and press Ctrl-R - Type foo2 and Press Refactor button ==> ok - Select "foo2();" line and press Ctrl-R - Type foo3 and Press Refactor button ==> old code in editor
The cause of the bug is: - the added item is not located under source root. Indexing/Parsing API does not support files that do not belong source root.
fixed, change set: http://hg.netbeans.org/cnd-main/rev/6576d639ca3e
Integrated into 'main-silver', will be available in build *201509040002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/6576d639ca3e User: Alexander Simon <alexvsimon@netbeans.org> Log: fixed Bug #254876 IDE has unresolved identifiers in refactored code ("Introduce Function" action)