Zulip Chat Archive

Stream: general

Topic: VSCode extension: highlighting in import line


Michael Stoll (Jun 17 2024 at 18:31):

In the line

import Mathlib.GroupTheory.Perm.Cycle.Type

the Type part is highlighted in blue (in VSCode with Lean4 extebsion v0.0.160), which looks a bit strange as here it is part of a module name and not a keyword.

Yaël Dillies (Jun 17 2024 at 20:20):

It is also highlighted differently here on Zulip!

Michael Stoll (Jun 17 2024 at 20:21):

But the highlighting is VSCode is supposed to be smart...

Yaël Dillies (Jun 17 2024 at 20:22):

Just to clarify, all I am saying is that the bug is also present in the pygments version that Zulip uses

Eric Wieser (Jun 17 2024 at 20:38):

Vscode highlights are dumb + smart

Eric Wieser (Jun 17 2024 at 20:39):

If the smart layer doesn't have anything to say, the dumb layer wins

Patrick Massot (Jun 17 2024 at 20:50):

Here it is clearly the regex based dumb stuff speaking.

Eric Wieser (Jun 17 2024 at 20:51):

Yes, in this case we should teach the dumb highlighter to be smarter (because it's standard syntax and affects Zulip), but in some cases of custom syntax the only reasonable thing to do is to teach the smart stuff to be more talkative

Eric Wieser (Jun 17 2024 at 20:52):

I don't know if the semantic highlighting can say "this is regular text"

Julian Berman (Jun 17 2024 at 21:20):

In lean.nvim the dumb highlighting we have gets this right, mostly because we tell it . is an identifier character. Perhaps "just" doing something similar in VSCode is the fix (e.g. adding a lookbehind perhaps to Type?)


Last updated: May 02 2025 at 03:31 UTC