Delphi kibitz compiler hook

Use this hook for Delphi's Kibitz Compiler to let your expert know which words are allowed at a certain position in a unit.
Download Kibitz Compiler
Download Kibitz Compiler Demo

Introduction

Delphi 4 compiles your program at the background to give you a list of possible strings you can type at the current cursor position (the so called Code Completion, which is made possible by the kibitz compiler), with this code you can now get that list from any position in a unit opened in the editor

This code is also part of GExperts and has the same license agreement (open source), the version provided here may be modify because:

  • It must work without GExperts.
  • Something isn't yet included in GExperts.
  • I added functionality not required by GExperts.
  • I couldn't resist the temptation to include functionality not yet completely finished.

How to use the Kibitz Compiler.

Call

procedure GetKibitzSymbols(EditControl: TObject; XPos, YPos: Integer; Strings: TStrings),

the first parameter is the EditControl which contains the unit, following are the X and Y Coordinate of the position at which the list must be generated (the X coordinate starts at 0 and the Y coordinate at 1, thus the first position is 0, 1). And finally is passed a string list which the new strings will be added to.

How does the Kibitz Compiler work.

First of all look at the source code, it is very short. And the function I used are very straightforward. I've also reversed engineered the TCodecompletionlManagerPerformKibitz procedure from dphideXX.bpl.


2-9-1999: Exceptions rased at initialization are swallowed and only disables the kibitz compiler and there is now D5 support.