Good examples of a custom plugin with Type Checking or similar computation? Follow
I really appreciate the thorough Language plugin documentation and tutorials, but I still don't have a good idea for how best to implement a more complex static analysis tool (like a type checker).
Are there any good, readable, idiomatic open source examples of a plugin which:
1) Traverses the tree, computes results for subexpressions, and depends on resolved references during it's computation.
2) Caches/Memoizes/Stores the computed results in an idiomatic way as-needed.
3) Exposes the resulting data (including any errors) via an Annotator.
Please sign in to leave a comment.
We don't have such a list.
I suggest browsing a list of plugins on IntelliJ Platform Explorer:
It is focused on extensions/listeners, but in the last column, you can notice the categories list, and the Programming Language category is for plugins implementing language support (unfortunately, there is no filter for this yet).
You can also think about what languages your language is similar to and find their plugin implementation to get inspiration.
If you don't find anything suitable or easy to understand, I recommend starting the implementation in small steps, e.g., implement the references support at first, and then identify bottlenecks and add caching (according to documentation and API usages available in the Platform Code). Trying to understand everything before starting the actual work may be hard.