DevTools extensions not discovered when app entrypoint is under custom directory

未关闭
#9,667 4 条评论 10 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
56/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
dart, devtools
领域
devtools

调研方向

从 DevTools 的 packageRootFromFileUriString 根目录检测逻辑开始,跟踪它如何为 patrol_test/ 下的入口点查找 package_config.json。将该行为与 integration_test/ 和 test/ 等已识别目录进行比较。完成的标准是:当应用入口点位于自定义测试目录下时,DevTools 仍能发现扩展,同时保留现有的根目录检测行为。

由索引模型根据 Issue 内容生成。

描述

contributions welcome devtools extensions P2
Sumary

DevTools extension discovery fails if the main isolate root library is under a custom test directory (patrol_test/ in our case) that is not recognized by DevTools’ package root heuristic. Extensions appear when tests are moved to integration_test/ which is a recognized root.

Context

I'm working on Patrol which has it's own devtools extension. We recently changed the default directory where all the tests are stored from integration_test to patrol_test. After doing so, we then found out that our devtools extension is not found when running tests.

Image
Notes

DevTools root detection uses packageRootFromFileUriString, which only recognizes lib, bin, integration_test, test, benchmark, example as valid top‑level dirs. Custom test dirs like patrol_test/ are not recognized, so the root resolves incorrectly and package_config.json lookup fails.

Would it be possible to make it more configurable so that we could point to patrol_test directory in our case?

主要语言
Dart
星标
1.7k
派生
420
平均合并
3 天 11 小时
30 天内合并 PR
29

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

flutter/devtools 的其他 Issue

查看 flutter/devtools 的全部 Issue

相似的 Issue

更多 Dart Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。