Code tools and changing include file text

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Code tools and changing include file text

Free Pascal - General mailing list
When a file changes I get the full source text and update the version in code tools by doing this:

Code := CodeToolBoss.FindFile(Path);
Code.Source := text;

This works but I'm having problems with include files now because I'm updating the code buffer for the include file but the main code doesn't seem to get updated. Do I need to notify the main code of changes or inject the include code into the main code buffer?

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Code tools and changing include file text

Free Pascal - General mailing list
On Wed, 13 May 2020 10:48:14 +0700
Ryan Joseph via fpc-pascal <[hidden email]> wrote:

> When a file changes I get the full source text and update the version
> in code tools by doing this:
>
> Code := CodeToolBoss.FindFile(Path);
> Code.Source := text;
>
> This works but I'm having problems with include files now because I'm
> updating the code buffer for the include file but the main code
> doesn't seem to get updated. Do I need to notify the main code of
> changes or inject the include code into the main code buffer?

No.

If Path a real filename (absolute, have a full path) you should do
Code.LockAutoDiskRevert, so codetools do no automatically load the
file, when it has changed.

Otherwise:
Can you create an example?

Mattias
_______________________________________________
fpc-pascal maillist  -  [hidden email]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal