All,
I'm using QScintilla to syntax-highlight and autocomplete my domain specific language (DSL).
I wrote a custom lexer by re-implementing (QsciLexerCustom) and I'm trying to use the auto-completion. My problem is that the auto-completion doesn't work like I want. I'd like my custom lexer to work like the QsciLexerPython. That is, if i add 'toto.titi.tata' to the api, when i type 'toto.' in my qscintilla editor, it suggests me 'titi.tata'. As of now, it is suggesting me toto.titi.tata. :(
I tried to add 'autoCompletionWordSeparators' to my lexer but it is not working. How can i make my custom lexer auto-complete work like the QsciLexerPython? Thanks a lot !
Lexer = customlexer(self.text)
api = QsciAPIs(Lexer)
api.add('toto.titi.tata')
api.prepare()
Lexer.setAPIs(api)
self.text.setLexer(Lexer)
class lexer(QsciLexerCustom):
def __init__(self, parent):
QsciLexerCustom.__init__(self, parent)
def autoCompletionWordSeparators(self):
return ['.']