Skip to content

Is it possible to run cargo build from opened Cargo.toml? #179

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
pravic opened this issue May 2, 2017 · 5 comments
Closed

Is it possible to run cargo build from opened Cargo.toml? #179

pravic opened this issue May 2, 2017 · 5 comments

Comments

@pravic
Copy link

pravic commented May 2, 2017

Currently I need to open some .rs file to access Cargo build commands from Sublime despite of I already have Cargo.toml file opened.

Quick search pointed me to the selector property of build description. Is it possible to place 2 selectors there, like source.rust|source.toml?

Currently as a workaround I copied Cargo.sublime-build as CargoToml.sublime-build with source.toml selector in there, because it seems that "Build System -> Cargo" command is global-wide in Sublime, not syntax-specific.

Sublime Text Version

Sublime Text 3 (Build 3131)

Rust Enhanced Version

1.3.1

@pravic
Copy link
Author

pravic commented May 2, 2017

cc #165 - it would be great to have such feature there.

@ehuss
Copy link

ehuss commented May 2, 2017

Another workaround is to not use the "Automatic" build detection. In Tools > Build System, pick the build system to use, and it will be sticky (saved in the workspace).

@pravic
Copy link
Author

pravic commented May 2, 2017

saved in the workspace

Which one workspace?

@jasonwilliams
Copy link
Member

jasonwilliams commented May 2, 2017

@pravic no reason why not, funnily enough it actually used to be the other way around. It only ran if you was in a .cargo file, so I changed it to only rust files. That was a few years back.

@ehuss I do like using "Automatic Build Detection", so maybe this is something we can look into.
I could be wrong but i think .sublime-build files only accept 1 selector, but i would have to look into the sublime dev docs.

@ehuss
Copy link

ehuss commented May 2, 2017

@pravic The .sublime-workspace file contains the current state of your project (which files are open, etc.). If you save a sublime-project, it automatically also saves a workspace. See https://www.sublimetext.com/docs/3/projects.html for more info.

@Jayflux I think you can have multiple selectors with a comma (such as "source.rust,source.toml").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants