I wish I had enough knowledge&skill to dive into something that complex... :'(
The code base is big. I also have to study a relevant piece of code always when I implement or fix something.
Often the biggest challenge is to find the right place in code. Once it is found, it is easy (?) to analyze.
Some hints how to find a certain piece of code:
If the feature is controlled by GUI, find the resourcestring used in it and see where it is used.
For example in this case unit LazarusIDEStrConsts has
lisAutomaticallyInvokeOnType = 'Automatically invoke on typing';
Searching
lisAutomaticallyInvokeOnType reveals it is used in unit codetools_identifiercompletion_options for ICAutoInvokeOnTypeCheckBox.Caption. Then follow
ICAutoInvokeOnTypeCheckBox. And so on...
Use Git commands to find the commit that implemented or changed a certain feature.
git blame ide/lazarusidestrconsts.pas
shows among other lines :
989ab16b3b3 (mattias 2013-07-30 14:37:53 +0000 5545) lisNoPascalFile = 'No Pascal file';
75b7c1bd1ea (juha 2014-06-15 11:52:01 +0000 5546) lisUnableToFindPascalUnitPasPpForLfmFile = 'Unable to find Pascal unit (.pas, .pp) for .lfm file%s"%s"';
4e1442e5ee8 (mattias 2009-07-29 10:44:03 +0000 5547) lisLFMIsOk = 'LFM is ok';
4e1442e5ee8 (mattias 2009-07-29 10:44:03 +0000 5548) lisClassesAndPropertiesExistValuesWereNotChecked = 'Classes and properties '
4e1442e5ee8 (mattias 2009-07-29 10:44:03 +0000 5549) +'exist. Values were not checked.';
28f092feb1d (maxim 2015-08-08 12:06:14 +0000 5550) lisIdCOpening = 'Opening';
f3f864d9677 (martin 2020-06-06 15:16:21 +0000 5551) lisAutomaticallyInvokeOnType = 'Automatically invoke on typing';
f3f864d9677 (martin 2020-06-06 15:16:21 +0000 5552) lisAutomaticallyInvokeOnTypeUseTimer = 'Use completion box delay';
f3f864d9677 (martin 2020-06-06 15:16:21 +0000 5553) lisAutomaticallyInvokeOnTypeOnlyWordEnd = 'Only complete when at end of word';
f3f864d9677 (martin 2020-06-06 15:16:21 +0000 5554) lisAutomaticallyInvokeOnTypeMinLength = 'Only complete if word is longer or equal';
f7cef69d2e3 (mattias 2009-08-19 15:56:18 +0000 5555) lisAutomaticallyInvokeAfterPoint = 'Automatically invoke after point';
b5bbdbd3234 (mattias 2015-10-14 10:09:15 +0000 5556) lisAutomaticallyUseSinglePossibleIdent = 'Automatically use single possible identifier';
The relevant line was committed by Martin in f3f864d9677.
git checkout f3f864d9677
brings us there and
gitk shows details of it. 5 files were modified. The commit message is :
IDE, SourceEditor: implemented identifier-completion activates on typing. Issue #0033054 (different from patch)The linked bug tracker issue may give further information.
Following the changes should lead further to the actual completion feature code.
For haunting regression bugs
git bisect is a very useful command.
If you know a certain piece of code is involved but you don't know the code path leading to it (it is called from many places), debug the IDE using another instance of the IDE and project
lazarus.lpi.
The above debug method may screw up mouse messages when dealing with GUI code. Then it is better to debug with
DebugLn() calls. They are very useful and give lots of data quickly when put in strategic places.
These were generic methods that can be used for finding any code.
At least I use them often.