Skip to content

✨ Add Go language support#79

Merged
arnoox merged 2 commits into
useblocks:mainfrom
arnoox:issue/76-go-support
Jun 17, 2026
Merged

✨ Add Go language support#79
arnoox merged 2 commits into
useblocks:mainfrom
arnoox:issue/76-go-support

Conversation

@arnoox

@arnoox arnoox commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Closes #76

Summary

Adds full Go language support to sphinx-codelinks, following the same patterns as existing language implementations (C++, Python, C#, Rust, YAML).

Changes

Core implementation

  • pyproject.toml — add tree-sitter-go>=0.23.0 dependency
  • source_discover/config.py — add go to CommentType enum and COMMENT_FILETYPE (.go files)
  • config.py — add CommentType.go: ["//", "/*"] to COMMENT_MARKERS
  • analyse/utils.py — add GO_QUERY, Go entry in SCOPE_NODE_TYPES (function_declaration, method_declaration, type_declaration, type_spec), and Go branch in init_tree_sitter()

Tests

  • tests/test_analyse_utils.pyinit_go_tree_sitter fixture + 11 tests covering comment extraction, find_associated_scope, find_next_scope, and find_enclosing_scope
  • tests/doc_test/go_basic/ — minimal Sphinx integration project with a .go source file
  • tests/test_src_trace.py — new parametrized case for go_basic + generated snapshot
  • tests/test_source_discover.py / tests/test_src_trace.py — updated validation error messages to include "go" in the enum list

Documentation

  • docs/source/components/analyse.rst — add Go to language support list
  • docs/source/components/configuration.rst — add "go" to comment_type enum values and table
  • docs/source/components/features.rst — add FE_GO feature block
  • docs/source/development/change_log.rst — add changelog entry

Acceptance criteria

  • Go parser / comment extractor added to sphinx-codelinks
  • Unit tests covering Go comment annotation parsing (11 tests, all passing)
  • Documentation updated to list Go as a supported language
  • Integration test with a minimal Go project

@patdhlk patdhlk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks for the PR

@arnoox arnoox merged commit 32156a7 into useblocks:main Jun 17, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Add Go language support

2 participants