We need our users to write python code to extend our software. We are thinking of using the code editor functionality along with PythonParser as lexer. Our users will use some APIs that we will provide and use some keywords that we will be providing (not in the file that user will be editing). I have a few questions -
- I wanted to know how can I include these APIs and keywords for code completion and other features.
- We would like the function arguments to be colored differently.
I assume you refer to our own Alternet.Syntax.Parsers.Python.PythonParser here, not an LSP version, right?
It surely possible possible to extend our PythonParser with extra reswords and different highlighting for method parameters - we will provide an example shortly.
I’ve uploaded a sample project here, it shows how to extend syntax highlighting to handle additional reswords and method parameters:
Right now we do not display keywords in the code completion, however this should be addressed in the coming update, which we will be releasing within two weeks.
We might also extend our Classifier interface so reserved words can be specified there.
It worked very well - thanks a lot. I guess this topic “How to inherit and override PythonParser to create an customized parser” needs more documentation. And I will need it as I need to make more modifications as I am competing with someone who is starting from AvalonEdit.