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

Adding a dependency to Cargo.toml require RLS + IDE restart #1240

Closed
norru opened this issue Jan 18, 2019 · 21 comments · Fixed by #1246
Closed

Adding a dependency to Cargo.toml require RLS + IDE restart #1240

norru opened this issue Jan 18, 2019 · 21 comments · Fixed by #1246

Comments

@norru
Copy link

norru commented Jan 18, 2019

Adding a dependency to Cargo.toml doesn't trigger a rebuild. As a result, any reference to the added dependency results in a compilation error.

For

[dependencies]
...
notify = "*"
...

main.rs:

extern crate notify;

RLS log:

org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[{"code":"E0463","message":"can't find crate for `notify`\n\ncan't find crate","range":{"end":{"character":20,"line":38},"start":{"character":0,"line":38}},"severity":1,"source":"rustc"}],"uri":"file:///home/norru/Projects/ivt/parallax_testbed/src/main.rs"}}

Workaround: restarting the RLS (and the IDE) triggers a rebuild and the missing crate is linked correctly.

@alexheretic
Copy link
Member

Rls should do a full cargo rebuild on manifest changes, is it possible your client isn't telling Rls?

@norru
Copy link
Author

norru commented Jan 20, 2019

Why should my client tell RLS? RLS alreay knows I'm changing Cargo.toml (at least so it says in the logs).

EDIT: I've just checked and in fact RLS doesn't seem to be aware of my Cargo.toml changes.

The role of the RLS is so that that the client doesn't have to worry about file changes.

@mickaelistria

@mickaelistria
Copy link

We can try to associate RLS with the Cargo.toml files so it gets notified of updates on that file (and could even provide some edition assistance for it).

@norru
Copy link
Author

norru commented Jan 20, 2019

It's well worth a shot. No idea how to do it though.

@norru
Copy link
Author

norru commented Jan 20, 2019

If the RLS already does this then this issue should be moved to Corrosion. @mickaelistria WDYT?

@alexheretic
Copy link
Member

alexheretic commented Jan 20, 2019

The role of the RLS is so that that the client doesn't have to worry about file changes

That isn't true, LSP relies on clients watching for file changes and notifying the language server. Sending workspace/didChangeWatchedFiles for all Cargo.toml & Cargo.lock files (plus ./target directory deletion, but not ./target contents) will allow Rls to trigger a full cargo build on changes to these.

@mickaelistria
Copy link

Does RLS somehow declare automatically which files it's supposed to watch for best results, or do we have to hardcode it in our integration? IMHO best behavior should be default and shouldn't require extra-effort.
But would sending fileSaved and documentChanges notification work? It would seem more simple than dealing with extra didChangeWatchedFiles notification.

@norru
Copy link
Author

norru commented Jan 20, 2019

Am I misunderstanding how this works? Is this another feature that has to be implemented in each and every client?

Servers are allowed to run their own file watching mechanism and not rely on clients to provide file events.

Out of curiosity, what's the rationale behind RLS not actually doing this (in fact it does look like it's not recommended although the reasons for the recommendation on the link above are very unconvincing)

@mickaelistria putting things together, it does look like the file monitoring should be done by LSP4E. I have opened an issue in the Eclipse bug reporter. https://bugs.eclipse.org/bugs/show_bug.cgi?id=543627

On a side note, is there any chance that we can have LSP4E issue reporting on GitHub? The Eclipse one is very clunky and cross-referencing all the other GitHub project is very inconvenient.

@norru
Copy link
Author

norru commented Jan 20, 2019

fileSaved and documentChanges notification work? It would seem more simple than dealing with extra didChangeWatchedFiles notification.

It may work if we assume all file changes are done within the Corrosion "registered" editors which is not true but it's what most developers would do anyway. It's possibly a useful stepping stone towards "correct" implementation.

Again, I wonder why this is left to each and every client while this clearly is an option that should be implemented in the server as a default - with the option of disabling on in the server if the client can provide a more efficient implementation.

@norru
Copy link
Author

norru commented Jan 20, 2019

I have a local version of Eclipse which now detects changes in Cargo.toml via didSave but still adding a dependency requires a restart.

LSP4E to org.eclipse.corrosion.rls:{"jsonrpc":"2.0","method":"textDocument/didSave","params":{"textDocument":{"uri":"file:///home/nico/Workspaces/runtime-EclipseApplication(1)/new_rust_project/Cargo.toml"},"text":"[package]\nname \u003d \"new_rust_project\"\nversion \u003d \"0.1.0\"\nauthors \u003d [\"Nicola Orru \u003cnigu.orru@gmail.com\u003e\"]\nedition \u003d \"2018\"\n\n[dependencies]\ncgmath \u003d \"*\"\n"}}
LSP4E to org.eclipse.corrosion.rls:Content-Length: 228


LSP4E to org.eclipse.corrosion.rls:{"jsonrpc":"2.0","id":"25","method":"textDocument/documentHighlight","params":{"textDocument":{"uri":"file:///home/nico/Workspaces/runtime-EclipseApplication(1)/new_rust_project/Cargo.toml"},"position":{"line":7,"character":0}}}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","id":"25","result":[]}
LSP4E to org.eclipse.corrosion.rls:Content-Length: 309


LSP4E to org.eclipse.corrosion.rls:{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"version":17,"uri":"file:///home/nico/Workspaces/runtime-EclipseApplication(1)/new_rust_project/Cargo.toml"},"contentChanges":[{"range":{"start":{"line":7,"character":0},"end":{"line":7,"character":0}},"rangeLength":0,"text":"#"}]}}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_41","title":"Building"}}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_41","message":"new_rust_project cfg(test)","title":"Building"}}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_41","message":"new_rust_project","title":"Building"}}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","method":"window/progress","params":{"done":true,"id":"progress_41","title":"Building"}}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_40","title":"Indexing"}}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[{"code":"dead_code","message":"constant item is never used: `UNUSED`\n\nnote: #[warn(dead_code)] on by default","range":{"end":{"character":22,"line":2},"start":{"character":0,"line":2}},"severity":2,"source":"rustc"},{"code":"clippy::bool_comparison","message":"equality checks against true are unnecessary\n\nnote: #[warn(clippy::bool_comparison)] on by default\nhelp: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison\nhelp: try simplifying it as shown: `test`","range":{"end":{"character":16,"line":6},"start":{"character":4,"line":6}},"severity":2,"source":"clippy"}],"uri":"file:///home/nico/Workspaces/runtime-EclipseApplication(1)/new_rust_project/src/main.rs"}}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","method":"window/progress","params":{"done":true,"id":"progress_40","title":"Indexing"}}
LSP4E to org.eclipse.corrosion.rls:Content-Length: 384


LSP4E to org.eclipse.corrosion.rls:{"jsonrpc":"2.0","method":"textDocument/didSave","params":{"textDocument":{"uri":"file:///home/nico/Workspaces/runtime-EclipseApplication(1)/new_rust_project/Cargo.toml"},"text":"[package]\nname \u003d \"new_rust_project\"\nversion \u003d \"0.1.0\"\nauthors \u003d [\"Nicola Orru \u003cnigu.orru@gmail.com\u003e\"]\nedition \u003d \"2018\"\n\n[dependencies]\n#cgmath \u003d \"*\"\n"}}
LSP4E to org.eclipse.corrosion.rls:Content-Length: 228


LSP4E to org.eclipse.corrosion.rls:{"jsonrpc":"2.0","id":"26","method":"textDocument/documentHighlight","params":{"textDocument":{"uri":"file:///home/nico/Workspaces/runtime-EclipseApplication(1)/new_rust_project/Cargo.toml"},"position":{"line":7,"character":1}}}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","id":"26","result":[]}
LSP4E to org.eclipse.corrosion.rls:Content-Length: 183


LSP4E to org.eclipse.corrosion.rls:{"jsonrpc":"2.0","id":"27","method":"textDocument/codeLens","params":{"textDocument":{"uri":"file:///home/nico/Workspaces/runtime-EclipseApplication(1)/new_rust_project/Cargo.toml"}}}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","id":"27","result":[]}
LSP4E to org.eclipse.corrosion.rls:Content-Length: 189


LSP4E to org.eclipse.corrosion.rls:{"jsonrpc":"2.0","id":"28","method":"textDocument/documentSymbol","params":{"textDocument":{"uri":"file:///home/nico/Workspaces/runtime-EclipseApplication(1)/new_rust_project/Cargo.toml"}}}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","id":"28","result":[]}

@norru norru closed this as completed Jan 20, 2019
@norru
Copy link
Author

norru commented Jan 20, 2019

Accidentally closed

@norru norru reopened this Jan 20, 2019
@norru
Copy link
Author

norru commented Jan 20, 2019

@alexheretic Here's what I see after adding the cgmath dependency to Cargo.toml.

RLS appears to be ignoring the change.

LSP4E to org.eclipse.corrosion.rls:{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"version":2,"uri":"file:///home/nico/Workspaces/runtime-EclipseApplication(1)/new_rust_project/Cargo.toml"},"contentChanges":[{"range":{"start":{"line":7,"character":0},"end":{"line":7,"character":1}},"rangeLength":1,"text":""}]}}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_59","title":"Building"}}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_59","message":"new_rust_project","title":"Building"}}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_59","message":"new_rust_project cfg(test)","title":"Building"}}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","method":"window/progress","params":{"done":true,"id":"progress_59","title":"Building"}}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_58","title":"Indexing"}}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[{"code":"E0463","message":"can't find crate for `cgmath`\n\ncan't find crate","range":{"end":{"character":20,"line":0},"start":{"character":0,"line":0}},"severity":1,"source":"rustc"}],"uri":"file:///home/nico/Workspaces/runtime-EclipseApplication(1)/new_rust_project/src/main.rs"}}

LSP4E to org.eclipse.corrosion.rls:{"jsonrpc":"2.0","method":"textDocument/didSave","params":{"textDocument":{"uri":"file:///home/nico/Workspaces/runtime-EclipseApplication(1)/new_rust_project/Cargo.toml"},"text":"[package]\nname \u003d \"new_rust_project\"\nversion \u003d \"0.1.0\"\nauthors \u003d [\"Nicola Orru \u003cnigu.orru@gmail.com\u003e\"]\nedition \u003d \"2018\"\n\n[dependencies]\ncgmath \u003d \"*\"\n "}}

org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","method":"window/progress","params":{"done":true,"id":"progress_58","title":"Indexing"}}
LSP4E to org.eclipse.corrosion.rls:Content-Length: 183

@mickaelistria
Copy link

Thanks for the experiment @norru .
So it seems like a good solution that would be simple enough both from client and server side would be that RLS reacts to "didSave" on Cargo.toml just like it reacts to didChangeWatchedFile. What do RLS contributors think about it? Is it safe? Is it simple enough?

@alexheretic
Copy link
Member

Yep I think it makes sense to support textDocument/didChange in that way, seems doable to me.

@alexheretic
Copy link
Member

There is an issue that didChange notifications are usually pre-save. A cargo rebuild can only work post-save afaik, as cargo/rustc reads from disk. So we'd have to handle that somehow. Maybe the lsp messaging is already clear enough to figure that out server side, I'm not sure.

@mickaelistria
Copy link

Using didSave ( https://microsoft.github.io/language-server-protocol/specification#textDocument_didSave ) seems to be more relevant than didChange here and to cover your concerns.

@norru
Copy link
Author

norru commented Jan 21, 2019

Yes, didSave would be more appropriate.

bors added a commit that referenced this issue Jan 22, 2019
Support textDocument/didSave manifest cargo rebuilds

* Support cargo rebuilding when client does not send _workspace/didChangeWatchedFiles_ notifications.
* Update clippy `1838bfe5a9ff951ffd716e4632156113d95d14a4`
* Update cargo `907c0febe7045fa02dff2a35c5e36d3bd59ea50d`

Should fix #1240
@norru
Copy link
Author

norru commented Jan 22, 2019

I'll hook up the didSave logic in Corrosion later. At the moment it's blocked by:

info: latest update on 2019-01-22, rust version 1.33.0-nightly (7164a9f15 2019-01-21)
error: component 'rls' for target 'x86_64-unknown-linux-gnu' is unavailable for download
info: checking for self-updates

norru added a commit to itadinanta/corrosion that referenced this issue Jan 22, 2019
Signed-off-by: Nico Orru <nigu.orru@gmail.com>
mickaelistria pushed a commit to eclipse-corrosion/corrosion that referenced this issue Jan 22, 2019
Signed-off-by: Nico Orru <nigu.orru@gmail.com>
@norru
Copy link
Author

norru commented Jan 24, 2019

Not fixed as for rls-preview 1.31.6 (6f5e4bb 2018-12-21)

@norru
Copy link
Author

norru commented Jan 27, 2019

Not fixed as rls 1.31.6 (c9d25b6 2019-01-20)

LSP4E to org.eclipse.corrosion.rls:{"jsonrpc":"2.0","method":"textDocument/didSave","params":{"textDocument":{"uri":"file:///home/nico/Projects/itadinanta/ofx-rs/ofx/Cargo.toml"},"text":"[package]\nname \u003d \"ofx\"\nversion \u003d \"0.1.0\"\nauthors \u003d [\"Nicola Orru \u003cnigu.orru@gmail.com\u003e\"]\nkeywords \u003d [\"ofx\", \"openfx\", \"effects\", \"natron\", \"nuke\"]\n#edition \u003d \"2018\"\ndescription \u003d \"Bindings for OpenFX 1.4\"\nrepository \u003d \"https://github.com/itadinanta/ofx-rs\"\nlicense \u003d \"Apache-2.0\"\n# publish \u003d false # insurance against accidents\n\n[lib]\nname\u003d\"ofx\"\ncrate-type \u003d [\"lib\"]\npath\u003d\"src/lib.rs\"\n\n[dependencies]\nlibc \u003d \"0.2\"\ncgmath \u003d \"*\"\nlog\u003d\"0.4\"\nlog4rs \u003d \"0.8\"\n#ofx_sys \u003d { path \u003d \"../ofx-sys\" }\nofx_sys \u003d \"0.1.1\"\nphf \u003d \"0.7\"\n"}}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_35","title":"Building"}}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_35","message":"ofx cfg(test)","title":"Building"}}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_35","message":"ofx","title":"Building"}}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_35","message":"ofx_rs_basic cfg(test)","title":"Building"}}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_35","message":"ofx_rs_basic","title":"Building"}}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","method":"window/progress","params":{"done":true,"id":"progress_35","title":"Building"}}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_34","title":"Indexing"}}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","method":"window/progress","params":{"done":true,"id":"progress_34","title":"Indexing"}}
LSP4E to org.eclipse.corrosion.rls:Content-Length: 1358


LSP4E to org.eclipse.corrosion.rls:{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///home/nico/Projects/itadinanta/ofx-rs/ofx/src/lib.rs","languageId":"rs","version":1,"text":"#![allow(unused)]\n#![feature(concat_idents)]\n#![feature(specialization)]\n\nextern crate ofx_sys;\n#[macro_use]\nextern crate log;\nextern crate log4rs;\n\nuse std::collections::HashMap;\nuse std::ffi::{CStr, CString};\nuse std::fmt;\nuse std::fmt::Display;\nuse std::marker::PhantomData;\n\n#[macro_use]\nmod result;\n\n#[macro_use]\nmod suites;\n#[macro_use]\nmod util;\nmod action;\nmod enums;\nmod handle;\nmod plugin;\nmod property;\nmod types;\n#[macro_use]\nmod registry;\nmod image;\npub use action::*;\npub use enums::*;\npub use enums::Type as Type;\npub use handle::*;\npub use plugin::*;\npub use property::*;\npub use result::*;\npub use types::*;\npub use util::*;\npub use image::*;\nuse registry::*;\n\npub use ofx_sys::{OfxHost, OfxPlugin, OfxPropertySetHandle};\npub use registry::{\n\tget_registry, init_registry, main_entry_for_plugin, set_host_for_plugin, Registry,\n};\n\n#[macro_export]\nmacro_rules! register_modules {\n\t( $ ($module:ident), *) \u003d\u003e {\n\t\tfn register_plugins(registry: \u0026mut ofx::Registry) {\n\t\t\t$(register_plugin!(registry, $module);\n\t\t\t)*\n\t\t}\n\n\t\tbuild_plugin_registry!(register_plugins);\n\t};\n}\n\n"}}}
LSP4E to org.eclipse.corrosion.rls:Content-Length: 156


LSP4E to org.eclipse.corrosion.rls:{"jsonrpc":"2.0","id":"12","method":"textDocument/codeLens","params":{"textDocument":{"uri":"file:///home/nico/Projects/itadinanta/ofx-rs/ofx/src/lib.rs"}}}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","id":"12","result":[]}
LSP4E to org.eclipse.corrosion.rls:Content-Length: 201


LSP4E to org.eclipse.corrosion.rls:{"jsonrpc":"2.0","id":"13","method":"textDocument/documentHighlight","params":{"textDocument":{"uri":"file:///home/nico/Projects/itadinanta/ofx-rs/ofx/src/lib.rs"},"position":{"line":8,"character":0}}}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","id":"13","result":[]}
LSP4E to org.eclipse.corrosion.rls:Content-Length: 201


LSP4E to org.eclipse.corrosion.rls:{"jsonrpc":"2.0","id":"14","method":"textDocument/documentHighlight","params":{"textDocument":{"uri":"file:///home/nico/Projects/itadinanta/ofx-rs/ofx/src/lib.rs"},"position":{"line":8,"character":0}}}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","id":"14","result":[]}
LSP4E to org.eclipse.corrosion.rls:Content-Length: 281


LSP4E to org.eclipse.corrosion.rls:{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"version":2,"uri":"file:///home/nico/Projects/itadinanta/ofx-rs/ofx/src/lib.rs"},"contentChanges":[{"range":{"start":{"line":8,"character":0},"end":{"line":8,"character":0}},"rangeLength":0,"text":"e"}]}}
LSP4E to org.eclipse.corrosion.rls:Content-Length: 281


