Merge pull request #441 from nguerrera/tuple-syntax-highlighting

Handle tuple expressions in syntax highlighting
This commit is contained in:
Nick Guerrera 2021-04-10 11:01:00 -07:00 коммит произвёл GitHub
Родитель 164f4561b3 a14b5f62cc
Коммит ca79ff5e51
1 изменённых файлов: 13 добавлений и 4 удалений

Просмотреть файл

@ -126,7 +126,7 @@ const decorator: BeginEndRule = {
};
const identifierExpression: MatchRule = {
key: "type-name",
key: "identifier-expression",
scope: "entity.name.type.adl",
match: identifier,
};
@ -139,6 +139,14 @@ const typeArguments: BeginEndRule = {
patterns: [expression],
};
const tupleExpression: BeginEndRule = {
key: "tuple-expression",
scope: meta,
begin: "\\[",
end: "\\]",
patterns: [expression],
};
const typeAnnotation: BeginEndRule = {
key: "type-annotation",
scope: meta,
@ -291,13 +299,14 @@ const usingStatement: BeginEndRule = {
// NOTE: We don't actually classify all the different expression types and their
// punctuation yet. For now, at least, we only deal with the ones that would
// break coloring due to breaking out of context inappropriately with parens/
// braces/angle brackets that weren't handled with appropriate precedence. The
// other expressions color acceptably as unclassified punctuation around those
// we do handle here.
// braces/brackets that weren't handled with appropriate precedence. The other
// expressions color acceptably as unclassified punctuation around those we do
// handle here.
expression.patterns = [
token,
parenthesizedExpression,
typeArguments,
tupleExpression,
modelExpression,
identifierExpression,
];