Skip to content

Add exclusions and per-symbol suppression #18

Description

@Perdolique

Summary

Add explicit controls for files and declarations that are valid external or dynamic entry points.

Motivation

A language server can report references from the current project graph, but it cannot prove that a named export, framework hook, reflected member, or serialized property has no external consumer. Users need a durable way to keep these declarations out of Zero Reference results.

Scope

  • Add zeroReference.exclude as workspace-relative glob patterns for declaration files that should not be analyzed.
  • Add a configurable set of eligible symbol kinds while preserving the current defaults initially.
  • Add an option to ignore exported TypeScript and JavaScript declarations; determine export status without brittle text matching.
  • Support // zero-reference-ignore-next-line for a single declaration.
  • Provide an Ignore this symbol code action or equivalent native action that inserts the suppression comment.
  • Apply exclusions and suppression before reference lookups whenever possible.
  • Document that results describe the current workspace reference graph, not external or dynamic consumers.

Acceptance criteria

  • Excluded files and suppressed declarations perform no reference lookup and produce no CodeLens, inlay hint, or diagnostic.
  • Globs are evaluated consistently in single-root and multi-root workspaces.
  • The exported-declaration option covers named exports, export lists, and default declarations in TypeScript and JavaScript.
  • Existing users retain the current result set unless they enable a new filter.
  • Invalid configuration is reported in the output channel while the extension continues with a safe fallback.
  • Tests cover exclusions, every suppression placement, exported declarations, and configuration refresh.

Out of scope

  • Automatic suppression based on a framework name.
  • Automatic removal of ignored code.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions