Difference between revisions of "Codetools"

From Lazarus wiki
Jump to navigationJump to search
 
Line 3: Line 3:
 
The codetools are a module of their own and are licensed under GPL.
 
The codetools are a module of their own and are licensed under GPL.
  
You can use the codetools without the IDE. This can be used to test a new tool. See for example
+
You can use the codetools without the IDE. This can be used to test a new tool. An easy example is
<lazarusdir>/components/codetools/methodjumping.pas
+
  <lazarusdir>/components/codetools/methodjumping.lpi
  
To test find declaration, the codetools need to parse sources. Especially the RTL and FCL sources. FPC is a very complex project with lots of search paths, include files and makros. The codetools need to know all these paths and makros in order to parse this djungel. To setup all this easily the codetools contains predefined templates for FPC, Lazarus, Delphi and Kylix source directories. FPC is more difficult to setup, as the FPC sources contain multiple versions of a unit.
+
To test find declaration, the codetools need to parse sources. Especially the RTL and FCL sources. FPC is a very complex project with lots of search paths, include files and makros. The codetools need to know all these paths and makros in order to parse this djungel. To setup all this easily the codetools contains predefined templates for FPC, Lazarus, Delphi and Kylix source directories.  
 +
See for a find declaration example
 +
  <lazarusdir>/components/codetools/finddeclaration.lpi
 +
 
 +
Because the FPC sources contain multiple versions of some units, and the FPC sources changes often, the codetools does not use a fixed path table, but instead scan first the whole FPC directory structure and try to guess, what source is the right for the current TargetOS and TargetCPU. This scan may take a while. So the result is saved. From time to when the FPC sources have moved or renamed a unit this scan must be repeated. The IDE does this rescan, whenever the compiler executable changed or the user forces a 'Tools > Rescan FPC source directory'.

Revision as of 13:36, 26 February 2006

What are the codetools

The codetools are a module of their own and are licensed under GPL.

You can use the codetools without the IDE. This can be used to test a new tool. An easy example is

 <lazarusdir>/components/codetools/methodjumping.lpi

To test find declaration, the codetools need to parse sources. Especially the RTL and FCL sources. FPC is a very complex project with lots of search paths, include files and makros. The codetools need to know all these paths and makros in order to parse this djungel. To setup all this easily the codetools contains predefined templates for FPC, Lazarus, Delphi and Kylix source directories. See for a find declaration example

 <lazarusdir>/components/codetools/finddeclaration.lpi

Because the FPC sources contain multiple versions of some units, and the FPC sources changes often, the codetools does not use a fixed path table, but instead scan first the whole FPC directory structure and try to guess, what source is the right for the current TargetOS and TargetCPU. This scan may take a while. So the result is saved. From time to when the FPC sources have moved or renamed a unit this scan must be repeated. The IDE does this rescan, whenever the compiler executable changed or the user forces a 'Tools > Rescan FPC source directory'.