Skip to content
This repository was archived by the owner on Aug 4, 2026. It is now read-only.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go for Red

Important

This pack has moved to codersauce/red-language-packs. This repository is archived for history and existing clone URLs. Install the maintained release with red plugin install --catalog go-language.

The official Go language pack for the Red editor.

It provides Tree-sitter syntax highlighting, Go module and workspace detection, four-column indentation, line comments, and gopls support for hover, completion, go-to-definition, diagnostics, symbols, formatting, and inlay hints.

Requirements

  • Red with external language-package support.
  • Git, a C compiler, and the Tree-sitter CLI.
  • A Go toolchain and gopls for language-server features; syntax highlighting works without either.

On macOS:

brew install tree-sitter
go install golang.org/x/tools/gopls@latest

Make sure the installed gopls executable is available on your PATH.

Install

Build the pinned Go grammar and install this checkout as an external Red package:

cd ~/code/red-go-language-pack
sh build-grammar.sh
red plugin install --path . --trust-native-grammars

While language-package support lives on a separate Red worktree, use that binary explicitly:

~/code/red.fcoury-extensible-languages/target/debug/red \
  plugin install --path ~/code/red-go-language-pack --trust-native-grammars

The trust flag approves this exact locally built parser. Rebuilding or changing the parser requires approving the new digest. To approve it separately:

red plugin install --path .
red language trust go

If Red is already running, reload its language definitions:

:languages reload

Try the example

Open the included Go module:

red example/main.go

Place the cursor on FriendlyGreeter and press K for hover documentation, or press g d to jump to its definition. The example also exercises interfaces, generic functions, methods, struct fields, context cancellation, channels, strings, and built-in functions.

Run it independently:

cd example
go run .
go test ./...

If Go is installed with mise but not enabled globally, activate the installed version for one command:

mise exec go@1.26.3 -- go -C example run .

Any existing Go source file works as well. gopls selects the nearest go.work, go.mod, or Git repository as its workspace root.

Grammar provenance

The build uses tree-sitter/tree-sitter-go release v0.25.0, pinned to commit 1547678a9da59885853f5f5cc8a99cc203fa2e2c. Highlight queries are adapted from the upstream MIT-licensed queries; see THIRD_PARTY_NOTICES.md.

About

Archived: Go pack moved to codersauce/red-language-packs

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages