TypeScript: calls through interface members (incl. prototype-installed mixins) produce no CALLS edge to the implementation

オープン
#3,090 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
typescript
領域
devtools

調査の方向性

Start by tracing the TypeScript LSP hybrid call resolution path for the lsp_ts_method strategy and how it handles interface member targets that are not graph nodes. Then inspect the graph relationships and module-level calls described in the issue to see how implementations and prototype-installed mixins can be found. Done means interface calls produce edges to implementation candidates, or at minimum retain a CALL_REFERENCE when unresolved; the issue names no test file, so locate the relevant resolver tests.

索引モデルが issue の本文から書いたものです。

説明

bug enhancement parsing/quality

Bug/feature: TypeScript calls through interface members are not attributed to implementations

Version: codebase-memory-mcp v0.12.1 (linux-amd64-portable), TypeScript project, LSP hybrid resolution
(strategy: lsp_ts_method on edges). Related: #2893 (C#: calls through interfaces / virtual members not
attributed to implementers), #2789 (TypeScript call resolution fixes).

What happens

A method call on a parameter typed with an interface produces no CALLS edge at all. The LSP resolves the
call to the interface member signature, which is not a node, so the edge is dropped silently. trace_path
outbound of the caller therefore misses the real implementation.

Minimal example

// contract.ts
export interface RegistryOperations {
  replaceCredential(providerId: string, raw: unknown): Promise<Snapshot>
}

// operations.ts
export const credentialOperations = {
  replaceCredential(this: Registry, providerId: string, raw: unknown): Promise<Snapshot> { /* ... */ },
}

// registry.ts
import { credentialOperations } from './operations'
export class Registry { /* state */ }
export interface Registry extends RegistryOperations {}
installOperations(Registry.prototype, credentialOperations)   // Object.assign-style mixin

// handler.ts
export async function replaceModelCredential(registry: Registry | undefined, providerId: string, req: Request) {
  const input = await req.json()
  return registry!.replaceCredential(providerId, input)    // <- no CALLS edge
}

Observed:

  • trace_path(function_name="…replaceModelCredential", direction="outbound") lists req.json style callees but
    not replaceCredential.
  • MATCH (f)-[r]->(g) WHERE f.name='replaceModelCredential' RETURN type(r), g.name → only USAGE Registry
    (the type), no call edge; no CALL_REFERENCE either.
  • The implementation exists as a Function node (operations.replaceCredential), the class has an
    IMPLEMENTS edge to RegistryOperations, and the module-level call installOperations(Registry.prototype, …)
    is captured as a Module → CALLS edge with its arguments.

Expected

When the LSP target is an interface member, resolve to the implementations: classes with IMPLEMENTS (or
declaration-merged classes of the same name) that define the method; if none, members installed on the
prototype by module-level Object.assign(X.prototype, obj) / mixin helpers (object-literal members of obj).
Several implementations → several edges with a lower confidence (or a candidates count), as the resolver
already does for other ambiguous strategies. At minimum, an unresolved call should leave a CALL_REFERENCE with
the member name so that consumers can resolve it themselves.

主要言語
C
スター
45.8k
フォーク
3.8k
平均マージ
2日 18時間
マージ済み PR(30日)
108

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

DeusData/codebase-memory-mcp のほかの issue

DeusData/codebase-memory-mcp の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。