Groovy is (at the current time) a rough and ready Nova extension for the Groovy programming language. It basically does nothing beyond package up other people's good work into a Nova extension.
Groovy requires some additional tools to be installed on your Mac:
- Java (However that maybe: Homebrew, or Adoptium, or other)
Groovy runs automatically (syntax highlighting and a language server) on any file identified as Groovy. The language server will report errors and warnings in Nova's Issues sidebar and the editor gutter.
There is minimal configuration at the moment. You can set the path the the java
binary by opening Extensions → Extension Library... then selecting Groovy's Preferences tab.
This extension bundles in the Groovy Language Server. That will need updating periodically. Follow their README instructions to update the jar.
It's using tree-sitter since that is the preferred approach in Nova now. There look to be a few options now (although very recently weren't any):
I've tried all of these in order and so am currently using evolighting/tree-sitter-groovy.
The dylib will have to be re-built periodically per the Nova docs, e.g:
cd /path/to/groovy-tree-sitter
# Copy in the example compile_parser.sh and Makefile provided by Panic
tree-sitter generate
./compile_parser.sh ./ /Applications/Nova.app/
cp libtree-sitter-groovy.dylib /path/to/this/Groovy.novaextension/Syntaxes/libtree-sitter-groovy.dylib
cd /path/to/this/Groovy.novaextension/Syntaxes/libtree-sitter-groovy.dylib
codesign -s - Syntaxes/libtree-sitter-groovy.dylib
Asides from actually finding time to work on this...
- Understand Tree-sitter and
highlights.scm
. Try as I might I just don't get them yet. - Maybe tweak whichever tree-sitter-groovy is currently being used, if needed
- Tweak
highlights.scm
so it's better - Goto 2, repeat, etc
I wanted syntax highlighting for working on Jenkins Groovy files. In my naïvety I didn't realise the Language Server Protocol stuff didn't include syntax highlighting so implemented that needlessly really.
- Groovy Language Server
- tree-sitter-groovy
- tree-sitter-java (I based highlights.scm on theirs)