Enhancing the kdevelop editor (was: Re: Intellisense (tm))

Ansley, Michael Michael.Ansley at intec.co.za
Wed Jun 23 08:51:30 BST 1999


For those of you who have been fortunate enough not to have to use the
product, Visual Basic has something (one of a handful) which is very useful.
It gives you drop down list of members (no context sensitivity), and
highlights the first match for however many letters you have typed.  If it
can't make a match, then nothing is highlighted.  At any point, you can hit
any key which is illegal in an identifier (normally Tab, Space or '(' ) to
have the editor complete whatever is highlighted, and roll up the drop down.
At this point, the function help normally takes over, because you would
probably have hit the '(' to start entering parameters.  Very efficient.  Of
course, we can do better than VB with things like context-sensitivity, and
decent icons for each type of member, but the principle is the same.

This is about the lowest common denominator, and should be pretty easy to
implement.  What is required is that during parsing, a member database is
built.  Probably not too difficult, but it is going to require some changes
to the refresh mechanism, because we can't have KDev stopping the show to
refresh.

I just realized how VB does its parsing.  It parses every line after you
change lines.  Obviously this is a little more difficult with C++, but the
idea is perhaps worth looking into.  Parse every time the cursor moves
through a ';' and '}', and possibly a couple of others.  And then, you only
need to parse one function at a time, not the whole program.  Ideas...


MikeA

>> -----Original Message-----
>> From: holle at almaden.ibm.com [mailto:holle at almaden.ibm.com]
>> Sent: Tuesday, June 22, 1999 8:33 PM
>> To: kdevelop at fara3.cs.uni-potsdam.de
>> Subject: Re: Enhancing the kdevelop editor (was: Re: 
>> Intellisense (tm))
>> 
>> 
>> 
>> 
>> While reading Massimos comments I got the impression that he 
>> is right.
>> What about doing it like we can see it in some webbrowsers 
>> URL field under the
>> evil-os:
>> You start typing and while you do so there will be a 
>> selected piece of text
>> completing the part of the word you typed. If that is not 
>> what you want, then
>> you just continue typing until the completetion is 
>> correct/you finished the
>> word. This would not take the focus away from the editor 
>> window. Furthermore it
>> is not too distracting.
>> I think we could even combine this with a little non-framed 
>> popup window under
>> the word you are typing which does *not* get the focus but 
>> rather shows what
>> options the editor sees for completing this word. Then you 
>> can just go on typing
>> or press for example cursor down or cursor up, to select on 
>> completetion. Then
>> once you are happy with the completition you can just 
>> <Ctrl-CursorRight> or
>> <End> to skip the rest. We could even make the popup window 
>> go away once you
>> pressed <Esc> and appear again if you for example press 
>> <Ctrl-Space> -- maybe
>> that even works for the completition -- you press <Esc> and 
>> the editor does not
>> try to completet things anymore unless you press 
>> <Ctrl-Space> or go to the
>> appropriate config menu entry.
>> 
>> But I think that this style is just **one** way to do it and 
>> we should have
>> different way, so programmers can choose what they like 
>> most. For me that would
>> proably be the <Ctrl-/> emacs style :-))
>> 
>> -holger
>> 
>> 
>> Massimo Morin <mmorin at schedsys.com> on 22/06/99 06:36:03
>> 
>> Please respond to kdevelop at fara3.cs.uni-potsdam.de
>> 
>> To:   kdevelop at fara3.cs.uni-potsdam.de
>> cc:    (bcc: Holger Lehmann/Almaden/Contr/IBM)
>> Subject:  Re: Enhancing the kdevelop editor (was: Re: 
>> Intellisense (tm))
>> 
>> 
>> 
>> 
>> 
>> Hi,
>>      about the intellisense, I think it is good, but if I 
>> have to use the
>> mouse for selecting the method I want to use (from the popup 
>> window) to
>> me is a waste of time: I can more easly write enterelly the 
>> method name
>> in the time I move the hand from the keyboard to the mouse and then
>> selecting the method.
>> Even worse is if the popup window is going to grab the focus: you'll
>> never have reed of it until you re-click on the editor!
>> 
>> Well, I don't know how it works on Windoze (I saw a popup window on
>> Visual Studio and.. this is the first think I disable!), but if I may
>> suggest:
>> why not a small yellow window like the baloon and a 
>> completion via tabs?
>> It should work as the bash/tcsh tab key, where it completes the name
>> after you press tab (and beeps if no competion availabel ;) 
>> ), without
>> forcing you to do anything....
>> in that way if someone wants to write completelly the name of the
>> function/method/member is not forced to be interruped by 
>> this intrusive
>> list...
>> 
>> My 0.02$
>>                Massimo
>> 
>> 
>> holle at almaden.ibm.com wrote:
>> >
>> > Hey coders :-))))
>> >
>> > did you read what Kevin wrote ?
>> > This seems to me as if we will need it. It is a very nice 
>> feature, which I
>> would
>> ----snip----
>> > > >(global-set-key [ctrl-space] 'dabbrev-expand) ; for the 
>> .emacs file
>> > > Sure I know. My point was that THAT functionality is NOT 
>> the same thing as
>> > > Intellisence.
>> 
>> --
>> Massimo Morin        | Scheduling Systems Inc.
>> Software Engineer    |
>> -------------------  | Three University Office Park, suite 100
>> 13, Charnwood Rd     | 95 Sawyer Road
>> Somerville 02144 MA  | Waltham,
>> -------------------  | 02453 Massachusetts
>> +1 (617) 623-4155    | +1 (781) 893-0390
>> mmorin at schedsys.com  | http://www.schedsys.com
>> -------------------------------------------------------------
>> ---------
>> Never attribute to malice that which can be adequately explained by
>> stupidity.
>> 
>> 
>> 



More information about the KDevelop mailing list