Skip to content

billy-briggs-dev/groovy-language-server

 
 

Repository files navigation

Groovy Language Server

A language server for Groovy.

The following language server protocol requests are currently supported:

  • codeLens
  • completion
  • definition
  • documentSymbol
  • foldingRange
  • formatting (document/range)
  • hover
  • prepareRename
  • references
  • rename
  • selectionRange
  • signatureHelp
  • symbol
  • typeDefinition

The sample VS Code extension also registers a minimal Debug Adapter Protocol implementation for Groovy with basic breakpoint, variable, and expression evaluation support.

The following configuration options are supported:

  • groovy.java.home (string - sets a custom JDK path)
  • groovy.classpath (string[] - sets a custom classpath to include .jar files)
  • groovy.formatting.formatOnSave (boolean - format on save)
  • groovy.formatting.indentSize (number - indentation size)
  • groovy.formatting.braceStyle (sameLine | nextLine - brace placement)
  • groovy.formatting.spaceAroundOperators (boolean - spacing around operators)
  • groovy.formatting.spaceAfterCommas (boolean - spacing after commas)
  • groovy.formatting.spaceInsideBraces (boolean - spacing inside braces)
  • groovy.classpathRecursive (boolean - when true, classpath folders are searched recursively for .jar files)
  • groovy.gradle.classpathScopes (string[] - Gradle dependency scopes to include: compile, runtime, test, provided)
  • groovy.gradle.includeBuildscript (boolean - include buildSrc/buildscript outputs in the classpath)
  • groovy.excludePatterns (string[] - glob patterns to exclude from project scanning)
  • groovy.sourceRoots (string[] - explicit source roots; defaults to auto-detecting src/main/groovy and src/test/groovy)
  • groovy.maven.repositories (string[] - Maven repository URLs)
  • groovy.maven.dependencies (string[] - Maven coordinates: group:artifact:version[:classifier][@ext])

Build

To build from the command line, run the following command:

./gradlew build

This will create build/libs/groovy-language-server-all.jar.

Run

To run the language server, use the following command:

java -jar groovy-language-server-all.jar

Language server protocol messages are passed using standard I/O.

Editors and IDEs

A sample language extension for Visual Studio Code is available in the vscode-extension directory. There are no plans to release this extension to the VSCode Marketplace at this time.

Instructions for setting up the language server in Sublime Text is available in the sublime-text directory.

Moonshine IDE natively provides a Grails project type that automatically configures the language server.

Feature Documentation

For comprehensive documentation on features and roadmap:

About

A language server for Groovy — designed for Moonshine IDE, but may be useful in other environments

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Java 96.2%
  • TypeScript 3.5%
  • JavaScript 0.3%