Ok, lots to read up
1) your problem is not what I meant to describe.
Your problem is codetool mistakes the static.
You can reproduce your issue with this code
program Project1;
var
a: (a1,a2);
static: integer;
procedure foo;
begin
b:=1; // try to create declaration for b // ctrl-shift-c
end;
begin
foo;
end.
To workaround, change your declaration of static to "&static" (note, that disables the hint, on that word, but on other occurrences of static the hint should still work)
2) My described issue.
Sometimes you have code that codetool initially is ok with. And then at some time it reports an error, even so the code has not changed. And my workaround for that does not need to compile, but to invoke codetools on the intentional error.
3) the blank editor.
Any chance you used (from the "file" menu): "Close all" before restarting the IDE?
"Close all" only closes the editors. Your project is still open. And the project session will then save with all editors closed. So you need to open unit by unit again.
I just looked, and that menu entry has been removed now (in 3.99).
There is "Close project" in the project menu.