Dart: external base classes (Flutter widgets) get no INHERITS edge; typedefs are not indexed

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

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
55/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
dart, flutter

調査の方向性

Start by reading the Dart extraction code that builds INHERITS and indexes declarations, then compare how Python handles unresolved base types (#2472) and how C indexes typedefs (#2543). Use the issue’s lib/widget.dart and lib/repro.dart examples to check external base classes and typedefs in the graph. Done means those bases have graph nodes and inheritance edges, and each typedef is indexed.

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

説明

bug parsing/quality windows

Version: 0.12.1 (Windows x64)

Two related gaps in Dart extraction:

  1. INHERITS is emitted only for base classes defined inside the project. A class extending a framework type (StatelessWidget, StatefulWidget, State<T>, ChangeNotifier) gets no INHERITS edge at all, and there is no node for the base type.
  2. typedef declarations are not indexed — neither as nodes nor as aliases. (For C this was addressed in #2543.)

OVERRIDE edges are built, so overrides are visible while what they override is not.

Repro

lib/widget.dart:

import 'package:flutter/material.dart';

class HomeScreen extends StatelessWidget {
  const HomeScreen({super.key});

  @override
  Widget build(BuildContext context) => const Text('home');
}

class Counter extends ChangeNotifier {
  int value = 0;

  void bump() {
    value += 1;
    notifyListeners();
  }
}

lib/repro.dart (same project) declares a project-local base and a typedef:

typedef Handler = void Function(String message);

abstract class Base {
  void ping();
}

class BlockBody extends Base { /* ... */ }
class ArrowBody extends Base { /* ... */ }
Actual
MATCH (c:Class)-[:INHERITS]->(p) RETURN c.name, p.name
  BlockBody -> Base
  ArrowBody -> Base

HomeScreen -> StatelessWidget and Counter -> ChangeNotifier are absent. search_graph("StatefulWidget") returns 0 results. search_graph("Handler") finds no node for the typedef.

Expected

An INHERITS edge to an external/unresolved base type node (as Python already distinguishes — see #2472), so that "which classes in this project are widgets / screens / notifiers" is answerable from the graph. And a node for each typedef.

Why it matters

In Dart the base class is the role of the node: screen, widget, notifier, DAO. On a real Flutter project lib holds 28 extends StatefulWidget, 25 extends StatelessWidget and 13 extends State<...>, and none of them are reachable through the graph — the most common question about a Flutter codebase has to fall back to grep.

主要言語
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 を短くまとめたダイジェスト。