Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-03

Refactoring sometimes does not work - known issue or bug?

5 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Aleksa Todorovic

Hi, all!

I'm porting my project from Java to FPC/Lazarus, and work a lot in Lazarus. I'm used to really great Refactoring features of Eclipse, and hope Lazarus will have them one day. Now, the problem I have:

Sometimes, when I try to use Rename Identifier (or Find Identifier References - it seems like those two features use the same code), I get an error in output window "TCodeToolManager.InitCurCodeTool MainCode=nil". Is this known bug, or should I do little more investigation and report it to Mantis? Note that I use lot of include files, which probably cause identifier-search engine to go crazy.

Regards,
Aleksa

Reply by email

Vincent Snijders
to Aleksa Todorovic
Aleksa Todorovic wrote 12 lines
Hi, all! I'm porting my project from Java to FPC/Lazarus, and work a lot in Lazarus. I'm used to really great Refactoring features of Eclipse, and hope Lazarus will have them one day. Now, the problem I have: Sometimes, when I try to use Rename Identifier (or Find Identifier References - it seems like those two features use the same code), I get an error in output window "TCodeToolManager.InitCurCodeTool MainCode=nil". Is this known bug, or should I do little more investigation and report it to Mantis? Note that I use lot of include files, which probably cause identifier-search engine to go crazy.

Do the code tools understand what file included the include file? Does Search -> Goto include directive work?

If not, open the main file yourself and try again.

Vincent

Reply by email

Aleksa Todorovic
to Vincent Snijders
Vincent Snijders wrote 19 lines
Aleksa Todorovic schreef: > > Hi, all! > > I'm porting my project from Java to FPC/Lazarus, and work a lot in > Lazarus. I'm used to really great Refactoring features of Eclipse, and > hope Lazarus will have them one day. Now, the problem I have: > > Sometimes, when I try to use Rename Identifier (or Find Identifier > References - it seems like those two features use the same code), I > get an error in output window "TCodeToolManager.InitCurCodeTool > MainCode=nil". Is this known bug, or should I do little more > investigation and report it to Mantis? Note that I use lot of include > files, which probably cause identifier-search engine to go crazy. Do the code tools understand what file included the include file? Does Search -> Goto include directive work? If not, open the main file yourself and try again.

I still get the same error in output window.

Show quoted text 9 lines
Vincent -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Aleksa Todorovic - Lead Programmer Eipix Entertainment

Reply by email

Mattias Gaertner
to Aleksa Todorovic
Show quoted text 12 lines
On Tue, Mar 9, 2010 at 20:23, Vincent Snijders wrote: > Aleksa Todorovic schreef: >> >> Hi, all! >> >> I'm porting my project from Java to FPC/Lazarus, and work a lot in >> Lazarus. I'm used to really great Refactoring features of Eclipse, and >> hope Lazarus will have them one day. Now, the problem I have: >> >> Sometimes, when I try to use Rename Identifier (or Find Identifier >> References - it seems like those two features use the same code),

yes

>> I >> get an error in output window "TCodeToolManager.InitCurCodeTool >> MainCode=nil".

It means, the IDE thinks this is an include file and it can not find the unit, that includes this file.

I improved the error message in svn revision 23906.

Show quoted text 10 lines
>> Is this known bug, or should I do little more >> investigation and report it to Mantis? Note that I use lot of include >> files, which probably cause identifier-search engine to go crazy. > > Do the code tools understand what file included the include file? Does > Search -> Goto include directive work? > > If not, open the main file yourself and try again. I still get the same error in output window.

You must open the unit and "explore" it. For example press ctrl+shift+up.
Reason: Then the IDE will parse the unit and thus the include file too. It will remember this relationship. So you have to do to this only once.

Mattias

Reply by email

Aleksa Todorovic
to Mattias Gaertner
Mattias Gaertner wrote 44 lines
On Tue, 9 Mar 2010 20:56:26 +0100 Aleksa Todorovic wrote: > On Tue, Mar 9, 2010 at 20:23, Vincent Snijders > wrote: > > Aleksa Todorovic schreef: > >> > >> Hi, all! > >> > >> I'm porting my project from Java to FPC/Lazarus, and work a lot in > >> Lazarus. I'm used to really great Refactoring features of Eclipse, and > >> hope Lazarus will have them one day. Now, the problem I have: > >> > >> Sometimes, when I try to use Rename Identifier (or Find Identifier > >> References - it seems like those two features use the same code), yes > >> I > >> get an error in output window "TCodeToolManager.InitCurCodeTool > >> MainCode=nil". It means, the IDE thinks this is an include file and it can not find the unit, that includes this file. I improved the error message in svn revision 23906. > >> Is this known bug, or should I do little more > >> investigation and report it to Mantis? Note that I use lot of include > >> files, which probably cause identifier-search engine to go crazy. > > > > Do the code tools understand what file included the include file? Does > > Search -> Goto include directive work? > > > > If not, open the main file yourself and try again. > > I still get the same error in output window. You must open the unit and "explore" it. For example press ctrl+shift+up. Reason: Then the IDE will parse the unit and thus the include file too. It will remember this relationship. So you have to do to this only once.

Thank for this patch. After I parse main file, Find References dialog shows up, but when I execute it, there is Access Violation. I made Mantis bug report http://bugs.freepascal.org/view.php?id=15942 with stack trace of this AV. I'll try to make small example one of these days.

Show quoted text 10 lines
Mattias -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Aleksa Todorovic - Lead Programmer Eipix Entertainment

Reply by email