Skip to content

Enter key doesn't work in *.rs files #823

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
Aloso opened this issue Feb 13, 2019 · 12 comments
Closed

Enter key doesn't work in *.rs files #823

Aloso opened this issue Feb 13, 2019 · 12 comments

Comments

@Aloso
Copy link

Aloso commented Feb 13, 2019

I installed rust-analyzer ~ 10 min ago.

When I press Enter or Shift+Enter, nothing happens. Only Ctrl+Enter works. Only rust files are affected.

VS Code: 1.31.1
OS: Manjaro (Linux 4.19) with KDE Plasma
Keyboard: German

@matklad
Copy link
Member

matklad commented Feb 13, 2019

That probably means rust analyzer is not actually working. Does the "Rust Analyzer: Status" command works?

@Aloso
Copy link
Author

Aloso commented Feb 13, 2019

No, it doesn't. Can I fix it?

@matklad
Copy link
Member

matklad commented Feb 13, 2019

Probably, but we need to figure out what's wrong in the first place :)

Is there "rust-analyzer" section in the "Output" tab of the vs code panel?

@Aloso
Copy link
Author

Aloso commented Feb 13, 2019

The tab is empty.

@Aloso
Copy link
Author

Aloso commented Feb 13, 2019

I'm confused, because when I hover over a struct or trait name, the definition is shown. Doesn't this mean that ra is working?

@Aloso
Copy link
Author

Aloso commented Feb 13, 2019

I just re-installed it. Now the output says:

[Error - 21:23:15] Request textDocument/hover failed.
  Message: content modified
  Code: -32801 
[Error - 21:23:16] Request textDocument/hover failed.
  Message: content modified
  Code: -32801
ERROR [ra_lsp_server::main_loop] unknown request: RawRequest { id: 26, method: "m/decorationsRequest", params: Object({"uri": String("file:///home/ludwig/Develop/glutin_2018/src/lib.rs")}) }

@Aloso
Copy link
Author

Aloso commented Feb 13, 2019

When I press Enter, this is printed to the output:

ERROR [ra_lsp_server::main_loop] unknown request: RawRequest { id: 113, method: "m/onEnter", params: Object({"position": Object({"character": Number(0), "line": Number(39)}), "textDocument": Object({"uri": String("file:///home/ludwig/Develop/glutin_2018/src/tests.rs")})}) }

@matklad
Copy link
Member

matklad commented Feb 13, 2019

ERROR [ra_lsp_server::main_loop] unknown request: RawRequest { id: 26, method: "m/decorationsRequest", params: Object({"uri": String("file:///home/ludwig/Develop/glutin_2018/src/lib.rs")}) }

That means that you use a severely outdated version of the VS Code extension. Have you installed the analyzer from the master branch using cargo install-code command?

@Aloso
Copy link
Author

Aloso commented Feb 13, 2019

Yes, I did. However, I just did a git pull, then cargo install-lsp and cargo install-code, and now Enter works.

@Aloso Aloso closed this as completed Feb 13, 2019
@matklad
Copy link
Member

matklad commented Feb 13, 2019

Note that we could have renamed the plugin itself (probably? I don't remember), so it might be a good idea to check vscode extensions list for a stale one.

@Aloso
Copy link
Author

Aloso commented Feb 13, 2019

No, there's only one plugin. But it's possible that forgot cargo install-lsp the first time, so an outdated version was used. Thanks anyway for the help ;)

@DJMcNab
Copy link
Contributor

DJMcNab commented Feb 13, 2019

We have renamed the plugin I think.

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