LSP4E to org.eclipse.corrosion.rls:{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"version":3,"uri":"file:///home/nico/Projects/itadinanta/ofx-rs/ofx/src/lib.rs"},"contentChanges":[{"range":{"start":{"line":8,"character":1},"end":{"line":8,"character":1}},"rangeLength":0,"text":"x"}]}}
LSP4E to org.eclipse.corrosion.rls:Content-Length: 281


LSP4E to org.eclipse.corrosion.rls:{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"version":4,"uri":"file:///home/nico/Projects/itadinanta/ofx-rs/ofx/src/lib.rs"},"contentChanges":[{"range":{"start":{"line":8,"character":2},"end":{"line":8,"character":2}},"rangeLength":0,"text":"t"}]}}
LSP4E to org.eclipse.corrosion.rls:Content-Length: 281


LSP4E to org.eclipse.corrosion.rls:{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"version":5,"uri":"file:///home/nico/Projects/itadinanta/ofx-rs/ofx/src/lib.rs"},"contentChanges":[{"range":{"start":{"line":8,"character":3},"end":{"line":8,"character":3}},"rangeLength":0,"text":"e"}]}}
LSP4E to org.eclipse.corrosion.rls:Content-Length: 281


LSP4E to org.eclipse.corrosion.rls:{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"version":6,"uri":"file:///home/nico/Projects/itadinanta/ofx-rs/ofx/src/lib.rs"},"contentChanges":[{"range":{"start":{"line":8,"character":4},"end":{"line":8,"character":4}},"rangeLength":0,"text":"r"}]}}
LSP4E to org.eclipse.corrosion.rls:Content-Length: 281


LSP4E to org.eclipse.corrosion.rls:{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"version":7,"uri":"file:///home/nico/Projects/itadinanta/ofx-rs/ofx/src/lib.rs"},"contentChanges":[{"range":{"start":{"line":8,"character":5},"end":{"line":8,"character":5}},"rangeLength":0,"text":"n"}]}}
LSP4E to org.eclipse.corrosion.rls:Content-Length: 281


LSP4E to org.eclipse.corrosion.rls:{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"version":8,"uri":"file:///home/nico/Projects/itadinanta/ofx-rs/ofx/src/lib.rs"},"contentChanges":[{"range":{"start":{"line":8,"character":6},"end":{"line":8,"character":6}},"rangeLength":0,"text":" "}]}}
LSP4E to org.eclipse.corrosion.rls:Content-Length: 281


LSP4E to org.eclipse.corrosion.rls:{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"version":9,"uri":"file:///home/nico/Projects/itadinanta/ofx-rs/ofx/src/lib.rs"},"contentChanges":[{"range":{"start":{"line":8,"character":7},"end":{"line":8,"character":7}},"rangeLength":0,"text":"c"}]}}
LSP4E to org.eclipse.corrosion.rls:Content-Length: 282


LSP4E to org.eclipse.corrosion.rls:{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"version":10,"uri":"file:///home/nico/Projects/itadinanta/ofx-rs/ofx/src/lib.rs"},"contentChanges":[{"range":{"start":{"line":8,"character":8},"end":{"line":8,"character":8}},"rangeLength":0,"text":"r"}]}}
LSP4E to org.eclipse.corrosion.rls:Content-Length: 282


LSP4E to org.eclipse.corrosion.rls:{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"version":11,"uri":"file:///home/nico/Projects/itadinanta/ofx-rs/ofx/src/lib.rs"},"contentChanges":[{"range":{"start":{"line":8,"character":9},"end":{"line":8,"character":9}},"rangeLength":0,"text":"a"}]}}
LSP4E to org.eclipse.corrosion.rls:Content-Length: 284


LSP4E to org.eclipse.corrosion.rls:{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"version":12,"uri":"file:///home/nico/Projects/itadinanta/ofx-rs/ofx/src/lib.rs"},"contentChanges":[{"range":{"start":{"line":8,"character":10},"end":{"line":8,"character":10}},"rangeLength":0,"text":"t"}]}}
LSP4E to org.eclipse.corrosion.rls:Content-Length: 284


LSP4E to org.eclipse.corrosion.rls:{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"version":13,"uri":"file:///home/nico/Projects/itadinanta/ofx-rs/ofx/src/lib.rs"},"contentChanges":[{"range":{"start":{"line":8,"character":11},"end":{"line":8,"character":11}},"rangeLength":0,"text":"e"}]}}
LSP4E to org.eclipse.corrosion.rls:Content-Length: 284


LSP4E to org.eclipse.corrosion.rls:{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"version":14,"uri":"file:///home/nico/Projects/itadinanta/ofx-rs/ofx/src/lib.rs"},"contentChanges":[{"range":{"start":{"line":8,"character":12},"end":{"line":8,"character":12}},"rangeLength":0,"text":" "}]}}
LSP4E to org.eclipse.corrosion.rls:Content-Length: 284


LSP4E to org.eclipse.corrosion.rls:{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"version":15,"uri":"file:///home/nico/Projects/itadinanta/ofx-rs/ofx/src/lib.rs"},"contentChanges":[{"range":{"start":{"line":8,"character":13},"end":{"line":8,"character":13}},"rangeLength":0,"text":"c"}]}}
LSP4E to org.eclipse.corrosion.rls:Content-Length: 284


LSP4E to org.eclipse.corrosion.rls:{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"version":16,"uri":"file:///home/nico/Projects/itadinanta/ofx-rs/ofx/src/lib.rs"},"contentChanges":[{"range":{"start":{"line":8,"character":14},"end":{"line":8,"character":14}},"rangeLength":0,"text":"g"}]}}
LSP4E to org.eclipse.corrosion.rls:Content-Length: 284


LSP4E to org.eclipse.corrosion.rls:{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"version":17,"uri":"file:///home/nico/Projects/itadinanta/ofx-rs/ofx/src/lib.rs"},"contentChanges":[{"range":{"start":{"line":8,"character":15},"end":{"line":8,"character":15}},"rangeLength":0,"text":"m"}]}}
LSP4E to org.eclipse.corrosion.rls:Content-Length: 284


LSP4E to org.eclipse.corrosion.rls:{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"version":18,"uri":"file:///home/nico/Projects/itadinanta/ofx-rs/ofx/src/lib.rs"},"contentChanges":[{"range":{"start":{"line":8,"character":16},"end":{"line":8,"character":16}},"rangeLength":0,"text":"a"}]}}
LSP4E to org.eclipse.corrosion.rls:Content-Length: 284


LSP4E to org.eclipse.corrosion.rls:{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"version":19,"uri":"file:///home/nico/Projects/itadinanta/ofx-rs/ofx/src/lib.rs"},"contentChanges":[{"range":{"start":{"line":8,"character":17},"end":{"line":8,"character":17}},"rangeLength":0,"text":"t"}]}}
LSP4E to org.eclipse.corrosion.rls:Content-Length: 284


LSP4E to org.eclipse.corrosion.rls:{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"version":20,"uri":"file:///home/nico/Projects/itadinanta/ofx-rs/ofx/src/lib.rs"},"contentChanges":[{"range":{"start":{"line":8,"character":18},"end":{"line":8,"character":18}},"rangeLength":0,"text":"h"}]}}
LSP4E to org.eclipse.corrosion.rls:Content-Length: 284


LSP4E to org.eclipse.corrosion.rls:{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"version":21,"uri":"file:///home/nico/Projects/itadinanta/ofx-rs/ofx/src/lib.rs"},"contentChanges":[{"range":{"start":{"line":8,"character":19},"end":{"line":8,"character":19}},"rangeLength":0,"text":";"}]}}
LSP4E to org.eclipse.corrosion.rls:Content-Length: 285


LSP4E to org.eclipse.corrosion.rls:{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"version":22,"uri":"file:///home/nico/Projects/itadinanta/ofx-rs/ofx/src/lib.rs"},"contentChanges":[{"range":{"start":{"line":8,"character":20},"end":{"line":8,"character":20}},"rangeLength":0,"text":"\n"}]}}
LSP4E to org.eclipse.corrosion.rls:Content-Length: 1350


LSP4E to org.eclipse.corrosion.rls:{"jsonrpc":"2.0","method":"textDocument/didSave","params":{"textDocument":{"uri":"file:///home/nico/Projects/itadinanta/ofx-rs/ofx/src/lib.rs"},"text":"#![allow(unused)]\n#![feature(concat_idents)]\n#![feature(specialization)]\n\nextern crate ofx_sys;\n#[macro_use]\nextern crate log;\nextern crate log4rs;\nextern crate cgmath;\n\nuse std::collections::HashMap;\nuse std::ffi::{CStr, CString};\nuse std::fmt;\nuse std::fmt::Display;\nuse std::marker::PhantomData;\n\n#[macro_use]\nmod result;\n\n#[macro_use]\nmod suites;\n#[macro_use]\nmod util;\nmod action;\nmod enums;\nmod handle;\nmod plugin;\nmod property;\nmod types;\n#[macro_use]\nmod registry;\nmod image;\npub use action::*;\npub use enums::*;\npub use enums::Type as Type;\npub use handle::*;\npub use plugin::*;\npub use property::*;\npub use result::*;\npub use types::*;\npub use util::*;\npub use image::*;\nuse registry::*;\n\npub use ofx_sys::{OfxHost, OfxPlugin, OfxPropertySetHandle};\npub use registry::{\n\tget_registry, init_registry, main_entry_for_plugin, set_host_for_plugin, Registry,\n};\n\n#[macro_export]\nmacro_rules! register_modules {\n\t( $ ($module:ident), *) \u003d\u003e {\n\t\tfn register_plugins(registry: \u0026mut ofx::Registry) {\n\t\t\t$(register_plugin!(registry, $module);\n\t\t\t)*\n\t\t}\n\n\t\tbuild_plugin_registry!(register_plugins);\n\t};\n}\n\n"}}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_77","title":"Building"}}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_77","message":"ofx","title":"Building"}}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_77","message":"ofx_rs_basic cfg(test)","title":"Building"}}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_77","message":"ofx_rs_basic","title":"Building"}}
LSP4E to org.eclipse.corrosion.rls:Content-Length: 201


LSP4E to org.eclipse.corrosion.rls:{"jsonrpc":"2.0","id":"15","method":"textDocument/documentHighlight","params":{"textDocument":{"uri":"file:///home/nico/Projects/itadinanta/ofx-rs/ofx/src/lib.rs"},"position":{"line":9,"character":0}}}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","id":"15","result":[]}
LSP4E to org.eclipse.corrosion.rls:Content-Length: 156


LSP4E to org.eclipse.corrosion.rls:{"jsonrpc":"2.0","id":"16","method":"textDocument/codeLens","params":{"textDocument":{"uri":"file:///home/nico/Projects/itadinanta/ofx-rs/ofx/src/lib.rs"}}}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","id":"16","result":[]}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_77","message":"ofx cfg(test)","title":"Building"}}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","method":"window/progress","params":{"done":true,"id":"progress_77","title":"Building"}}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_76","title":"Indexing"}}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[{"code":"E0463","message":"can't find crate for `cgmath`\n\ncan't find crate","range":{"end":{"character":20,"line":8},"start":{"character":0,"line":8}},"severity":1,"source":"rustc"}],"uri":"file:///home/nico/Projects/itadinanta/ofx-rs/ofx/src/lib.rs"}}
org.eclipse.corrosion.rls to LSP4E:{"jsonrpc":"2.0","method":"window/progress","params":{"done":true,"id":"progress_76","title":"Indexing"}}

@norru
Copy link
Author

norru commented Jan 27, 2019

So we're correctly issuing the didSave message but the RLS doesn't trigger a rebuild.

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 a pull request may close this issue.

3 participants