[QScintilla] autocomplete question
Gedalia Pasternak
gedalia at gmail.com
Fri Jun 27 19:55:28 BST 2008
Hi ,
I've been trying to work with the qsciapis to trigger some complex
autocomplete responses.
it seems like qsciapis are only designed to handle global functions, or
function where the object name is known.
I'm wondering if there are any facilities for something more object
oriented.
I'm trying to implement this for lua, so valid function separators are '.'
and ':' if I know the class of the object on the left side of the separator
is there any way to get an autocomplete list with a list of that object's
members.
showUserList seems to be my only option, at the same time it seems a bit
dumb:
slotTextChange()
{
int line_num;
int index;
m_textedit_code->getCursorPosition(&line_num, &index);
QString line = m_textedit_code->text(line_num);
QChar curr_char = line.at(index);
if(curr_char == ':' || curr_char == '.')
{
QString current_line = line.left( index );
QStringList list = QStringList::split(QRegExp("[
]|[(]|[)]|[[]|[]]|[;]|[,]|[\n]|[\r]"), current_line);
QString object_name = list[list.size()-1];
if(object_name == "Known_Object"){
QStringList function_list = QStringList::split(" ",
QString("foo1 bar2"));
m_textedit_code->showUserList ( 1, function_list);
}
}
Unfortunately the autocomplete box instantly disappears because
AutoComplete::autoHide defaults to true, and qscintilla thinks none of the
possible replacements has a ':', even if I add a ':' to the various function
names I don't get the nice eliminate "all the non potential matches"
behavior of the qsciapis code.
Currently qsciapis seems somewhat hard coded with no virtual functions,
or slots/signals, is there any sample code floating around that might help
me?
P.S. as long as I'm posting... can anyone tell me why the default lua Lexer
seems so much less visually appealing then the perl one? Keywords and
special characters in Perl appear bolder and it just generally seems more
readable. Unless I'm messing something up, It seems odd that things aren't
more uniform.
thanks much
-Gedalia Pasternak
--
---------------------------------------------------------------
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/20080627/6f56bab0/attachment.html
More information about the QScintilla
mailing list