Repository navigation
feat(symbols): index private symbols in every language - #124
Closed
justinjdev wants to merge 1 commit into
Closed
justinjdev wants to merge 1 commit into
justinjdev wants to merge 1 commit into
Conversation
Convert the remaining languages from the legacy `is_visible` filter to the `visibility` hook and remove `is_visible`. Private symbols are now indexed and tagged everywhere, and all of them honour `symbols.include_private` through the generic drop. - Rust pub/pub(crate)/pub(self) (trait-impl methods are public); C/C++ static and access labels; Java/C#/Kotlin/Swift/Scala/PHP modifiers, narrowed by enclosing types (Java package-private and C# defaults become internal); Gleam/Zig/Nim export markers; Clojure defn-/^:private; Elixir defp/defmacrop/defguardp/@TypeP; Ruby private/protected sections; Lua locals. - TS/JS queries also capture module-level unexported declarations and `#private` methods. Names exported through `export { ... }` count as public. - `is_definition` keeps the non-privacy filters: Clojure/Elixir generic call patterns and Zig locals. - Bump EXTRACTOR_VERSION to 2 so indexes built on the previous commit re-extract once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RdiKZaeLuAT6nGhrSLyMvA
3 of 4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This converts every remaining language from the legacy
is_visiblefilter to thevisibilityhook from #123, and removesis_visible. Private symbols are then indexed and tagged in every language. All of them respectsymbols.include_privatethrough the single drop point.Per language
pub→ public;pub(crate)/pub(super)/pub(in …)→ internal; no modifier orpub(self)→ private.fmt,parse, …) are public. They used to be dropped.static→ private.public:/protected:/private:labels, defaulting to private in aclassand public in astruct. A non-memberstatic→ private.private[pkg]→ internal; Swiftfileprivate→ private.consts inside function bodies are no longer captured as symbols.defn-and^:private→ private. This also fixes^:privateleaking into the symbol name.defp,defmacrop,defguardpand@typep→ private.private/protectedsections, andprivate def ….private :nameis not tracked.local function→ private.#privatemethods.export { … }count as public.module.exportsis not recognised, so that code shows as private.EXTRACTOR_VERSIONgoes to 2, so an index built with #123 re-extracts once.Behaviour changes with
include_private = false, compared with maininternal, and Scalaprivate[pkg]protectedmethods, and names exported throughexport { … }pub(self)privatesections, Lua locals, and Clojure^:privateSize
This repo (Rust) indexes about 3.4x as many symbols with the default as with
include_private = false: 1,207 vs 357 on current main. Before marking this ready: index a real TS/JS application repo and check the symbol count, DB size and search quality.Test plan
cargo test --all-featurespasses (1035 lib, 66 integration, 16 bin, 11 autoresearch). Clippy with-D warningsandcargo fmt --checkare clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01RdiKZaeLuAT6nGhrSLyMvA