Skip to content

[Feature] Run the current file and an individual function or test #50

Done

Description

@xiaoyumuxi

Problem to solve / 要解决的问题

Java 编辑器当前缺少从当前文件识别 main 或 JUnit 入口,并从测试类/方法声明直接运行单个测试的统一入口。开发者需要频繁切换到构建配置。

Proposed solution / 建议方案

通过 JDT 语义识别当前文件中的 main、JUnit 测试类和方法,并通过宿主 editor.actions 提供 Run/Debug gutter 入口。混合 main/test 类的类级动作优先测试动作;运行前重新读取文档、保存并校验版本,rerun 时重新验证声明,同时统一 Windows/macOS 相对路径安全处理。

Target platform / 目标平台

Cross-platform / 跨平台

Area / 模块

Run / 运行

Priority / 优先级

P1 / 尽快处理:使用体验大幅下降,但通常仍可继续使用

Alternatives considered / 已考虑的替代方案

继续手动配置 Java 类名或在构建窗口运行完整测试,无法提供编辑器内单方法反馈。

Additional context / 补充信息

本 Issue 与 feat(run): run current files and individual functions 实现对应。PHP、Lua 不在本次插件范围内。

Checklist / 提交前检查

  • I searched existing issues for duplicates. / 我已搜索现有 Issue,确认没有重复建议。

Activity

  1. added
    enhancement
    on Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions