[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kdevelop-devel
Subject:    Custom range for CodeCompletion
From:       "Niko Sams" <niko.sams () gmail ! com>
Date:       2008-11-23 13:38:41
Message-ID: 629542d40811230538g44530c59y5e34823a17c5a9f4 () mail ! gmail ! com
[Download RAW message or body]

Hi,

Some languages have special characters for example in variable names (as
in php every variable has a $ prefix) or preprocessor directives start with #.
Currently Kate has a hardcoded regluar expression to determine this range.

This patch adds a new signal to the CodeCompletionModel interface:
void modifyCompletionRange(const KTextEditor::Range& word, const
QRegExp& allowedText);

With this every model can have it's own range used for completion.
allowedText is needed
to have a custom regular expression to detect when completion should be aborted.
this is currently hardcoded and also causes problems with $ in variable names.

What is still hardcoded in KateCompletionWidget is when
automaticInvocation should be started.
I think this should be configurable too - though I have no idea how to
do this without adding a
virtual function to CodeCompletionModel.

Please review the patch - especially if it is API and ABI compatible.

Niko

_______________________________________________
KDevelop-devel mailing list
KDevelop-devel@kdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic