[Lazarus] Another IDE interface question

Mattias Gaertner nc-gaertnma at netcologne.de
Sat Feb 5 16:02:54 CET 2011


 



Darius Blaszyk <dhkblaszyk at zeelandnet.nl> hat am 5. Februar 2011 um 14:55
geschrieben:


> 
> 
> > 
> > 
> > > 
> > > > 1. get all the -Fu and -Fi folders so the package can search them and
> > > > allow the user to include/exclude them from profiling, which method to
> > > > use in LazIDEIntf?


> > I added some info:
> > 
> > http://wiki.lazarus.freepascal.org/Extending_the_IDE#Getting_the_search_paths_for_units_and_include_filesuses
> > CodeToolManager;
> > 

> Again a couple of questions regarding the IDE interface;
> 
> 1. Is it possible to (temporarily) suppress the check if a file on disk has
> changed?
 
No. 
I could add this, but maybe there are better ways than changing the source back
and forth on disk.
Basically you need a preprocessor for FPC.
The first step is to extend FPC to not load files directly from disk. I tried
some months ago and it was amazingly simple.
It is quite simple to build your own custom compiler and it uses a central place
to load source files. With a simple patch the central loading can be extended
for an overload. This costs no performance and has very low maintenance cost for
the FPC team, so there is a good chance the patch will be applied. At that time
DoDi was working on the compiler, so I waited for the dust to settle and then I
forgot to provide the patch. The patch is on another computer. I can search for
it next week.
A custom compiler can then add the file hook to feed fpc with preprocessed
source files, for example your fpfprofile code.
Of course eventually it would be nice if FPC could use an optional preprocessor
without the need to compile your own compiler.
 
Another solution is to implement a ramdisk. That would work with any existing
compilers, but requires one implementation per OS and can be tricky because of
access rights.
 
 
 

    if FileExistsUTF8(Filename) then
      LazarusIDE.DoRevertEditorFile(Filename)
    else
      LazarusIDE.DoCloseEditorFile(Filename,[cfQuiet]);




> 
> 2. I would like to add a unit search path to the project and later be able to
> remove it again. Is this possible?
 
Yes. 
LazarusIDE.ActiveProject.LazCompilerOptions.OtherUnitFiles
 
But the handling of the modified flags can be tricky.
 
 
Mattias
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20110205/1a9b882b/attachment-0003.html>


More information about the Lazarus mailing list