Is recursive disk search desired/intended?

未关闭
#437 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
rust, vim

调研方向

Read the linked ftplugin/rust.vim lines 17–23 to understand the recursive search and how it selects makeprg. Decide whether Cargo should be the default or whether a global setting should control the search; the issue does not record a decision. Done means agreeing on the intended behavior and updating the Rust file-opening behavior accordingly.

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

描述

Right now, every time a rust file is opened, a recursive disk search is done until either the root is reached or cargo.toml is found: https://github.com/rust-lang/rust.vim/blob/87c745d8d506fc1eecc1d81df15d5bde1658a2fc/ftplugin/rust.vim#L17-L23

Maybe cargo build should just be the default? I imagine few users use the behavior where makeprg builds the current file into an executable directly using rustc (which is what makeprg will do if no cargo.toml is found). If anyone exactly wants this exact behavior, they could also just add it to their own after/ftplugin/rust.vim. Alternatively, maybe this search should be hidden behind a global setting which is off by default?

Not sure how much this really matters in practice, so this might be premature optimization. However, opening a rust file really shouldn't trigger this much filesystem access. This isn't a zero cost abstraction : ).

Related: https://github.com/ziglang/zig.vim/pull/40#discussion_r578754774

主要语言
Vim Script
星标
4.2k
派生
323
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

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

rust-lang/rust.vim 的其他 Issue

查看 rust-lang/rust.vim 的全部 Issue

相似的 Issue

更多 DevTools Issue

把新 issue 发到你的邮箱

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