atomicules / Groovy.novaextension

Rough and ready Groovy extension for Nova

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 Nova screenshot

Requirements

Groovy requires some additional tools to be installed on your Mac:

  • Java (However that maybe: Homebrew, or Adoptium, or other)

Usage

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.

Configuration

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.

Developing

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

Todo

Asides from actually finding time to work on this...

  1. Understand Tree-sitter and highlights.scm. Try as I might I just don't get them yet.
  2. Maybe tweak whichever tree-sitter-groovy is currently being used, if needed
  3. Tweak highlights.scm so it's better
  4. Goto 2, repeat, etc

Motivation

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.

Credits

About

Rough and ready Groovy extension for Nova

License:MIT License


Languages

Language:JavaScript 49.1%Language:Scheme 26.3%Language:Groovy 24.6%