Skip to content

Rust: don't show run button in build scripts #14720

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
kzhui125 opened this issue Jul 18, 2024 · 12 comments
Closed
1 task done

Rust: don't show run button in build scripts #14720

kzhui125 opened this issue Jul 18, 2024 · 12 comments
Labels
bug [core label] language An umbrella label for all programming languages syntax behaviors rust Rust programming language support stale Label used by `stale` action tasks

Comments

@kzhui125
Copy link

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

image

Environment

Zed: v0.144.3 (Zed)
OS: macOS 14.5.0
Memory: 32 GiB
Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

Zed.log
@kzhui125 kzhui125 added admin read bug [core label] labels Jul 18, 2024
@versecafe
Copy link
Contributor

Every fn main() in rust is supposed to have the arrow with it, the file name shouldn't change that behaviour, what is your issue with it appearing in build.rs

@kzhui125
Copy link
Author

kzhui125 commented Jul 19, 2024

this is what in vscode, fn main in rust build scripts don't have run button @versecafe

image

A button that doesn't work shouldn't exist, that's a design problem.

@kzhui125
Copy link
Author

to clarify, not all build.rs files, only rust build scripts

https://doc.rust-lang.org/cargo/reference/build-scripts.html

@osiewicz osiewicz changed the title don't show run button at build.rs Rust: don't show run button in build scripts Jul 19, 2024
@osiewicz
Copy link
Contributor

I agree that we shouldn't show a run button in build scripts, but to just put it out there: it's a bit harder than just checking if a file is named build.rs, as the name of a build script can be arbitrary. We'd have to piggy-back out of output of cargo metadata for that functionality.

@kzhui125
Copy link
Author

also files not in crates:

image

@versecafe
Copy link
Contributor

If the rust analyzer isn't doing anything neither is the LSP and the LSP is where the hooks for the test functions go so that last example isn't configured correctly, also why is there an expectation that it shouldn't be there, is there any issue to offering the feature?

@kzhui125
Copy link
Author

run button should only exists when it's runnable @versecafe

@versecafe
Copy link
Contributor

Build scripts are runnable, you usually don't want to run them on their own but they should be runnable

@kzhui125
Copy link
Author

build scripts are for cargo build, run them on their own are not supported now rust-lang/cargo#7178

We use run to print output (for example println!)

but output is not supported by build scripts now. rust-lang/cargo#985

@kzhui125
Copy link
Author

Should run button be added for build scripts, click it doesn't work now(will be another bug).

@JosephTLyons JosephTLyons added rust Rust programming language support language An umbrella label for all programming languages syntax behaviors tasks and removed triage labels Jul 23, 2024
Copy link

Hi there! 👋
We're working to clean up our issue tracker by closing older issues that might not be relevant anymore. If you are able to reproduce this issue in the latest version of Zed, please let us know by commenting on this issue, and we will keep it open. If you can't reproduce it, feel free to close the issue yourself. Otherwise, we'll close it in 7 days.
Thanks for your help!

@github-actions github-actions bot added the stale Label used by `stale` action label Mar 11, 2025
Copy link

This issue was closed due to inactivity. If you're still experiencing this problem, please open a new issue with a link to this issue.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [core label] language An umbrella label for all programming languages syntax behaviors rust Rust programming language support stale Label used by `stale` action tasks
Projects
None yet
Development

No branches or pull requests

5 participants