Introducing the Stan JetBrains plugin

I created a JetBrains plugin for the Stan language support. If you use PyCharm, DataSpell, IntelliJ or any other compatible IDE, you can check it out. So far it’s intended only to help with editing stan language files, it doesn’t build or run any models.

It should be available in the official marketplace when you go to Setting → Plugins, you should be able to search for it. You can also get it from here: https://plugins.jetbrains.com/plugin/32004-stan-language-support
or build from sources here: GitHub - jachymb/JetBrainsStanPlugin: Stan language plugin for JetBrains IDEs · GitHub

It’s an initial release so it may need a bit of polishing, but so far it supports, at least in the most part, the following:

  • Syntax highlighting (configurable: Settings → Editor → Color Scheme → Stan)
  • Syntax validation (full AST parsing internally)
  • Code folding (on {} blocks)
  • Basic autocompletion (all builtins, keywords, variable names in scope)
  • Basic type checking
  • Semantic checks for unused variables
  • Semantic checks for name shadowing
  • Create a new Stan file from the file explorer context menu

It reuses syntax and semantics defined in Stanc3.
Feel free to report bugs and missing functionality.

Neat! I’m surprised to see this re-implement parsing and semantic analysis rather than use the Language Server Protocol support. Did that mean it could support more editors?