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

Integrate rls #56

Merged
merged 19 commits into from
Feb 8, 2017
Merged

Integrate rls #56

merged 19 commits into from
Feb 8, 2017

Conversation

KalitaAlexey
Copy link
Member

@KalitaAlexey KalitaAlexey commented Feb 1, 2017

I made a huge refactoring because it had been very ugly and unstructured.
In my opinion now it is better.
I hope I broke nothing.
If there is something broken let me know.

I added integration of RLS.
Check a new property rls.

If you have RLS sources you can try out RLS with the following configuration:

"rls": {
  "executable": "cargo",
  "args": ["run", "--manifest-path=<path/to/RLS/Cargo.toml>"]
}

This PR is going to be open until Sunday.
Then I am going to merge it and publish a new version.

Closes #45.

If you want to try it out:

  • Execute:
git clone https://github.com/KalitaAlexey/vscode-rust.git
cd vscode-rust
git fetch origin pull/56/head:pull-56
git checkout pull-56
npm install
code .
  • Press CTRL+F5 in VSCode to run the extension

@KalitaAlexey
Copy link
Member Author

I encourage everyone to check that out before it is merged.
Let me know if you have any problems.

@jonasbb
Copy link

jonasbb commented Feb 2, 2017

@KalitaAlexey do you plan to also use rustDocument/diagnosticsBegin and rustDocument/diagnosticsEnd to show the current state of RLS?

@KalitaAlexey
Copy link
Member Author

@jonasbb,
Yes. I think I will add it.

@jonasbb
Copy link

jonasbb commented Feb 2, 2017

I am not able to use the rename feature. I only get a "Info provider failed" banner message.

@KalitaAlexey
Copy link
Member Author

@jonasbb @jonasbb,
You can set env:

"rls": {
    "env": {
        "RUST_LOG": "rls=debug"
    }
}

Then see "Rust Language Server" output channel.

@vadimcn
Copy link

vadimcn commented Feb 2, 2017

Feedback so far:

  1. I am getting thread '<unnamed>' panicked at 'RUST_SRC_PATH is set: NotPresent', message from RLS, even though I've already configured "rust.rustLangSrcPath". I think this info should be propagated automatically by the extension.
  2. Yeah, it'd be nice to show RLS analysis status, just like rls_vscode does. Otherwise, it's confusing why goto definition which failed after opening the project, then suddenly starts working.

Also, what happens if both the RLS and Racer executables are configured? Which one will get used?

@KalitaAlexey
Copy link
Member Author

@vadimcn,

  1. It should be propagated. I will check it again.

@jonasbb
Copy link

jonasbb commented Feb 2, 2017

@KalitaAlexey RLS responds with a valid message

Content-Length: 595

{"jsonrpc":"2.0","id":1,"result":{"changes":{"file:///home/jbushart/projects/rls/sample_project/src/lib.rs":[{"range":{"start":{"line":12,"character":11},"end":{"line":12,"character":19}},"newText":"More"},{"range":{"start":{"line":18,"character":5},"end":{"line":18,"character":13}},"newText":"More"},{"range":{"start":{"line":19,"character":20},"end":{"line":19,"character":28}},"newText":"More"},{"range":{"start":{"line":20,"character":8},"end":{"line":20,"character":16}},"newText":"More"},{"range":{"start":{"line":29,"character":12},"end":{"line":29,"character":20}},"newText":"More"}]}}}

@KalitaAlexey
Copy link
Member Author

@jonasbb,
Okay.
I will check. Thanks for your feedback.

@KalitaAlexey
Copy link
Member Author

@vadimcn,
If RLS is configured, it is turned on, otherwise racer.

@KalitaAlexey
Copy link
Member Author

@jonasbb,

@KalitaAlexey do you plan to also use rustDocument/diagnosticsBegin and rustDocument/diagnosticsEnd to show the current state of RLS?

I added it.

@KalitaAlexey
Copy link
Member Author

@vadimcn,

I am getting thread '' panicked at 'RUST_SRC_PATH is set: NotPresent', message from RLS, even though I've already configured "rust.rustLangSrcPath". I think this info should be propagated automatically by the extension.

I added it.

@KalitaAlexey
Copy link
Member Author

Hi everybody.
I can't integrate it right now because I can't figure out a way to show diagnostics for test or build with some specific features.
If you suggest something I would be glad.
I have two options:

  • Execute any cargo command in an integrated terminal, so there is no need for showing diagnostics in editor. It is good since we can see beautiful messages.
  • Execute any cargo command in a subprocess, parse diagnostics and add a status bar item to clear diagnostics from the previous cargo command.

It is made to execute commands in RLS mode.
It was made because activation via task had been able to fail.
It was because of asynchronous creation of ConfigurationManager.
This parameter forces the extension execute cargo command in a terminal.
@KalitaAlexey
Copy link
Member Author

KalitaAlexey commented Feb 7, 2017

Okay. Now I am ready to merge it.
I want to describe the extension in the wiki. This may take a while.
I want everyone to test it.
When RLS is used any cargo command is executed in an integrated terminal.

@KalitaAlexey
Copy link
Member Author

When it is merged it will fix #61.
The parameter is executeCargoCommandInTerminal.

@KalitaAlexey KalitaAlexey merged commit 2730abf into master Feb 8, 2017
@KalitaAlexey KalitaAlexey deleted the integrate-rls branch February 8, 2017 14:54
@KalitaAlexey KalitaAlexey mentioned this pull request Feb 11, 2017
@Diggsey
Copy link

Diggsey commented Feb 12, 2017

Since enabling the RLS, I no longer get autocomplete when typing : but pressing ctrl + space still works.

@KalitaAlexey
Copy link
Member Author

Diggsey opened an issue #72

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

4 participants