What can cause this error? Where to look for problems?
There isn't *one* specific place....
When you press ctrl-space the IDE must read all your sources, to find possible completion.
The part of the IDE that does that is called "codetool". It has it's own pascal parser. And that parser might have a bug. Therefore fpc may be able to compile. But codetool may not be able to read your code.
How to fix... Ultimately: find sources that can be used to *always* reproduce the problem. Then report a bug.
In the meantime....
Are the error you get sporadic?
I.e. if you restart the IDE, can you then do the ctrl-space that failed before?
That is can you do it at least once, just after starting the IDE. Even if later it will fail again?
Then it may be that codetools cache gets corrupted.
If you do not want to restart the IDE, then try this
- go up one or two lines from the "jumped to" error pos.
- make any dummy change to the source
- invoke completion on the dummy change
- undo the change
That normally forces codetools to reread that unit.
There is the menu: View > IDE internals > show codetool node....
(or similar)
That shows some of the internal info from codetool.
If you can't find an example to 100% reproduce it then you can try to report without this.
The report will need the sources on which it happens.
- At the very least the file that codetool reports the error in (with inc files), but probably others to.
- The code where you invoked completion
- All the content from the above menu (opened while the error file is active)