Skip to content

fix(html): exclude @internal symbols from the search index#811

Open
crowlbot wants to merge 1 commit into
mainfrom
fix-internal-symbols-search-590
Open

fix(html): exclude @internal symbols from the search index#811
crowlbot wants to merge 1 commit into
mainfrom
fix-internal-symbols-search-590

Conversation

@crowlbot

@crowlbot crowlbot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Problem

@internal (and @ignore) symbols are excluded from the rendered listings, but a default export tagged @internal/@ignore still showed up in the generated docs (issue #590).

Investigating, the listing views (index, all-symbols) correctly hide internal symbols, but the search index did not filter them, so they stayed findable via search. This affected both named and default exports (and non-exported symbols outside .d.ts mode), which is why default exports in particular appeared to "not respect" the tags. @ignore symbols are already dropped earlier in the pipeline.

Fix

generate_search_index walks every doc node and emits a search entry without checking visibility. The listing views use is_internal (the @internal tag plus non-exported declarations outside .d.ts mode) to hide such symbols; this applies the same filter to the search index, for both top-level symbols and drilldown members (e.g. an @internal method on a public class).

Test

Added html_internal_symbols_excluded_from_search: a module with an @internal named export, a visible export, and an @internal default export. It asserts the visible symbol is in the search index while neither internal export is. It fails before this change and passes after.

The symbol_search and multiple search-index snapshots are updated: the only entries removed are A (a non-exported class) and B (an @internal export) from the existing test fixtures — no public symbol is affected.

Fixes #590

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Symbols hidden from the rendered documentation were still emitted into
the search index, so they remained findable. The listing views filter
`is_internal` (the `@internal` tag, and non-exported symbols outside of
.d.ts mode), but the search index did not, leaving internal named *and*
default exports searchable. `@ignore` symbols are already dropped earlier.

Apply the same `is_internal` filter when building the search index, for
both top-level symbols and drilldown members.
@crowlbot crowlbot force-pushed the fix-internal-symbols-search-590 branch from bb32f2f to 2116f80 Compare June 9, 2026 13:55
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.

[HTML] default exports don't respect @internal or @ignore JSDoc tags

2 participants