Skip to content

fix: respect includeDeclaration in references#191

Merged
hongjr03 merged 4 commits into
masterfrom
fix/references-exclude-declarations
May 29, 2026
Merged

fix: respect includeDeclaration in references#191
hongjr03 merged 4 commits into
masterfrom
fix/references-exclude-declarations

Conversation

@hongjr03
Copy link
Copy Markdown
Member

@hongjr03 hongjr03 commented May 29, 2026

Closes #184.

Although the PR title uses fix, I don't really treat this as a symbol-resolution bug. Reference search itself was already working, but the textDocument/references handler did not properly honor ReferenceContext.includeDeclaration.

That alone is not enough to change VS Code's default behavior, because VS Code's references flow requests declaration-inclusive results by default. For users who prefer usages-only results, this PR adds a client-side setting that overrides the request context before sending it to the language server.

Changes

  • make the server respect ReferenceContext.includeDeclaration for textDocument/references
  • add a VS Code setting to override VS Code's default declaration-inclusive references request behavior

User-facing behavior

By default, references remain declaration-inclusive.

Users who want usages-only results can set:

{
  "vide.references.includeDeclaration": false
}

@github-actions
Copy link
Copy Markdown

Docs preview: https://vide.pascal-lab.net/preview/pr-191/

@hongjr03 hongjr03 marked this pull request as ready for review May 29, 2026 06:42
@hongjr03 hongjr03 merged commit c31f7d0 into master May 29, 2026
10 checks passed
@hongjr03 hongjr03 deleted the fix/references-exclude-declarations branch May 29, 2026 06:43
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.

[Bug] A definition is also treated as a reference of itself.

1 participant