nickna / nickna/SharpTS

LSP: add checker-backed property and method definition/references

Open
#1,393 0 comments 0 reactions 0 assignees View on GitHub
deferred enhancement
Dominant language
C#
Stars
154
Forks
4
Avg merge
2h 46m
Merged PRs (30d)
189

Description

Parent epic: #1390. Depends on #1392. Deferred from #1306.

## Goal

Use checker-produced member identities to provide sound `textDocument/definition` and `textDocument/references` for supported properties and methods in standalone `full` language-feature mode.

## Work

- [ ] Extend navigation models and location conversion to consume the member-symbol domains produced by #1392 without disturbing existing lexical/type/namespace/label navigation.
- [ ] Return all legitimate declaration locations for overloads, merged interfaces, getter/setter pairs, and inheritance/override domains, with deterministic ordering and deduplication.
- [ ] Find references across open and closed files, configured project roots, reverse importers, and project references using the existing workspace completeness model.
- [ ] Include reads, writes, calls, optional access, compound/logical assignment, increment/decrement, private access, `super`, and supported literal-key indexed access.
- [ ] Define behavior for declarations selected directly, aliases/re-exports, contextual object-literal properties, destructuring property names, and shorthand properties whose key and value have different semantic roles.
- [ ] Return no result for dynamic/ambiguous domains that #1392 cannot prove complete. Do not fall back to text search.
- [ ] Keep built-in or CLR members without a source-location contract out of ordinary source definition results; preserve existing SharpTS interop hover/signature behavior.
- [ ] Register capabilities only in `full` mode and continue rejecting general navigation requests in `interop-only` mode.
- [ ] Reuse versioned analysis caches and observe cancellation during workspace traversal.
- [ ] Update standalone-editor documentation with the exact supported and deliberately refused domains.

## Verification

- [ ] Definition tests cover fields, methods, accessors, private/static members, constructor parameter properties, interface/type-literal members, object literals, overloads, and direct declaration selection.
- [ ] Inheritance tests cover base-to-override and override-to-base behavior, generic bases, merged/extended interfaces, and diamond-shaped ancestry without duplicate locations.
- [ ] Reference tests cover reads/writes/calls, aliases, imports/re-exports, closed reverse importers, multiple tsconfigs, project references, unsaved buffers, and cross-platform path normalization.
- [ ] Structural tests cover contextual object literals plus union/intersection receivers and prove unrelated same-spelling properties are not included.
- [ ] Negative tests cover `any`, dynamic index signatures, unresolved computed names, incomplete/broken project graphs, malformed files, cancellation, and stale document versions.
- [ ] Real initialize handshakes show definition/references remain absent from `interop-only` and present in `full`; existing capability tests stay green.
- [ ] Add end-to-end JSON-RPC tests for at least one multi-project definition and reference request.
- [ ] Record warm/cold latency for representative local and workspace-wide member queries; no unbounded graph rebuild or stale cache reuse.
- [ ] Full unit, language-server pack, extension compile, Test262, and TypeScript conformance validation is green.

## Success criteria

Every supported member result is checker-backed and complete for the loaded domain, workspace traversal returns stable correct locations across project boundaries, and unsupported/ambiguous cases fail closed rather than returning plausible-looking partial results.

## Non-goals

- Property/member rename (separate dependent child).
- Navigation into runtime-only built-in implementations without source metadata.
- General call hierarchy or implementation hierarchy requests.

Contributor guide

Open the contributing guide

Research direction

Start by reading dependency #1392 and the existing navigation models, location conversion, workspace completeness model, and full-versus-interop-only capability registration. Use the specified definition, reference, inheritance, negative, capability, and end-to-end JSON-RPC tests to map the required behavior. Done means supported member results are checker-backed and complete, while ambiguous cases fail closed and the full validation suite remains green.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, typescript
Domain
compilers, devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.