TypeScript: typed static getter chains lose CALLS edges while typed locals resolve
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 57/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- devtools
Hướng nghiên cứu
Read the TypeScript type registry and member lookup paths, especially lookup_member_type_inner() and ast_sweep_shapes(); the report identifies these as investigation leads. Start by reproducing the three-file fixture and checking the CALLS edges for both getter callers while preserving the factory and typed-local control edges. Done when same-file and cross-file getter calls resolve, including across incremental indexing, and ordinary method references remain function values.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Version
codebase-memory-mcp 0.12.1
Platform
Windows (x64)
Install channel
GitHub release archive / install.sh / install.ps1
Binary variant
standard
What happened, and what did you expect?
A method call through an explicitly typed static getter is missing from the call graph, both in the same file and across a relative import. Reading the same getter into an explicitly typed local variable and then calling the method produces the expected edge. A same-file factory-method chain also works.
Expected: the two getter-chain callers in the reproduction produce CALLS edges to their respective target methods. Actual: all three control callers resolve, but both getter-chain callers are absent.
Tested executable SHA-256: 39f6a789cd858d7428561ac5afaefb9a47b018dcba0ad6fa41ae71a45e0ed656. This was reproduced on v0.12.1; current main was not built or tested. All code and results below come from newly written synthetic files, with no application code, private paths or business data.
Reproduction
Create an otherwise empty directory containing exactly these three files.
local.ts:
class LocalService {
private static shared: LocalService = new LocalService();
static get instance(): LocalService { return this.shared; }
static create(): LocalService { return this.shared; }
runLocal(): void {}
}
export function localViaGetter(): void {
LocalService.instance.runLocal();
}
export function localViaFactory(): void {
LocalService.create().runLocal();
}
export function localViaTypedVariable(): void {
const service: LocalService = LocalService.instance;
service.runLocal();
}
service.ts:
export class SharedService {
private static shared: SharedService = new SharedService();
static get instance(): SharedService { return this.shared; }
runShared(): void {}
}
consumer.ts:
import { SharedService } from './service';
export function crossViaGetter(): void {
SharedService.instance.runShared();
}
export function crossViaTypedVariable(): void {
const service: SharedService = SharedService.instance;
service.runShared();
}
Index in full mode with a fresh project name. Replace <ABSOLUTE_FIXTURE_DIR> with the directory containing those three files:
codebase-memory-mcp cli index_repository --repo-path "<ABSOLUTE_FIXTURE_DIR>" --name ts-getter-call-repro --mode full --persistence false
codebase-memory-mcp cli trace_path --project ts-getter-call-repro --function-name ts-getter-call-repro.local.LocalService.runLocal --direction inbound --depth 1 --include-evidence true
codebase-memory-mcp cli trace_path --project ts-getter-call-repro --function-name ts-getter-call-repro.service.SharedService.runShared --direction inbound --depth 1 --include-evidence true
To inspect the exact target edges through MCP, call query_graph with:
{
"project": "ts-getter-call-repro",
"query": "MATCH (a)-[r:CALLS]->(b) WHERE b.name = 'runLocal' OR b.name = 'runShared' RETURN a.name,b.qualified_name,r.strategy LIMIT 50",
"format": "json",
"max_rows": 50
}
Actual versus expected
| Caller | Target | Expected edge | Observed edge |
|---|---|---|---|
| localViaGetter | LocalService.runLocal | present | missing |
| localViaFactory | LocalService.runLocal | present | present |
| localViaTypedVariable | LocalService.runLocal | present | present |
| crossViaGetter | SharedService.runShared | present | missing |
| crossViaTypedVariable | SharedService.runShared | present | present |
The complete query result has exactly the three control rows shown in Logs (has_more: false, truncated: false). Inbound traces report 2 callers of runLocal instead of the expected 3, and 1 caller of runShared instead of 2. Both report callers_total_relation: eq on this tested release.
The fresh full index reports 20 nodes / 35 edges, with 0 skipped, 0 parse_partial, 0 parse_unusable, and 0 not-indexed files. check_index_coverage with diagnostics: full reports no_recorded_issue / metadata_match for all three fixture files, with coverage metadata version 9.
Scope and related issues
- #1354 / #2407: related cross-file receiver typing, but the same-file getter case here also fails. #2407 addressed imported constructor receivers and class/file-name ambiguity.
- #2265 / #2305: the misleading completeness signal is addressed separately on main. This report primarily requests the missing accessor-chain edges; it does not ask to reopen that diagnostics fix or claim current main has the same output.
- #2709: related consequences of incomplete TypeScript reference/caller results.
Possible investigation area
Source inspection of the v0.12.1 tag suggests checking how static getters are represented in the TS type registry and how member reads propagate their declared return type. lookup_member_type_inner() returns a method's function signature, while ast_sweep_shapes() handles class fields and constructor parameter properties without explicit getter-value handling. This is an investigation lead, not a tested patch.
A regression should assert the exact target edges for both getter callers while preserving the factory and typed-local controls. Cross-file and incremental-index paths should retain the accessor's value type, and ordinary method references should remain function values.
Logs
Complete target-edge query (3 rows, has_more=false, truncated=false):
crossViaTypedVariable -> ts-getter-call-repro.service.SharedService.runShared lsp_ts_method
localViaFactory -> ts-getter-call-repro.local.LocalService.runLocal lsp_ts_method
localViaTypedVariable -> ts-getter-call-repro.local.LocalService.runLocal lsp_ts_method
Diagnostics trajectory (memory / performance / leak issues)
Project scale (if relevant)
Synthetic fixture only: 3 TypeScript files, 20 nodes / 35 edges
Confirmations
- I searched existing issues and this is not a duplicate.
- My reproduction uses shareable code (a dummy snippet or a public OSS repository), not proprietary code.
- Ngôn ngữ chính
- C
- Star
- 45.8k
- Fork
- 3.8k
- Merge trung bình
- 2 ngày 18 giờ
- Pull request đã merge (30 ngày)
- 108
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của DeusData/codebase-memory-mcp
-
bug ux/behavior
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
DeusData/codebase-memory-mcp#3191 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation enhancement parsing/quality ux/behavior
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 82/100
DeusData/codebase-memory-mcp#3131 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
hook-augment: the five-row cap keeps the first five search_graph rows, so variables and modules displace function definitions (v0.12.1)Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởbug editor/integration parsing/quality ux/behavior
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
DeusData/codebase-memory-mcp#3062 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Generated client files (AGENTS.md block, SKILL.md) teach a call syntax no harness can executeĐang mởbug documentation editor/integration parsing/quality
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
DeusData/codebase-memory-mcp#3050 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
editor/integration parsing/quality
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
DeusData/codebase-memory-mcp#2286 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của DeusData/codebase-memory-mcp
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
NVIDIA/open-gpu-kernel-modules#1635 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
iOS: the "Edit controls" button never hides, even with a controller connected, and covers the gameĐang mởgame: 010065A014024000 ios
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
seedds/nxnative#3714 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày