mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-27 12:54:42 +00:00
Start on syntax organization
This commit is contained in:
parent
161373710c
commit
6cb35536b3
1 changed files with 64 additions and 54 deletions
|
@ -109,23 +109,27 @@ export interface SyntaxHighlightStyle {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Syntax {
|
export interface Syntax {
|
||||||
// == Text Styles
|
// == Text Styles ====== /
|
||||||
|
comment: SyntaxHighlightStyle
|
||||||
|
// elixir: doc comment
|
||||||
|
"comment.doc": SyntaxHighlightStyle,
|
||||||
primary: SyntaxHighlightStyle
|
primary: SyntaxHighlightStyle
|
||||||
predictive: SyntaxHighlightStyle
|
predictive: SyntaxHighlightStyle
|
||||||
|
|
||||||
|
// === Formatted Text ====== /
|
||||||
emphasis: SyntaxHighlightStyle
|
emphasis: SyntaxHighlightStyle
|
||||||
"emphasis.strong": SyntaxHighlightStyle
|
"emphasis.strong": SyntaxHighlightStyle
|
||||||
title: SyntaxHighlightStyle
|
title: SyntaxHighlightStyle
|
||||||
linkUri: SyntaxHighlightStyle
|
linkUri: SyntaxHighlightStyle
|
||||||
linkText: SyntaxHighlightStyle
|
linkText: SyntaxHighlightStyle
|
||||||
|
// md: indented_code_block, fenced_code_block, code_span
|
||||||
|
"text.literal": SyntaxHighlightStyle
|
||||||
|
|
||||||
// == General
|
// == Punctuation ====== /
|
||||||
comment: SyntaxHighlightStyle
|
|
||||||
|
|
||||||
// == Punctuation
|
|
||||||
punctuation: SyntaxHighlightStyle
|
punctuation: SyntaxHighlightStyle
|
||||||
/** (, [, {...*/
|
/** Example: `(`, `[`, `{`...*/
|
||||||
"punctuation.bracket": SyntaxHighlightStyle,
|
"punctuation.bracket": SyntaxHighlightStyle,
|
||||||
// ., ;
|
/**., ;*/
|
||||||
"punctuation.delimiter": SyntaxHighlightStyle,
|
"punctuation.delimiter": SyntaxHighlightStyle,
|
||||||
// js, ts: ${, } in a template literal
|
// js, ts: ${, } in a template literal
|
||||||
// yaml: *, &, ---, ...
|
// yaml: *, &, ---, ...
|
||||||
|
@ -133,35 +137,9 @@ export interface Syntax {
|
||||||
// md: list_marker_plus, list_marker_dot, etc
|
// md: list_marker_plus, list_marker_dot, etc
|
||||||
"punctuation.list_marker": SyntaxHighlightStyle
|
"punctuation.list_marker": SyntaxHighlightStyle
|
||||||
|
|
||||||
// this, ...
|
// == Strings ====== /
|
||||||
// css: -- (var(--foo))
|
|
||||||
// lua: self
|
|
||||||
"variable.special": SyntaxHighlightStyle
|
|
||||||
// true, false, null, nullptr
|
|
||||||
constant: SyntaxHighlightStyle
|
|
||||||
// css: @media, @import, @supports...
|
|
||||||
// js: declare, implements, interface, keyof, public...
|
|
||||||
keyword: SyntaxHighlightStyle
|
|
||||||
function: SyntaxHighlightStyle
|
|
||||||
type: SyntaxHighlightStyle
|
|
||||||
constructor: SyntaxHighlightStyle
|
|
||||||
variant: SyntaxHighlightStyle
|
|
||||||
// css: class_name, property_name, namespace_name...
|
|
||||||
property: SyntaxHighlightStyle
|
|
||||||
// note: js enum is currently defined as a keyword
|
|
||||||
enum: SyntaxHighlightStyle
|
|
||||||
// -, --, ->, !=, &&, ||, <=...
|
|
||||||
operator: SyntaxHighlightStyle
|
|
||||||
string: SyntaxHighlightStyle
|
|
||||||
number: SyntaxHighlightStyle
|
|
||||||
boolean: SyntaxHighlightStyle
|
|
||||||
|
|
||||||
// c: statement_identifier,
|
string: SyntaxHighlightStyle
|
||||||
label: SyntaxHighlightStyle,
|
|
||||||
// css: tag_name, nesting_selector, universal_selector...
|
|
||||||
tag: SyntaxHighlightStyle,
|
|
||||||
// css: attribute, pseudo_element_selector (tag_name),
|
|
||||||
attribute: SyntaxHighlightStyle,
|
|
||||||
// css: color_value
|
// css: color_value
|
||||||
// js: this, super
|
// js: this, super
|
||||||
// racket: regex
|
// racket: regex
|
||||||
|
@ -176,36 +154,68 @@ export interface Syntax {
|
||||||
"string.escape": SyntaxHighlightStyle,
|
"string.escape": SyntaxHighlightStyle,
|
||||||
// Regular expressions
|
// Regular expressions
|
||||||
"string.regex": SyntaxHighlightStyle,
|
"string.regex": SyntaxHighlightStyle,
|
||||||
// elixir: doc comment
|
|
||||||
"comment.doc": SyntaxHighlightStyle,
|
// == Types ====== /
|
||||||
|
constructor: SyntaxHighlightStyle
|
||||||
|
variant: SyntaxHighlightStyle
|
||||||
|
type: SyntaxHighlightStyle
|
||||||
// js: predefined_type
|
// js: predefined_type
|
||||||
"type.builtin": SyntaxHighlightStyle,
|
"type.builtin": SyntaxHighlightStyle,
|
||||||
// elixir, python: interpolation (ex: foo in ${foo})
|
|
||||||
// js: template_substitution
|
// == Values
|
||||||
embedded: SyntaxHighlightStyle,
|
|
||||||
|
// racket: lang_name
|
||||||
|
"variable.builtin": SyntaxHighlightStyle
|
||||||
|
// this, ...
|
||||||
|
// css: -- (var(--foo))
|
||||||
|
// lua: self
|
||||||
|
"variable.special": SyntaxHighlightStyle
|
||||||
|
// c: statement_identifier,
|
||||||
|
label: SyntaxHighlightStyle,
|
||||||
|
// css: tag_name, nesting_selector, universal_selector...
|
||||||
|
tag: SyntaxHighlightStyle,
|
||||||
|
// css: attribute, pseudo_element_selector (tag_name),
|
||||||
|
attribute: SyntaxHighlightStyle,
|
||||||
|
// css: class_name, property_name, namespace_name...
|
||||||
|
property: SyntaxHighlightStyle
|
||||||
|
// true, false, null, nullptr
|
||||||
|
constant: SyntaxHighlightStyle
|
||||||
|
// css: @media, @import, @supports...
|
||||||
|
// js: declare, implements, interface, keyof, public...
|
||||||
|
keyword: SyntaxHighlightStyle
|
||||||
|
// note: js enum is currently defined as a keyword
|
||||||
|
enum: SyntaxHighlightStyle
|
||||||
|
// -, --, ->, !=, &&, ||, <=...
|
||||||
|
operator: SyntaxHighlightStyle
|
||||||
|
number: SyntaxHighlightStyle
|
||||||
|
boolean: SyntaxHighlightStyle
|
||||||
// elixir: __MODULE__, __DIR__, __ENV__, etc
|
// elixir: __MODULE__, __DIR__, __ENV__, etc
|
||||||
// go: nil, iota
|
// go: nil, iota
|
||||||
"constant.builtin": SyntaxHighlightStyle,
|
"constant.builtin": SyntaxHighlightStyle,
|
||||||
// go: call_expression, method_declaration
|
|
||||||
// js: call_expression, method_definition, pair (key, arrow function)
|
// == Functions ====== /
|
||||||
"function.method": SyntaxHighlightStyle,
|
|
||||||
// ruby: identifier/"defined?" // Nate note: I don't fully understand this one.
|
function: SyntaxHighlightStyle
|
||||||
"function.method.builtin": SyntaxHighlightStyle
|
|
||||||
// lua: function_call
|
|
||||||
"function.call": SyntaxHighlightStyle
|
|
||||||
// lua: assert, error, loadfile, tostring, unpack...
|
// lua: assert, error, loadfile, tostring, unpack...
|
||||||
"function.builtin": SyntaxHighlightStyle
|
"function.builtin": SyntaxHighlightStyle
|
||||||
// lua: hash_bang_line
|
// lua: function_call
|
||||||
preproc: SyntaxHighlightStyle
|
"function.call": SyntaxHighlightStyle
|
||||||
|
// go: call_expression, method_declaration
|
||||||
// md: indented_code_block, fenced_code_block, code_span
|
// js: call_expression, method_definition, pair (key, arrow function)
|
||||||
"text.literal": SyntaxHighlightStyle
|
|
||||||
// racket: lang_name
|
|
||||||
"variable.builtin": SyntaxHighlightStyle
|
|
||||||
// rust: function_item name: (identifier)
|
// rust: function_item name: (identifier)
|
||||||
"function.definition": SyntaxHighlightStyle
|
"function.definition": SyntaxHighlightStyle
|
||||||
// rust: macro_definition name: (identifier)
|
// rust: macro_definition name: (identifier)
|
||||||
"function.special.definition": SyntaxHighlightStyle
|
"function.special.definition": SyntaxHighlightStyle
|
||||||
|
"function.method": SyntaxHighlightStyle,
|
||||||
|
// ruby: identifier/"defined?" // Nate note: I don't fully understand this one.
|
||||||
|
"function.method.builtin": SyntaxHighlightStyle
|
||||||
|
|
||||||
|
// == Unsorted ====== /
|
||||||
|
// lua: hash_bang_line
|
||||||
|
preproc: SyntaxHighlightStyle
|
||||||
|
// elixir, python: interpolation (ex: foo in ${foo})
|
||||||
|
// js: template_substitution
|
||||||
|
embedded: SyntaxHighlightStyle,
|
||||||
}
|
}
|
||||||
|
|
||||||
// HACK: "constructor" as a key in the syntax interface returns an error when a theme tries to use it.
|
// HACK: "constructor" as a key in the syntax interface returns an error when a theme tries to use it.
|
||||||
|
|
Loading…
Reference in a new issue