Skip to content

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

Done

Description

@xiaoyumuxi

Problem to solve / 要解决的问题

Rust 编辑器当前缺少从当前源文件识别可运行入口,以及从测试函数声明直接运行单个测试的统一入口。开发者需要频繁切换到 Cargo 构建窗口。

Proposed solution / 建议方案

使用 rust-analyzer experimental/runnables 识别当前文件中的 main、测试模块和单个测试函数,并通过宿主 editor.actions 提供 Run/Debug gutter 入口。保留 Cargo package、target、features、环境变量和精确 filter。运行前重新读取文档、保存并校验版本,rerun 时重新验证声明,同时统一 Windows/macOS 相对路径安全处理。

Target platform / 目标平台

Cross-platform / 跨平台

Area / 模块

Run / 运行

Priority / 优先级

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

Alternatives considered / 已考虑的替代方案

继续使用构建窗口中的 package/target 运行,无法满足编辑器内单测试的快速反馈。

Additional context / 补充信息

本 Issue 与 feat(run): run current files and individual functions 实现对应;Rust 工具链固定升级到 1.100.0。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