Code completion words

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 -

  1. I wanted to know how can I include these APIs and keywords for code completion and other features.
  2. We would like the function arguments to be colored differently.

Hi Kapil,

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.

Kind regards,
Dmitry

Hi Kapil,

I’ve uploaded a sample project here, it shows how to extend syntax highlighting to handle additional reswords and method parameters:
https://drive.google.com/file/d/1uT2jsbg6OjV5NrFZKb29w4BphcHvPbWd/view?usp=sharing

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.

Kind regards,
Andrew

1 Like

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.

1 Like