Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

1. Define helper methods for generated PSI elements

If we want to have custom methods in PSI classes we need to define them separately and ask Grammar-Kit to embed them into generated code.

Let's define an utility class with these helper methods.

2. Update grammar and regenerate the parser

Now we tell to use this utility class in the grammar file via stubParserClass attribute.

To tell which methods for which PSI classes must be used we specify {methods=[...]} for particular rule.

After we made our changes to the grammar we can regenerate the parser and PSI classes.

3. Define an utility class for scanning virtual files

Now we need to define an utility to find PSI elements of properties in the project. We will use this utility later when implementing code assistance.

  • No labels