[QScintilla] AutoCompletion for object based languages...is it possible?

Gedalia Pasternak gedalia at gmail.com
Mon Oct 27 17:19:41 GMT 2008


Hi Eric,
   I have autocomplete working for objects, the way I do it is by looking
for .,->,: every time a keystroke is pressed. I then parse the code that
comes before the member operator and create a user list on the fly with
available information. In my case I'm parsing a dynamic language ( lua ) and
I've just resorted to having rules about the names of objects (ugh).
   I think some those concepts got integrated into the new QsciAbstractAPIs
class
http://www.riverbankcomputing.co.uk/static/Docs/QScintilla2/classQsciAbstractAPIs.html#62a50642b0b058016ed2fdf0922bdee8

  I haven't actually upgraded to qscintilla 2.3 yet. But I'd probably start
with the abstract API class.

   Sorta p.s. I don't think you'll find a simple way to determine what type
an object is without either some serious parsing of your code or a language
that supports reflection, even with a programming language that would let
you check what properties a given object has, it's tough to do that before
you compile the code..

-gedalia

On Mon, Oct 27, 2008 at 12:40 PM, Eric Fontana <eric at carbondesignsystems.com
> wrote:

>  Well; I've been experimenting with the AutoComplete (QsciAPIs) api and
> got
>
> it working, however its not that useful without the next step;
>
>
>
> I have an embedded QtScript object in my app, I registered a global
>
> property "Project" to access it from the Script.
>
>
>
> When you type "Project" (dot) "Project." the autocomplete pops up
>
> and I can select a method name ,that works great.
>
>
>
> Howerver, if a method returns an object, lets say for example:
>
>
>
> var x = Project.Color;
>
>
>
> If color was a QObject which had a name property I can type
>
>  x.name
>
>
>
> However, since "x" isn't known to the autocomplete api, it's not known.
>
>
>
> Is there a way to know when "x" is defined "var x = …" easily?
>
>
>
> I also noticed that the load() method doesn't support a return type
>
> from the loader file.
>
>
>
> Has anyone done this before?
>
>
>
> Thanks
>
>
>
> Eric
>
>
>
> _______________________________________________
> QScintilla mailing list
> QScintilla at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/qscintilla
>
>


-- 
---------------------------------------------------------------
cel: 917.776.8346                 AIM: gedaliap
http://www.gedalia.net
---------------------------------------------------------------
Fight Entropy!!!  Fight Entropy!!!  Figth Etnropy! !
iFgth Etnrop!y ! giFth tErno!py !  giFt htrEno!p y! --- Well maybe
not...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/qscintilla/attachments/20081027/3d7c0979/attachment.html


More information about the QScintilla mailing list