Stream: t-compiler/wg-rls-2.0

Topic: syntax highlighting


matklad (Feb 27 2020 at 15:21, on Zulip):

@Florian Diebold you might like this:

image.png

Florian Diebold (Feb 27 2020 at 15:27, on Zulip):

:smiley:

matklad (Feb 27 2020 at 15:28, on Zulip):

Lol, it's even recursive. Didn't expect that

matklad (Feb 27 2020 at 15:28, on Zulip):

image.png

Edwin Cheng (Feb 27 2020 at 15:29, on Zulip):

That's awesome !

std::Veetaha (Feb 27 2020 at 15:57, on Zulip):

Does it highlight the code inside of string literals?

matklad (Feb 27 2020 at 15:58, on Zulip):

yup, if the literal is a an argument to the function, whose corresponding parameter is named ra_fixture

std::Veetaha (Feb 27 2020 at 16:01, on Zulip):

Hmm, I wish we could make it more general.
I know that vscode detects quiasi quotation with TypeScript (JavaScript) tag functions:
image.png

std::Veetaha (Feb 27 2020 at 16:03, on Zulip):

We could kinda reserve the special number of hashes #, e.g. 3 of them to denote a rust source code string literal

matklad (Feb 27 2020 at 16:05, on Zulip):

we'll use attrs once they are stable: https://github.com/rust-analyzer/rust-analyzer/pull/3349#issuecomment-592022476

std::Veetaha (Feb 27 2020 at 16:14, on Zulip):

Hmm, yeah really, that's a nice application of the attributes!

Laurențiu Nicola (Feb 27 2020 at 17:20, on Zulip):

ra_fixture::code(r#"..."#) :slight_smile:

Laurențiu Nicola (Feb 27 2020 at 17:23, on Zulip):

But I think the current solution is fine. Nobody will know.

std::Veetaha (Feb 27 2020 at 17:52, on Zulip):

Easter egg)

matklad (Feb 27 2020 at 17:55, on Zulip):

there's one intentional Easter egg in rust-analyzer....

std::Veetaha (Feb 27 2020 at 18:08, on Zulip):

Hmm, gonna read all da code to find it!

std::Veetaha (Feb 27 2020 at 19:31, on Zulip):

Does the following still work, @matklad ?

env RUST_LOG=gen_lsp_server=trace code .

I would like to enable trace logging for Run extension debug configurations in VSCode...

matklad (Feb 27 2020 at 23:02, on Zulip):

rust-analyzer.trace.server = verbose is better

Coenen Benjamin (Apr 29 2020 at 18:02, on Zulip):

Hi all I'm currently trying to debug this issue https://github.com/rust-analyzer/rust-analyzer/issues/4202 but when I inspect with vscode I don't have the part about semantic token type. I think it's because I don't really use rust-analyzer for my syntax highlighting ? Can you give me a tips to enable this kind of view with the syntax highlighting coming from ra ?

Coenen Benjamin (Apr 29 2020 at 18:06, on Zulip):

Sorry for the noise I find the solution. I just had to select a default theme (dark +) for example

matklad (Apr 30 2020 at 07:39, on Zulip):

do you have editor.semanticTokens = true; or something like that in settings.json?

matklad (Apr 30 2020 at 07:39, on Zulip):

I thin it is required to enable highlighting

Laurențiu Nicola (Apr 30 2020 at 07:43, on Zulip):

I think it's enabled by default now -- it was the theme.

Igor Matuszewski (May 07 2020 at 18:41, on Zulip):

I'd just like to say kudos for implementing it in the rust-analyzer - I believe that's the feature I missed most in the IDE environment. Just switching to rust-analyzer in the extension makes a big difference and I'm excited for the feature :tada:

Jeremy Kolb (May 07 2020 at 20:11, on Zulip):

This is so much faster in today's vscode release

Last update: Oct 28 2020 at 18:15UTC