Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Added wait_to_build time to config #391

Merged
merged 2 commits into from
Jul 4, 2017
Merged

Added wait_to_build time to config #391

merged 2 commits into from
Jul 4, 2017

Conversation

robbym
Copy link
Contributor

@robbym robbym commented Jul 4, 2017

Issue #364

Copy link
Member

@nrc nrc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thank you! There are two very minor improvements I've noted inline.

src/build.rs Outdated
config.wait_to_build
};

thread::sleep(Duration::from_millis(wait_to_build as u64));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could make the config option u64 and then you wouldn't need this cast.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. I need to add a new impl for ConfigType for that.
Should the variant name be "<unsigned 64bit integer>"?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that sounds good

src/config.rs Outdated
@@ -157,6 +157,7 @@ create_config! {
build_bin: String, String::new(), false, "cargo check --bin <name>";
cfg_test: bool, true, false, "build cfg(test) code";
unstable_features: bool, false, false, "enable unstable features";
wait_to_build: usize, 500, false, "time between receiving a change notification and starting build";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add "in milliseconds" to the description please?

@@ -166,7 +163,12 @@ impl BuildQueue {
let (tx, rx) = channel();
self.pending.lock().unwrap().push(tx);
if priority == BuildPriority::Normal {
thread::sleep(Duration::from_millis(WAIT_TO_BUILD));
let wait_to_build = { // Release lock before we sleep
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@nrc nrc merged commit a941737 into rust-lang:master Jul 4, 2017
@nrc
Copy link
Member

nrc commented Jul 4, 2017

Thanks for the PR! Do you know what you would like to work on next? I can suggest something if you'd like.

@robbym
Copy link
Contributor Author

robbym commented Jul 4, 2017

No idea. Please do.

@nrc
Copy link
Member

nrc commented Jul 4, 2017

I have a couple of suggestions, do either sound interesting? Let me know if you have any questions.

  • dedup test_data #365 might be interesting and is certainly useful: we currently have to have one cargo project per test. We need to be able to execute tests in parallel, but if we do that and two tests have the same target directory, we'll get races on that directory. I think this should be fixable by specifying the output directory to Cargo when we run a test. I'm not sure how that works. I'm also not sure if that will fix this issue (but I think it should). I'm also not sure if this is something that can be limited to the test infrastructure, or has to be threaded through the RLS.

  • dead_code and unused* lint are annoying #252 is extremely annoying at the moment. A good minimal solution would be to add a config option for 'show_warnings' When that is false, the RLS does not report warnings to the user, only errors. That should be fairly easy; it would require exploring the error handling parts of the RLS. A nice extension would be to only show warnings when a file is saved (i.e., when the file is being edited, suppress warnings, and when it is saved, show them). That would be a bit harder because you'd have to coordinate the state of a file (I think this is tracked in the VFS, but you should check) with the error handling.

@robbym
Copy link
Contributor Author

robbym commented Jul 4, 2017

I think #252 would expose me to some more interesting bits of code. I'll try that first.

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

Successfully merging this pull request may close these issues.

None yet

2 participants