Intellisense(tm) again

Damien House hadamin at hotmail.com
Tue Jun 22 23:41:41 BST 1999


>>2) we need to have ALL the KDE and QT functions in a database, what >>we 
>>can
>>do i a create a file on first startup that generate that >>file/database.
>>If you want to upgrade we can make a rescan option..

This is ubsurd! (not to be rude :)

OK, I didn't want to go this far in depth but it seems as if none of you 
have looked at the source for CBuilder or Delphi's CodeCompletion, so I'll 
go as far as I know and what I speculate.

STEP A --
Delphi's IDE is a bunch of classes, like kdev, except the Units (equivilent 
to C++ cpp or cc files) are treated as classes as well, where the classes, 
functions, and other objects declared in the unit, or module, are the member 
functions of that unit.
  SPECULATION -- Delphi can use this in two ways
   1.  Lets say you add a unit to your uses clause (like #include),
       Delphi *MIGHT* scan through that file and locate all of
       the global classes and functions and make a descriptor table
       for the unit "on the fly" for the IDE.
   2.  It *MIGHT* not scan the file until it needs to, in which it
       will go through and look for what it is searching for and
       once it is found, it uses the info for the IDE
   I think it would be number 1 for the most obvioud reason of speed.

STEP B --
Lets say you type
  myObject.

Delphi's IDE will scan the "OnKeyPress" event in the SourceCode Browser and 
upon catching that you just typed teh dot operator and it is followed by a 
word, not nessacarily an object, it will first use a method to find out if 
that object exists.  First it would find out where "myObject" descended 
from.  It would then find out where the declaration for that ancestor is by:
  1.  If it uses the 1st method from Step A, it will look up it's own 
descriptor table in teh IDE, probably some sort of advanced searching would 
be done to find the pointer to the objects (or function's) descriptor table.

OR

  2.  It would look up all of teh units you included and search for the 
object, then getting a pointer to it's descriptor table.

STEP C--
Once the IDE has the pointer to its descriptor table, it can use this info 
to generate a list box with the members, functions, and parameters and the 
function return types.

OPTIONAL STEP D--
Lets say you type (in pascal)
  var
    strTemp: string;
    myObject: TMyObject;
  begin
    strTemp := myObject.
  end;

Upon all of the above steps, Delphi (Or VB, I'm not sure which one) would go 
the extra mile by only displaying members and member funtions that return a 
"string" type.  It would only do this if you had been typing each thing 
consecutivly.  If you wanted the rest of the members, you woudl simply hit 
esc, backspace the dot, and re-type the dot.

Ok, I've explained a little of teh theory behind this, but the question is 
HOW.  HOW will we apply this to kdev.  Is kdev capable of doing this right 
now, or will there need to be modification to it's base class to support 
this.  These are teh questions that we should be asking.  Please, those of 
you that have WIndows developer products that do this, please try to figure 
out how to explain it to the talented linux developers that have never seen 
it.  I'm sure once you guys see it, you'll want to see the source for it.

Does anyone have CBuilders' source for it?  I have Delphi's, but liek I 
said, there's a lot of assembly so I can read only but so much.

Damien House
Chief Software Engineer
Full Circle Solutions, Inc.
410-659-9983


_______________________________________________________________
Get Free Email and Do More On The Web. Visit http://www.msn.com



More information about the KDevelop mailing list