Skip to content

feat(languages): add Go, Java, PHP, Ruby, C/C++ tree-sitter support (closes #198)#203

Open
Wolfvin wants to merge 1 commit into
mainfrom
feat/issue-198-tree-sitter-languages
Open

feat(languages): add Go, Java, PHP, Ruby, C/C++ tree-sitter support (closes #198)#203
Wolfvin wants to merge 1 commit into
mainfrom
feat/issue-198-tree-sitter-languages

Conversation

@Wolfvin

@Wolfvin Wolfvin commented Jul 7, 2026

Copy link
Copy Markdown
Owner

What

Added 6 new tree-sitter language entries to node_types.yaml and grammar packages to pyproject.toml.

Languages added

Language Key Grammar package File extensions Categories
Go go tree-sitter-go .go function_def, class_def, import, call, type_alias, const, identifier
Java java tree-sitter-java .java function_def, class_def, import, call, annotation, field, identifier
PHP php tree-sitter-php .php function_def, class_def, import, call, namespace, identifier
Ruby ruby tree-sitter-ruby .rb function_def, class_def, import, call, identifier
C c tree-sitter-c .c, .h function_def, class_def, import, call, type_alias, identifier
C++ cpp tree-sitter-cpp .cpp, .cc, .hpp function_def, class_def, import, call, namespace, template, type_alias, identifier

Each language has minimum 4 required categories (function_def, class_def, import, call). Additional categories added where the language has unique constructs.

Files touched (2 files, +142 lines)

  • scripts/languages/node_types.yaml — 6 new language entries (135 lines added)
  • pyproject.toml — 6 new grammar packages in [project.optional-dependencies] grammars (7 lines)

Verification

$ python3 -c "from languages.loader import get_supported_languages; print(get_supported_languages())"
['c', 'cpp', 'css', 'go', 'html', 'java', 'javascript', 'php', 'python', 'ruby', 'rust', 'tsx', 'typescript']
# 13 languages (7 existing + 6 new)
$ codelens scan /tmp/cl198-test  # fixture with 1 file per language
files_scanned: {go: 1, java: 1, php: 1, ruby: 1, c_cpp: 2}
backend nodes: 12
# 0 crashes, all files detected and scanned

Definition of Done (issue #198)

  • node_types.yaml has entries for Go, Java, PHP, Ruby, C, C++
  • Each entry has minimal 4 categories: function, class, import, call
  • Grammar packages added to pyproject.toml
  • codelens scan does not crash on new languages
  • Files in new languages are detected and scanned (not skipped)

Worker Checklist

  • Languages added: Go, Java, PHP, Ruby, C, C++ (6 total)
  • Node types per language: selected from official tree-sitter grammar docs. Each language has the 4 required categories plus language-specific extras (Java annotations, PHP namespaces, C++ templates, Go interfaces, Ruby modules).
  • Packages added: tree-sitter-go, tree-sitter-java, tree-sitter-php, tree-sitter-ruby, tree-sitter-c, tree-sitter-cpp
  • Test scan: 6 files across 5 languages (C and C++ share c_cpp bucket), 12 backend nodes, 0 crashes

Issue link

Closes #198

…loses #198)

Add 6 new language entries to node_types.yaml:
- Go: function_declaration, method_declaration, struct_type, interface_type,
  import_declaration, call_expression, etc.
- Java: method_declaration, constructor_declaration, class_declaration,
  interface_declaration, enum_declaration, method_invocation, etc.
- PHP: function_definition, method_declaration, class_declaration,
  include_expression, use_declaration, function_call_expression, etc.
- Ruby: method, singleton_method, class, module, require, call, etc.
- C: function_definition, struct_specifier, union_specifier, enum_specifier,
  preproc_include, call_expression, type_definition, etc.
- C++: function_definition, class_specifier, struct_specifier, preproc_include,
  using_declaration, call_expression, namespace_definition, template_declaration,
  type_alias_declaration, etc.

Each language has minimum 4 required categories: function_def, class_def,
import, call. Additional categories added where the language has unique
constructs (e.g. Java annotations, PHP namespaces, C++ templates).

Grammar packages added to pyproject.toml [project.optional-dependencies]
grammars: tree-sitter-go, tree-sitter-java, tree-sitter-php,
tree-sitter-ruby, tree-sitter-c, tree-sitter-cpp.

Verified: codelens scan on test fixture with all 6 languages — 6 files
detected (go:1, java:1, php:1, ruby:1, c_cpp:2), 12 backend nodes, 0
crashes. get_supported_languages() returns 13 languages (7 existing + 6
new).

Definition of Done (issue #198):
- [x] node_types.yaml has entries for Go, Java, PHP, Ruby, C, C++
- [x] Each entry has minimal 4 categories: function, class, import, call
- [x] Grammar packages added to pyproject.toml
- [x] codelens scan does not crash on new languages
- [x] Files in new languages are detected and scanned (not skipped)
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@sonarqubecloud

sonarqubecloud Bot commented Jul 7, 2026

Copy link
Copy Markdown

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.

feat(languages): add Go, Java, PHP, Ruby, C/C++ tree-sitter support

1 participant