"extends" Interface name after newline not highlighted
Closed this issue · 1 comments
roblourens commented
Related to microsoft/vscode#113185, microsoft/vscode#116103
interface Blah
extends Blue {
}
Removing the newline before "extends" fixes it. With the newline, "Blue" has
KapitanOczywisty commented
Confirmed, though It's not related to previous issue. Interface definition is a big mess I'll try to get around to it, but if somebody is interested:
language-php/grammars/php.cson
Lines 17 to 47 in 9b703d8
{ | |
'begin': '(?i)^\\s*(interface)\\s+([a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*)\\s*(extends)?\\s*' | |
'beginCaptures': | |
'1': | |
'name': 'storage.type.interface.php' | |
'2': | |
'name': 'entity.name.type.interface.php' | |
'3': | |
'name': 'storage.modifier.extends.php' | |
'end': '(?i)((?:[a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*\\s*,\\s*)*)([a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*)?\\s*(?:(?={)|$)' | |
'endCaptures': | |
'1': | |
'patterns': [ | |
{ | |
'match': '(?i)[a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*' | |
'name': 'entity.other.inherited-class.php' | |
} | |
{ | |
'match': ',' | |
'name': 'punctuation.separator.classes.php' | |
} | |
] | |
'2': | |
'name': 'entity.other.inherited-class.php' | |
'name': 'meta.interface.php' | |
'patterns': [ | |
{ | |
'include': '#namespace' | |
} | |
] | |
} |
Interface definition should be similar to class
language-php/grammars/php.cson
Lines 206 to 324 in 9b703d8
{ | |
'begin': '''(?ix) | |
(?: | |
\\b(?:(abstract|final)\\s+)?(class)\\s+([a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*) | |
|\\b(new)\\b\\s*(\\#\\[.*\\])?\\s*\\b(class)\\b # anonymous class | |
) | |
''' | |
'beginCaptures': | |
'1': | |
'name': 'storage.modifier.${1:/downcase}.php' | |
'2': | |
'name': 'storage.type.class.php' | |
'3': | |
'name': 'entity.name.type.class.php' | |
'4': | |
'name': 'keyword.other.new.php' | |
'5': | |
'patterns': [ | |
{ | |
'include': '#attribute' | |
} | |
] | |
'6': | |
'name': 'storage.type.class.php' | |
'end': '}|(?=\\?>)' | |
'endCaptures': | |
'0': | |
'name': 'punctuation.definition.class.end.bracket.curly.php' | |
'name': 'meta.class.php' | |
'patterns': [ | |
{ | |
'include': '#comments' | |
} | |
{ | |
'begin': '(?i)(extends)\\s+' | |
'beginCaptures': | |
'1': | |
'name': 'storage.modifier.extends.php' | |
'contentName': 'meta.other.inherited-class.php' | |
'end': '(?i)(?=[^a-z0-9_\\x{7f}-\\x{7fffffff}\\\\])' | |
'patterns': [ | |
{ | |
'begin': '(?i)(?=\\\\?[a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*\\\\)' | |
'end': '(?i)([a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*)?(?=[^a-z0-9_\\x{7f}-\\x{7fffffff}\\\\])' | |
'endCaptures': | |
'1': | |
'name': 'entity.other.inherited-class.php' | |
'patterns': [ | |
{ | |
'include': '#namespace' | |
} | |
] | |
} | |
{ | |
'include': '#class-builtin' | |
} | |
{ | |
'include': '#namespace' | |
} | |
{ | |
'match': '(?i)[a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*' | |
'name': 'entity.other.inherited-class.php' | |
} | |
] | |
} | |
{ | |
'begin': '(?i)(implements)\\s+' | |
'beginCaptures': | |
'1': | |
'name': 'storage.modifier.implements.php' | |
'end': '(?i)(?=[;{])' | |
'patterns': [ | |
{ | |
'include': '#comments' | |
} | |
{ | |
'begin': '(?i)(?=[a-z0-9_\\x{7f}-\\x{7fffffff}\\\\]+)' | |
'contentName': 'meta.other.inherited-class.php' | |
'end': '(?i)(?:\\s*(?:,|(?=[^a-z0-9_\\x{7f}-\\x{7fffffff}\\\\\\s]))\\s*)' | |
'patterns': [ | |
{ | |
'begin': '(?i)(?=\\\\?[a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*\\\\)' | |
'end': '(?i)([a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*)?(?=[^a-z0-9_\\x{7f}-\\x{7fffffff}\\\\])' | |
'endCaptures': | |
'1': | |
'name': 'entity.other.inherited-class.php' | |
'patterns': [ | |
{ | |
'include': '#namespace' | |
} | |
] | |
} | |
{ | |
'include': '#class-builtin' | |
} | |
{ | |
'include': '#namespace' | |
} | |
{ | |
'match': '(?i)[a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*' | |
'name': 'entity.other.inherited-class.php' | |
} | |
] | |
} | |
] | |
} | |
{ | |
'begin': '{' | |
'beginCaptures': | |
'0': | |
'name': 'punctuation.definition.class.begin.bracket.curly.php' | |
'end': '(?=}|\\?>)' | |
'contentName': 'meta.class.body.php' | |
'patterns': [ | |
{ | |
'include': '$self' | |
} | |
] | |
} |