Skip to content

Conversation

@tecosaur
Copy link
Member

@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
Member 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
Member 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?

@KristofferC KristofferC deleted the branch JuliaLang:backports-release-1.12 June 4, 2025 11:48
@KristofferC KristofferC closed this Jun 4, 2025
@KristofferC
Copy link
Member

Did this ever get in or was it just closed when the backport branch got merged?

@tecosaur
Copy link
Member Author

tecosaur commented Jul 1, 2025

Looks like this PR was just closed by the targeted backport branch being deleted. I'll put up a new PR with the fixed char highlighting in the next few days.

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.

6 participants