Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
Merge pull request #238 from atom/revert-234-dsifford-patch-1
Browse files Browse the repository at this point in the history
Revert "fix broken highlighting for properties sharing selector names"
  • Loading branch information
Wliu authored Oct 26, 2017
2 parents 759eacc + a07688b commit d4e2aaf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 36 deletions.
17 changes: 4 additions & 13 deletions grammars/scss.cson
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
{
'include': '#rules'
}
{
'include': '#selectors'
}
{
'include': '#property_list'
}
Expand Down Expand Up @@ -420,9 +417,6 @@
{
'include': '#rules'
}
{
'include': "#selectors"
}
]
}
]
Expand Down Expand Up @@ -979,7 +973,7 @@
'properties':
'patterns': [
{
'begin': '(?<![-a-z])(?!--)(?=[-a-z])'
'begin': '(?<![-a-z])(?=[-a-z])'
'end': '$|(?![-a-z])'
'name': 'meta.property-name.scss'
'patterns': [
Expand Down Expand Up @@ -1028,15 +1022,9 @@
{
'include': '#rules'
}
{
'include': '#selector_custom'
}
{
'include': '#properties'
}
{
'include': 'selectors'
}
{
'include': '$self'
}
Expand Down Expand Up @@ -1119,6 +1107,9 @@
{
'include': '#at_rule_media'
}
{
'include': '#selectors'
}
]
'selector_attribute':
'match': '''(?xi)
Expand Down
24 changes: 1 addition & 23 deletions spec/scss-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ describe 'SCSS grammar', ->
expect(tokens[32]).toEqual value: ')', scopes: ['source.css.scss', 'meta.property-list.scss', 'meta.property-value.scss', 'punctuation.definition.end.bracket.round.scss']

describe 'property names with a prefix that matches an element name', ->
it 'does not confuse them with selectors', ->
it 'does not confuse them with properties', ->
tokens = grammar.tokenizeLines '''
text {
text-align: center;
Expand All @@ -396,28 +396,6 @@ describe 'SCSS grammar', ->
expect(tokens[1][3]).toEqual value: ' ', scopes: ['source.css.scss', 'meta.property-list.scss']
expect(tokens[1][4]).toEqual value: 'fixed', scopes: ['source.css.scss', 'meta.property-list.scss', 'meta.property-value.scss', 'support.constant.property-value.css']

describe 'property names that match element names', ->
it 'does not confuse them with selectors', ->
tokens = grammar.tokenizeLines '''
content {
content: 'foo';
}
'''

expect(tokens[0][0]).toEqual value: 'content', scopes: ['source.css.scss', 'entity.name.tag.css']
expect(tokens[0][1]).toEqual value: ' ', scopes: ['source.css.scss']
expect(tokens[0][2]).toEqual value: '{', scopes: ['source.css.scss', 'meta.property-list.scss', 'punctuation.section.property-list.begin.bracket.curly.scss']
expect(tokens[1][0]).toEqual value: ' ', scopes: ['source.css.scss', 'meta.property-list.scss']
expect(tokens[1][1]).toEqual value: 'content', scopes: ['source.css.scss', 'meta.property-list.scss', 'meta.property-name.scss', 'support.type.property-name.css']
expect(tokens[1][2]).toEqual value: ':', scopes: ['source.css.scss', 'meta.property-list.scss', 'punctuation.separator.key-value.scss']
expect(tokens[1][3]).toEqual value: ' ', scopes: ['source.css.scss', 'meta.property-list.scss']
expect(tokens[1][4]).toEqual value: '\'', scopes: ['source.css.scss', 'meta.property-list.scss', 'meta.property-value.scss', 'string.quoted.single.scss', 'punctuation.definition.string.begin.scss']
expect(tokens[1][5]).toEqual value: 'foo', scopes: ['source.css.scss', 'meta.property-list.scss', 'meta.property-value.scss', 'string.quoted.single.scss']
expect(tokens[1][6]).toEqual value: '\'', scopes: ['source.css.scss', 'meta.property-list.scss', 'meta.property-value.scss', 'string.quoted.single.scss', 'punctuation.definition.string.end.scss']
expect(tokens[1][7]).toEqual value: ';', scopes: ['source.css.scss', 'meta.property-list.scss', 'punctuation.terminator.rule.scss']
expect(tokens[1][7]).toEqual value: ';', scopes: ['source.css.scss', 'meta.property-list.scss', 'punctuation.terminator.rule.scss']
expect(tokens[2][0]).toEqual value: '}', scopes: ['source.css.scss', 'meta.property-list.scss', 'punctuation.section.property-list.end.bracket.curly.scss']

describe 'vendor properties', ->
it 'tokenizes the browser prefix', ->
{tokens} = grammar.tokenizeLine 'body { -webkit-box-shadow: none; }'
Expand Down

0 comments on commit d4e2aaf

Please sign in to comment.