Stream: t-compiler/wg-rls-2.0

Topic: CodeLens Range


Martin Asquino (Dec 24 2019 at 12:25, on Zulip):

Hi everyone! Not sure how critical this is or why this is the case, but I noticed that the LSP specification says that CodeLens ranges should span a single line (https://microsoft.github.io/language-server-protocol/specifications/specification-3-15/#textDocument_codeLens) but some of the ones I get span multiple lines. For example this one:

CodeLens { range: Range { start: Position { line: 16, character: 0 }, end: Position { line: 23, character: 1 } }, command: Some(Command { title: "Run", command: "rust-analyzer.runSingle", arguments: Some([Object({"args": Array([String("run")]), "bin": String("cargo"), "cwd": Null, "env": Object({"RUST_BACKTRACE": String("short")}), "label": String("run binary"), "range": Object({"end": Object({"character": Number(1), "line": Number(23)}), "start": Object({"character": Number(0), "line": Number(16)})})})]) }), data: None }

Is this intended? Or should I open an issue?

(Also, and completely off-topic, I just saw a couple of days ago some mentions re: migration to LSP 3.15 and the lsp-types crate PR which updated it to 3.15, sorry for the mistakes in that PR, I know there were some fixes around that, and also for not being available to fix them, I just relocated to London about a month ago and I'm just starting to get things back to normal now)

Jeremy Kolb (Dec 24 2019 at 14:02, on Zulip):

@Martin Asquino Hm... I forgot about the 'one line' think. I think you should ask for clarification on https://github.com/Microsoft/language-server-protocol/

Jeremy Kolb (Dec 24 2019 at 14:04, on Zulip):

No worries on the 3.15. It happens and I've made more than my share of mistakes there.

Jeremy Kolb (Dec 24 2019 at 14:04, on Zulip):

I wish there was a way to autogenerate rust from the protocol spec.

Martin Asquino (Dec 24 2019 at 15:57, on Zulip):

On a related note: I'm getting different results in the same project when running 1.39 vs 1.40. 1.39 gives me some CodeLens items back, while 1.40 gives me None. Maybe this one does deserve an issue? Or is it a known one already?

Martin Asquino (Dec 24 2019 at 16:00, on Zulip):

And project is an over-statement, it's a just dummy project with only a few lines to test stuff out. :grinning_face_with_smiling_eyes:

Jeremy Kolb (Dec 24 2019 at 16:36, on Zulip):

File an issue and include the dummy project.

Jeremy Kolb (Dec 24 2019 at 16:36, on Zulip):

You're talking about vscode or rust 1.39 vs 1.40? I don't think the rust version would make a difference.

Martin Asquino (Dec 24 2019 at 16:46, on Zulip):

I'm on vim, and switching rust version causes that difference.

Martin Asquino (Dec 24 2019 at 17:01, on Zulip):

Ok turns out it was not so much the rust version, but how I specified it. rustup override set 1.40.0 and it works. rustup override set stable and it doesn't. I opened https://github.com/rust-analyzer/rust-analyzer/issues/2665 and tried to explain that.

Last update: May 26 2020 at 08:55UTC