Hello,
I'd like to have documentation for some parts of a program in include files and, ideally have Lazarus jump/open the include file if directed to do so.
In code the idea is as follows:
program _IncludeDoc;
begin
{$ifdef NOT_DEFINED}
{$include DocPage.inc}
{$endif}
readln;
end.
if the programmer right-clicks on DocPage.inc and selects "Find declaration of DocPage", Lazarus would open the DocPage.inc file in an editor window.
The problem is Codetools does not find the DocPage.inc file because it is in the "NOT_DEFINED". Commenting out the "ifdef/endif" combination solves the problem but this has two (2) undesirable side effects:
1. FPC opens the file, reads it and attempts to compile it. That slows down compilation when there are many such files.
2. the contents of the file must be all comments, that is, every line must be preceded by a // or be in a comment block { } or (* *). It would be nicer if the file could contain just plain text.
The question is: is there a way to have the "Find declaration of DocPage" work without having to make it visible to FPC ?
Attached is a tiny project with the above code and a sample doc file.
Thank you for your help.