Conversation
Go parser (parseGoLine): - func definitions (including methods with receivers) - type struct/interface - const/var declarations - import statements (single-line with string literal) - Block comment (/* */) tracking Ruby parser (parseRubyLine): - def method definitions - class/module definitions - require/require_relative imports - =begin/=end block comment tracking - # single-line comments Also: - Added bundle/.bundle to skip_dirs for Ruby projects - 4 new tests: Go func/type, Ruby class/module/def, both comment styles Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Benchmark Regression ReportThreshold: 10.00%
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4cac9616ea
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } else if (startsWith(line, "import ")) { | ||
| if (extractStringLiteral(line)) |path| { | ||
| const import_copy = try a.dupe(u8, path); |
There was a problem hiding this comment.
Capture paths from Go import blocks
parseGoLine only appends to outline.imports when extractStringLiteral(line) succeeds on the same import ... line. In the common Go form import ( ... ), that opening line has no string literal, so none of the block’s imports are recorded and rebuildDepsFor receives an incomplete dependency list for typical multi-import files.
Useful? React with 👍 / 👎.
| if (startsWith(line, "def ")) { | ||
| if (extractIdent(line[4..])) |name| { | ||
| const name_copy = try a.dupe(u8, name); |
There was a problem hiding this comment.
Parse Ruby singleton method names correctly
The def branch in parseRubyLine extracts identifiers directly from line[4..], so declarations like def self.build are indexed as self (stopping at the dot) instead of build. This makes symbol indexing inaccurate for common Ruby class/singleton methods and breaks method-name based outline/search behavior.
Useful? React with 👍 / 👎.
1. Ruby =begin/=end must be at column 0 (use untrimmed line) — prevents indented =begin from tricking the parser into skipping real code 2. extractIdent capped at 256 chars — prevents CPU DoS on pathological files with 10MB identifiers 3. rebuildDepsFor filters imports containing ".." — prevents path traversal sequences from entering the dependency graph Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c7fcc41945
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
src/explore.zig
Outdated
| const kind: SymbolKind = if (std.mem.indexOf(u8, line, " struct") != null or std.mem.indexOf(u8, line, " interface") != null) | ||
| .struct_def | ||
| else | ||
| .constant; |
There was a problem hiding this comment.
Emit Go type declarations as type symbols
parseGoLine currently marks every type declaration that is not a struct/interface as .constant. In Go, declarations like type ID string or type HandlerFunc func(...) are still type definitions, so this misclassification makes kind-based outline/search results inaccurate for common files. Please emit a type-oriented kind (for example .type_alias) instead of .constant in this fallback branch.
Useful? React with 👍 / 👎.
src/explore.zig
Outdated
| fn parseRubyLine(self: *Explorer, line: []const u8, line_num: u32, outline: *FileOutline) !void { | ||
| const a = self.allocator; | ||
| if (startsWith(line, "def ")) { | ||
| if (extractIdent(line[4..])) |name| { |
There was a problem hiding this comment.
Preserve Ruby method suffix punctuation
Ruby method names may legally end with ?, !, or = (for example valid?, save!, name=), but parseRubyLine delegates to extractIdent, which stops at non-alphanumeric characters and truncates those names. This causes symbol collisions and breaks exact method-name lookup for idiomatic Ruby code, so method parsing should retain these suffix characters.
Useful? React with 👍 / 👎.
…defs
P1: Go multi-line import blocks (import ( ... )) now parsed — each
quoted path inside the block captured as an import
P2: Go type declarations all classified as struct_def (not constant)
P2: Ruby def self.method_name correctly extracts method_name, not "self"
P2: Ruby method suffixes ?, !, = preserved (extractRubyMethodName helper)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ffc9e94ed0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
src/explore.zig
Outdated
| if (std.mem.eql(u8, trimmed, ")")) { | ||
| in_go_import_block = false; | ||
| } else if (extractStringLiteral(trimmed)) |imp_path| { |
There was a problem hiding this comment.
Close Go import blocks when ')' has trailing comments
In the Go import-block state machine, the block is only closed when the trimmed line is exactly ")". Valid Go code often uses ) // ... on the closing line, and in that case in_go_import_block stays true, so every following line is treated as part of the import block and normal symbol parsing never resumes. This causes outlines/import graphs to silently drop functions, types, and variables for the remainder of the file whenever a trailing comment appears on the closing import parenthesis.
Useful? React with 👍 / 👎.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
Fixes #151 — adds Go and Ruby language support.
Go
funcdefinitions (including methods with receivers likefunc (r *Type) Name())typestruct/interface definitionsconst/vardeclarationsimport "path"statements/* */block comment trackingRuby
defmethod definitionsclass/moduledefinitionsrequire/require_relativeimports=begin/=endblock comment trackingOther
bundle/.bundletoskip_dirsfor Ruby projectsisCommentOrBlankfor Ruby#and Go//commentsTests
Files:
src/explore.zig(+159 lines),src/tests.zig(+123 lines),src/watcher.zig(+2 lines)