Skip to content

Much more conservative highlighting for 1.12 #58408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: backports-release-1.12
Choose a base branch
from

Conversation

tecosaur
Copy link
Contributor

@tecosaur tecosaur commented May 13, 2025

Following a few vigorous complaints about the highlighting scheme introduced by JuliaSyntaxHighlighting, I've pared back the default behaviour to something much more conservative. Now the only highlighting applied is:

  • keywords (red)
  • strings/char (green)
  • comments (grey)
Old behaviour (1.11)

image

Nightly behaviour

image

Behaviour here

image

Following a few vigorous complaints about the highlighting scheme
introduced by JuliaSyntaxHighlighting, I've pared back the default
behaviour to something much more conservative.
@tecosaur tecosaur added display and printing Aesthetics and correctness of printed representations of objects. markdown labels May 13, 2025
@tecosaur tecosaur force-pushed the less-highlighting-for-1.12 branch from 3881b92 to 9a46bf5 Compare May 13, 2025 17:33
@christiangnrd
Copy link
Contributor

I think this is an improvement over both 1.11 and current 1.12 behaviour.

@topolarity
Copy link
Member

topolarity commented May 13, 2025

Is it possible to keep just the type-highlighting? Specifically in this part:

ncodeunits(s::AbstractString) -> Int

but not in the general code examples (i.e. only the documented signatures)

@tecosaur
Copy link
Contributor Author

Is it possible to keep just the type-highlighting? Specifically in this part

Hmmm, it's possible but not particularly easily I'm afraid. I think we'd need to implement a new inferred code block "language" like julia-signature and then modify the way that highlighting is applied to it.

@JeffBezanson
Copy link
Member

Is JuliaSyntaxHighlighting converting the :: for return type declaration to ->? I do prefer using the native syntax for this.

@mcabbott
Copy link
Contributor

mcabbott commented May 14, 2025

Note that both the nightly and PR examples above have weird colours for chars:
Screenshot 2025-05-14 at 18 15 23

I'm not so sure that colouring strings & chars adds much.

It would be better to find a docstring which uses some keywords, and has some comments. Comments seem like the obvious first thing to treat specially. (Edit: I can't see how to try this out -- the PR does not contain the changes. But docstring for view has comments.)

@JeffBezanson
Copy link
Member

Yeah that's not ok. If that can't be sorted out we'll have to drop coloring of chars and strings.

@christiangnrd
Copy link
Contributor

christiangnrd commented May 14, 2025

Is JuliaSyntaxHighlighting converting the :: for return type declaration to ->? I do prefer using the native syntax for this.

That came from #57012

@tecosaur
Copy link
Contributor Author

Note that both the nightly and PR examples above have weird colours for chars:

Urgh, when did that start happening? Good catch, I'll look into it…

@JeffBezanson
Copy link
Member

Is JuliaSyntaxHighlighting converting the :: for return type declaration to ->? I do prefer using the native syntax for this.

That came from #57012

Ah. Should that be backported?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
display and printing Aesthetics and correctness of printed representations of objects. markdown
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants