Skip to content

Conversation

@gabritto
Copy link
Member

@gabritto gabritto commented Jan 27, 2026

Follow-up to #2207 after #2513.
Also refactored the code so we pass in a name directly when we add a symbol in the special cases where that's needed.

@gabritto gabritto marked this pull request as ready for review January 27, 2026 18:35
Copilot AI review requested due to automatic review settings January 27, 2026 18:35
@gabritto gabritto requested a review from jakebailey January 27, 2026 18:39
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for surfacing Object.defineProperty-defined properties in document symbols (navigation bar), with a small refactor to pass explicit “name” nodes for special-case symbol creation.

Changes:

  • Extend document symbol collection to recognize Object.defineProperty(...) expando patterns and attach get/set members as children.
  • Refactor newDocumentSymbol call sites to optionally pass an explicit name node (instead of inferring it from node).
  • Update fourslash reference baseline to reflect the new symbol output.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
internal/ls/symbols.go Detects Object.defineProperty calls during symbol collection and refactors symbol creation to accept an explicit name node.
testdata/baselines/reference/fourslash/documentSymbols/navigationBarFunctionPrototype.baseline Updates expected document symbol output to include defineProperty-defined properties and their accessors.

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.

2 participants