fix: emit stable symbols for callable property assignments#466
Open
jordanjwong wants to merge 1 commit into
Open
fix: emit stable symbols for callable property assignments#466jordanjwong wants to merge 1 commit into
jordanjwong wants to merge 1 commit into
Conversation
jordanjwong
marked this pull request as draft
July 20, 2026 22:26
Previously patterns like
obj.method = async () => {}
obj.method = function() {}
obj['prop'] = () => {}
obj.nested.method = async () => {}
were emitted as local symbols such as src/file.js/local 42 instead
of stable property-derived symbols, causing definition coverage gaps.
Changes:
- Add in-progress guard set to prevent recursive symbol resolution
- Handle constructor and callable property assignment names in visit()
- Accept optional symbol in visitSymbolOccurrence() for cases where
checker does not provide a symbol (property assignments)
- Detect property assignments where RHS is function-like and emit
enclosing range and symbol information with display name and kind
- Derive deterministic property path for dot and bracket string literal
access, building owner chain with term/method descriptors
- Update isDefinition() to recognize callable property assignment names
- Add helpers for object literal callable property assignments and
symbol information display name/kind
jordanjwong
force-pushed
the
fix-callable-property-assignment-local-symbols
branch
from
July 21, 2026 14:45
24850fe to
badace4
Compare
jordanjwong
marked this pull request as ready for review
July 21, 2026 14:55
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.
Fixes the local symbol gap where callable property assignments were emitted as local symbols.
Problem
were emitted as:
instead of stable property-derived symbols (e.g.
obj.method(),obj.nested.method()). This caused definition coverage gaps.Object literal cases like:
were also only references to the interface, not definitions.
Fix (src/FileIndexer.ts only, no dist)
callablePropertySymbolsInProgress: Set<Node>guardvisit()now handlesisConstructorDeclarationandcallablePropertyAssignmentNamevisitSymbolOccurrence(node, sym?: Symbol)accepts optional symbolBinaryExpressionwhere LHS isPropertyAccessExpression/ElementAccessExpression(string literal) and RHS isArrowFunction/FunctionExpressioncallablePropertySymbol()builds owner chain: root from declaration if found, else file-scopedtermDescriptor(root), intermediate astermDescriptor, final asmethodDescriptorisDefinition()includescallablePropertyAssignmentNamedisplay_name+kindExamples
1. Chained assignment
Before:
After:
2. Function expression + nested + bracket
Before:
After:
3. Object literal impl (snapshot change)
Before:
After:
Snapshots
snapshots/output/syntax/src/interface.ts,inheritance.ts,object-literals-call-signatures.tsValidation – per Development.md