Skip to content
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

feature: improve highlighting for punctuation before property name #161

Merged
merged 2 commits into from
Oct 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/tokenizeCss.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,9 @@ export const tokenizeLine = (line, lineState) => {
token = TokenType.Punctuation
state = State.TopLevelContent
stack.push(State.InsideSelector)
} else if ((next = part.match(RE_PUNCTUATION))) {
token = TokenType.Punctuation
state = State.InsideSelector
} else if ((next = part.match(RE_ANYTHING_UNTIL_CLOSE_BRACE))) {
token = TokenType.Unknown
state = State.InsideSelector
Expand Down
3 changes: 3 additions & 0 deletions test/baselines/css-zen-gardencontent.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ NewLine
NewLine
Comment
NewLine
Punctuation
CssPropertyName
Whitespace
Unknown
NewLine
Whitespace
Expand Down
3 changes: 3 additions & 0 deletions test/baselines/devtools-frontend-inspectorsyntaxhighlight.txt
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,9 @@ Punctuation
NewLine
NewLine
Whitespace
Punctuation
CssPropertyName
Whitespace
Unknown
NewLine
Whitespace
Expand Down
3 changes: 3 additions & 0 deletions test/baselines/devtools-frontend-lockicon.txt
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,9 @@ Punctuation
NewLine
NewLine
Whitespace
Punctuation
CssPropertyName
Whitespace
Unknown
NewLine
Whitespace
Expand Down
9 changes: 9 additions & 0 deletions test/baselines/devtools-frontend-stylessidebarpane.txt
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,9 @@ Punctuation
NewLine
NewLine
Whitespace
Punctuation
CssPropertyName
Whitespace
Unknown
NewLine
Whitespace
Expand Down Expand Up @@ -1364,9 +1367,15 @@ Punctuation
NewLine
NewLine
Whitespace
Punctuation
CssPropertyName
Whitespace
Unknown
NewLine
Whitespace
Punctuation
CssPropertyName
Whitespace
Unknown
NewLine
Whitespace
Expand Down
14 changes: 14 additions & 0 deletions test/baselines/property-dot.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CssSelector
Whitespace
Punctuation
NewLine
Whitespace
Punctuation
CssPropertyName
Punctuation
Whitespace
Numeric
CssPropertyValue
Punctuation
NewLine
Punctuation
3 changes: 3 additions & 0 deletions test/cases/property-dot.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
h1 {
.font-size: 24px;
}