Adds support for version of Squirrel used in Battle Brothers game, plus modding helpers.
Roughly based on original Squirrel plugin for Intellij README.md, but mostly rewritten from scratch.
- Get Intellij IDEA with version at least 2024.2, Community or Ultimate, doesn't matter
- Uninstall old Squirrel IDE plugin
- Download the latest zip from the releases page.
- Follow the install plugin from disk instructions
- Add unpacked vanilla to the project and mark as source
Right click | Mark directory as | Sources root
- Mark mod directories as sources
Right click | Mark directory as | Sources root
- Mark mods or build directories you don't want indexed as
Excluded
- If completion doesn't work, rebuild indexes
File | Invalidate caches | check first 2 options
- Supports multi-mod environment by tracking references in all relevant mods,
- Reworked BNF based parser to fit BB version of Squirrel better,
- NOTE: It's stricter when it comes to syntax than ingame interpreter, but is a bit more lenient than vanilla code is.
- To check if there are syntax error, add it as source, then on mod
Right click | Analyze | Inspect Code
, it's requirement for code completion to work
- New file templates for classes and modding related stuff
- Code highlighting
- BB aware .nut file structure validation
- Block folding
- Customizable code formatter
- Live code validation and various on-demand inspections
- Code completion for BB classes, modding hooks and modern hooks, also non-dynamic global variables,
- for sanity only in
::
andgt.
spaces,this.
is too ambiguous to resolve references consistently, refactor to::
- for sanity only in
- Find usage on 'class' names, to quickly find all hooks and references in code
- String reference tracking (scripts, hooks and gfx files)
- Images and colors used in code show on gutter
- Marking directories as sources/exclude affects reference resolution scope
- ... more coming? maybe
It's MIT, feel free.
- Java 17+
- IntelliJ
- Install Grammar-Kit for
*.bnf
and*.flex
file support- Adds BNF Grammars and JFlex files editing support including parser/PSI code generator
- Clone repository
- Follow instructions on the plugin development environment setup page
- Enable the Gradle plugin
- Enable the Plugin DevKit
- Use
File | New… | Project from Existing Sources
and open the cloned repository directory
- Run the Gradle
runIde
task which will start a new IntelliJ instance with the plugin installed. - Install PsiViewer on that instance to see how files are structured (
Tools | View PSI structure for Current File...
). It helps greatly when changing code in plugin.