rust-lang / rls

Repository for the Rust Language Server (aka RLS)
Other
3.51k stars 258 forks source link

RLS diagonstics returns a wrong URI #1546

Closed bilelmoussaoui closed 5 years ago

bilelmoussaoui commented 5 years ago

Hey,

@haecker-felix & I have been working to integrate RLS with GNOME Builder. GNOME Builder has already an extension that works fine with RLS, except that it requires having RLS installed on the host.

The work we were doing is to use RLS from a flatpak runtime. The rust sdk is installed under /usr/lib/sdk/rust-stable/

The auto-completion works fine but we have been seeing those logs

Builder sends this to RLS

{'method': <'textDocument/didChange'>, 'jsonrpc': <'2.0'>, 'params': <{'textDocument': <{'uri': <'file:///var/home/haecker-felix/Dokumente/Projekte/Shortwave/src/app.rs'>, 'version': <int64 18>}>, 'contentChanges': <[<{'range': <{'start': <{'line': <int64 109>, 'character': <int64 11>}>, 'end': <{'line': <int64 109>, 'character': <int64 11>}>}>, 'rangeLength': <int64 0>, 'text': <'f'>}>]>}>}

But RLS returns

{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[{"code":"E0609","message":"no field `error here!` on type `&app::App`","range":{"end":{"character":22,"line":109},"start":{"character":13,"line":109}},"severity":1,"source":"rustc"}],"uri":"file:///var/home/haecker-felix/Dokumente/Projekte/Shortwave/../src/app.rs"}}

The output seems to be fine except the uri which points to a wrong one instead of returning the same one?

bilelmoussaoui commented 5 years ago

Heh, sorry we had a RUSTFLAGS somewhere causing this.