* * *

Author Topic: 'fake' generation of function prototypes in IDE  (Read 4313 times)

jamie

  • Hero Member
  • *****
  • Posts: 786
Re: 'fake' generation of function prototypes in IDE
« Reply #15 on: June 05, 2018, 02:07:15 am »
Do you have any message handlers in your classes of which the editor is duplicating the method bodies?

 In my case the forms that are doing this just happen to have some message handler procedures where as

 in other cases I don't see this happening...

This is only correlation I can come up with at the moment and maybe code tools is having an issue with that..


engkin

  • Hero Member
  • *****
  • Posts: 2088
Re: 'fake' generation of function prototypes in IDE
« Reply #16 on: June 05, 2018, 03:07:02 am »
When it happens, is it reproducible? Meaning, if you delete the 'fake' functions/methods and delete the body of the newly added method and try again, does it generate the 'fake' methods again?

If yes, is it persistent even after restarting the IDE?

If the answer is yes, again, then you might be able to debug it in TCodeCompletionCodeTool.CreateMissingClassProcBodies unit CodeCompletionTool. There is a define VerboseCreateMissingClassProcBodies that might help.

aducom

  • Jr. Member
  • **
  • Posts: 86
    • http://www.aducom.com
Re: 'fake' generation of function prototypes in IDE
« Reply #17 on: June 14, 2018, 04:28:14 pm »
It's a good tip, will look into that. It's copying empty bodies in all of my units, whatever I'm working on at that moment. But not always. But it does when I have messed with the form. So there must besome correlation. I try to find some kind of default behaviour to be able to reproduce. So far I haven't been able to find that. If you delete and compile it simply works. It's not showstopper but annoying actually.

aducom

  • Jr. Member
  • **
  • Posts: 86
    • http://www.aducom.com
Re: 'fake' generation of function prototypes in IDE
« Reply #18 on: June 26, 2018, 04:42:12 pm »
Something I noticed: The functions that are being generated as fake functions are functions without parameters. Therefore procedure MyFunction();

Now I have not been very neat as the declaration was as above and the real function was procedure MyFunction;

The compiler does not complain but I could imagine that as the prototypes are not equal it would trigger the process. In fact I repaired the code and so far the issue has not occurred again!

Now I tried to replicate it in a simple program, but then it works well. But could it be that on large project something is going on here? Can anyone facing the same problem verify my finding?

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus