Stream: t-compiler/wg-rls-2.0

Topic: lsp got out of sync


Christopher Durham (Aug 03 2020 at 20:36, on Zulip):

I somehow managed to get r-a out of sync with the editor. The editor has

#[cfg_pub(
    if #[cfg(SET_CFG)] pub
    else if #[cfg(not(SET_CFG))] pub(self)
)]
fn main() {
    println!("do something");
}

and save-on-format is giving me

[Error - 4:33:45 PM] Request textDocument/formatting failed.
  Message: rustfmt exited with:
                           Status: exit code: 101
                           stdout:
  Code: -32900
error: unterminated double quote string
 --> <stdin>:5:46
  |
5 |       else if #[cfg(not(SET_CFG))] pub(self() g");
  |  ______________________________________________^
6 | | }
  | |__^

[Error - 4:34:05 PM] Request textDocument/formatting failed.
  Message: rustfmt exited with:
                           Status: exit code: 101
                           stdout:
  Code: -32900
Christopher Durham (Aug 03 2020 at 20:38, on Zulip):

I told the language server to reload and I got the "Reloading rust-analyzer..." notification but r-a just hung from there. Restarted vscode and everything seems to be working again.

Christopher Durham (Aug 03 2020 at 20:38, on Zulip):

Obviously I don't really have a repro case :sweat:

Christopher Durham (Aug 03 2020 at 20:38, on Zulip):

Here's a dump of the "See output": https://gist.github.com/CAD97/b11de332558d66c57e350bf296821a3b

Christopher Durham (Aug 03 2020 at 20:40, on Zulip):

What I did when this happened:

I had

#[cfg_pub(
    if #[cfg(SET_CFG)] pub
    else if #[cfg(not(SET_CFG))] pub(self)
)]
fn example() {
    println!("do something");
}

fn main() {

}

I then used "move line" to pull the println into main and then to move the attribute down to main, and then deleted fn example.

Christopher Durham (Aug 03 2020 at 20:41, on Zulip):

(Also, if it has any relevance; this is an example in a workspace implementing #[cfg_pub] using watt.)

Jeremy Kolb (Aug 03 2020 at 21:10, on Zulip):

Those panics are probably not good. Can you rebuild with debug symbols?

Christopher Durham (Aug 04 2020 at 03:30, on Zulip):

Well I just managed to reproduce the issue, so I'll see if I can

Christopher Durham (Aug 04 2020 at 03:47, on Zulip):

I've been switching back and forth between a source installed version and the extension managed version

Christopher Durham (Aug 04 2020 at 03:47, on Zulip):

I've not been able to get the one installed from source to fault

Christopher Durham (Aug 04 2020 at 03:48, on Zulip):

But I did get what looks to be a new fault (on the extension managed server): https://gist.github.com/CAD97/e92157c96679340c2662c14c3dda89f9

Christopher Durham (Aug 04 2020 at 03:49, on Zulip):

Yeah the client/server state is definitely getting trashed somewhere

Christopher Durham (Aug 04 2020 at 03:49, on Zulip):

I have a consistentish break on the managed install, let's see if it translates to a source installed one...

Christopher Durham (Aug 04 2020 at 03:51, on Zulip):

ooo progress

Christopher Durham (Aug 04 2020 at 03:53, on Zulip):

I can get a fault with the extension version 0.2.264 but not when it's installed from source

Christopher Durham (Aug 04 2020 at 04:00, on Zulip):

I think it still uses the rust-analyzer binary from PATH first? I honestly don't know enough

Christopher Durham (Aug 04 2020 at 04:02, on Zulip):

Quick example of repro: https://imgur.com/72UJjjK

Christopher Durham (Aug 04 2020 at 04:03, on Zulip):

Starting from xtask install and just switching to the published version of the extension

Christopher Durham (Aug 04 2020 at 04:03, on Zulip):

Repo I'm doing this in: https://github.com/CAD97/cfg-pub/

Christopher Durham (Aug 04 2020 at 04:08, on Zulip):

(deleted)

Christopher Durham (Aug 04 2020 at 04:13, on Zulip):

Ah, so the installed version was still using the managed server binary rather than the one got from xtask install...

Christopher Durham (Aug 04 2020 at 04:14, on Zulip):

I think whatever issue I am seeing was fixed by #5659

Christopher Durham (Aug 04 2020 at 04:18, on Zulip):

Yep, checking out before that merge makes the issue return

Christopher Durham (Aug 04 2020 at 04:19, on Zulip):

output: https://gist.github.com/CAD97/048b56f77aa2505dd3a20fc3d762b007

Laurențiu Nicola (Aug 04 2020 at 05:44, on Zulip):

Sigh. If matklad starts selling "I broke rust-analyzer" T-shirts, I'll buy one.

Laurențiu Nicola (Aug 04 2020 at 05:45, on Zulip):

I tried really hard, but never saw this happen. Curiously, every report is from Windows.

matklad (Aug 04 2020 at 09:18, on Zulip):

I've kicked release

Last update: Sep 27 2020 at 14:30UTC