-
Notifications
You must be signed in to change notification settings - Fork 164
Display warning message if Cargo.toml is missing #157
Conversation
Maybe it'd be good to use the Overall, nice catch! Definitely a good idea to watch out for Cargo.toml. |
@Xanewok Unless I'm reading this wrong, the package wouldn't activate at all in that case. This includes the RLS, but also the syntax features and rls.update command. I guess it's not a big deal. I'm good either way on this one. |
@DSpeckhals ah, my bad. It seems the activation events will be sent when something happens Coincidentally, I added a PR rust-lang/rls#492 that prevents the RLS from crashing and dying when the underlying Cargo routine fails and allows it to be successfully re-run, without having to restart the RLS. With that in mind, I don't think we have to go as far as not running the RLS at all if the workspace does not have a Cargo.toml, but it would be really useful to report that fact to the user, either via a status bar or a single warning like |
That sounds good to me. We can check for the existence of the Cargo file
then, asynchronous from the test of the activation.
I can modify this PR to do what you describe about the message instead, and
forget about the condition for starting the RLS.
…On Sep 21, 2017 5:32 PM, "Igor Matuszewski" ***@***.***> wrote:
@DSpeckhals <https://github.com/dspeckhals> ah, my bad. It seems the
activation events will be sent when something happens
(e.g. when vscode is initialized in a workspace folder with *Cargo.toml*
if there's a "workspaceContains":Cargo.toml option), but that only lazily
starts the extension automatically and is not a required condition for the
extension to operate.
Coincidentally, I added a PR rust-lang/rls#492
<rust-lang/rls#492> that prevents the RLS
from crashing and dying when the underlying Cargo routine fails and allows
it to be successfully re-run, without having to restart the RLS.
Right now I tried creating an empty folder with a *main.rs
<http://main.rs>*, initialized rls there and only after, inside vscode, I
added the *Cargo.toml* and moved *main.rs <http://main.rs>* under *src/*
and it seemed to be able to work properly!
With that in mind, I don't think we have to go as far as not running the
RLS at all if the workspace does not have a Cargo.toml, but it would be
really useful to report that fact to the user, either via a status bar or a
single warning like Cargo.toml has to be present in in the workspace in
order to support all the features or something along the lines.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#157 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADKEsZ9J25N1EbciLUxjauIWvrdYkwnoks5sktYIgaJpZM4Pf2Y9>
.
|
Yeah, I think only presenting the warning on startup is enough now 😃 cc @nrc |
When there is no Cargo.toml file in the workspace, display a warning message informing users that not all features will be available.
I force-pushed a commit on top of my previous one, changed the PR description, and changed the PR title to reflect the current state. |
Thank you! |
Note: it would be good to change it from
to
No? |
@maelvalais Yup! Especially since workspace mode should work better now. Mind sending a PR with the change? |
This is a follow-up to the comments in rust-lang#157 (rust-lang#157 (comment))
If there is no Cargo.toml at the root of the workspace, display a warning message to the user informing them that not all features will be available.
This fixes #75