Skip to content

Conversation

@Veykril
Copy link
Member

@Veykril Veykril commented Oct 15, 2020

Open question would be the name of the delimiter modifiers. I chose them this was as I see them this way but from what I remember people tend to mix the names however they like. So maybe using delimSquare, delimCurly, delimRound would be better. That would also go well with angle becoming delimAngle?

Closes #6152

}
_ => HighlightTag::Punctuation.into(),
k => match punctuation_modifiers(k) {
Some(modifier) => Highlight::new(HighlightTag::Punctuation) | modifier,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I think we should have Tag::Punctuation(Bracket | Brace ...), abusing modifiers for this at this level feels wrong.

But probably the best way to lower that to lsp in lsp_conv is indeed via modifiers: IIRC, they planned, but didn't ship inheritance for highlight tags. so we can't have punctuation.brace, where both things are tags. But better to double-check this.

@matklad
Copy link
Contributor

matklad commented Oct 20, 2020

Stats: blocked on moving kinds of punctuations to tags: #6238 (comment)

@matklad
Copy link
Contributor

matklad commented Jan 10, 2021

ping @Veykril )

@Veykril
Copy link
Member Author

Veykril commented Jan 10, 2021

Kind of forgot about this PR 😅 This should be what you had in mind I believe right?

@Veykril Veykril changed the title Add semantic highlighting modifiers for punctuations Split punctuation semantic highlighting up into more tags Jan 10, 2021
Copy link
Contributor

@matklad matklad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors r+

@bors
Copy link
Contributor

bors bot commented Jan 10, 2021

@bors bors bot merged commit 77362c7 into rust-lang:master Jan 10, 2021
HlTag::Punctuation(punct) => match punct {
HlPunct::Bracket => "bracket",
HlPunct::Brace => "brace",
HlPunct::Parenthesis => "parentheses",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm.

This is the plural, I think.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I always mix those up

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oof, how do I run the HTML highlighting tests? Even with RUN_SLOW_TEST=1 cargo test nothing fails after changing that line.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never mind, saving the changed files is a good idea 😄.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add semantic token modifiers for punctuation

3 participants