Merge branch 'main' into quinn/nix
This commit is contained in:
commit
b5630eb901
15 changed files with 520 additions and 73 deletions
11
crates/zed/src/languages/elm/config.toml
Normal file
11
crates/zed/src/languages/elm/config.toml
Normal file
|
@ -0,0 +1,11 @@
|
|||
name = "Elm"
|
||||
path_suffixes = ["elm"]
|
||||
line_comment = "-- "
|
||||
block_comment = ["{- ", " -}"]
|
||||
brackets = [
|
||||
{ start = "{", end = "}", close = true, newline = true },
|
||||
{ start = "[", end = "]", close = true, newline = true },
|
||||
{ start = "(", end = ")", close = true, newline = true },
|
||||
{ start = "\"", end = "\"", close = true, newline = false, not_in = ["string"] },
|
||||
{ start = "'", end = "'", close = true, newline = false, not_in = ["string", "comment"] },
|
||||
]
|
72
crates/zed/src/languages/elm/highlights.scm
Normal file
72
crates/zed/src/languages/elm/highlights.scm
Normal file
|
@ -0,0 +1,72 @@
|
|||
[
|
||||
"if"
|
||||
"then"
|
||||
"else"
|
||||
"let"
|
||||
"in"
|
||||
(case)
|
||||
(of)
|
||||
(backslash)
|
||||
(as)
|
||||
(port)
|
||||
(exposing)
|
||||
(alias)
|
||||
(import)
|
||||
(module)
|
||||
(type)
|
||||
(arrow)
|
||||
] @keyword
|
||||
|
||||
[
|
||||
(eq)
|
||||
(operator_identifier)
|
||||
(colon)
|
||||
] @operator
|
||||
|
||||
(type_annotation(lower_case_identifier) @function)
|
||||
(port_annotation(lower_case_identifier) @function)
|
||||
(function_declaration_left(lower_case_identifier) @function.definition)
|
||||
|
||||
(function_call_expr
|
||||
target: (value_expr
|
||||
name: (value_qid (lower_case_identifier) @function)))
|
||||
|
||||
(exposed_value(lower_case_identifier) @function)
|
||||
(exposed_type(upper_case_identifier) @type)
|
||||
|
||||
(field_access_expr(value_expr(value_qid)) @identifier)
|
||||
(lower_pattern) @variable
|
||||
(record_base_identifier) @identifier
|
||||
|
||||
[
|
||||
"("
|
||||
")"
|
||||
] @punctuation.bracket
|
||||
|
||||
[
|
||||
"|"
|
||||
","
|
||||
] @punctuation.delimiter
|
||||
|
||||
(number_constant_expr) @constant
|
||||
|
||||
(type_declaration(upper_case_identifier) @type)
|
||||
(type_ref) @type
|
||||
(type_alias_declaration name: (upper_case_identifier) @type)
|
||||
|
||||
(value_expr(upper_case_qid(upper_case_identifier)) @type)
|
||||
|
||||
[
|
||||
(line_comment)
|
||||
(block_comment)
|
||||
] @comment
|
||||
|
||||
(string_escape) @string.escape
|
||||
|
||||
[
|
||||
(open_quote)
|
||||
(close_quote)
|
||||
(regular_string_part)
|
||||
(open_char)
|
||||
(close_char)
|
||||
] @string
|
2
crates/zed/src/languages/elm/injections.scm
Normal file
2
crates/zed/src/languages/elm/injections.scm
Normal file
|
@ -0,0 +1,2 @@
|
|||
((glsl_content) @content
|
||||
(#set! "language" "glsl"))
|
22
crates/zed/src/languages/elm/outline.scm
Normal file
22
crates/zed/src/languages/elm/outline.scm
Normal file
|
@ -0,0 +1,22 @@
|
|||
(type_declaration
|
||||
(type) @context
|
||||
(upper_case_identifier) @name) @item
|
||||
|
||||
(type_alias_declaration
|
||||
(type) @context
|
||||
(alias) @context
|
||||
name: (upper_case_identifier) @name) @item
|
||||
|
||||
(type_alias_declaration
|
||||
typeExpression:
|
||||
(type_expression
|
||||
part: (record_type
|
||||
(field_type
|
||||
name: (lower_case_identifier) @name) @item)))
|
||||
|
||||
(union_variant
|
||||
name: (upper_case_identifier) @name) @item
|
||||
|
||||
(value_declaration
|
||||
functionDeclarationLeft:
|
||||
(function_declaration_left(lower_case_identifier) @name)) @item
|
9
crates/zed/src/languages/glsl/config.toml
Normal file
9
crates/zed/src/languages/glsl/config.toml
Normal file
|
@ -0,0 +1,9 @@
|
|||
name = "GLSL"
|
||||
path_suffixes = ["vert", "frag", "tesc", "tese", "geom", "comp"]
|
||||
line_comment = "// "
|
||||
block_comment = ["/* ", " */"]
|
||||
brackets = [
|
||||
{ start = "{", end = "}", close = true, newline = true },
|
||||
{ start = "[", end = "]", close = true, newline = true },
|
||||
{ start = "(", end = ")", close = true, newline = true },
|
||||
]
|
118
crates/zed/src/languages/glsl/highlights.scm
Normal file
118
crates/zed/src/languages/glsl/highlights.scm
Normal file
|
@ -0,0 +1,118 @@
|
|||
"break" @keyword
|
||||
"case" @keyword
|
||||
"const" @keyword
|
||||
"continue" @keyword
|
||||
"default" @keyword
|
||||
"do" @keyword
|
||||
"else" @keyword
|
||||
"enum" @keyword
|
||||
"extern" @keyword
|
||||
"for" @keyword
|
||||
"if" @keyword
|
||||
"inline" @keyword
|
||||
"return" @keyword
|
||||
"sizeof" @keyword
|
||||
"static" @keyword
|
||||
"struct" @keyword
|
||||
"switch" @keyword
|
||||
"typedef" @keyword
|
||||
"union" @keyword
|
||||
"volatile" @keyword
|
||||
"while" @keyword
|
||||
|
||||
"#define" @keyword
|
||||
"#elif" @keyword
|
||||
"#else" @keyword
|
||||
"#endif" @keyword
|
||||
"#if" @keyword
|
||||
"#ifdef" @keyword
|
||||
"#ifndef" @keyword
|
||||
"#include" @keyword
|
||||
(preproc_directive) @keyword
|
||||
|
||||
"--" @operator
|
||||
"-" @operator
|
||||
"-=" @operator
|
||||
"->" @operator
|
||||
"=" @operator
|
||||
"!=" @operator
|
||||
"*" @operator
|
||||
"&" @operator
|
||||
"&&" @operator
|
||||
"+" @operator
|
||||
"++" @operator
|
||||
"+=" @operator
|
||||
"<" @operator
|
||||
"==" @operator
|
||||
">" @operator
|
||||
"||" @operator
|
||||
|
||||
"." @delimiter
|
||||
";" @delimiter
|
||||
|
||||
(string_literal) @string
|
||||
(system_lib_string) @string
|
||||
|
||||
(null) @constant
|
||||
(number_literal) @number
|
||||
(char_literal) @number
|
||||
|
||||
(call_expression
|
||||
function: (identifier) @function)
|
||||
(call_expression
|
||||
function: (field_expression
|
||||
field: (field_identifier) @function))
|
||||
(function_declarator
|
||||
declarator: (identifier) @function)
|
||||
(preproc_function_def
|
||||
name: (identifier) @function.special)
|
||||
|
||||
(field_identifier) @property
|
||||
(statement_identifier) @label
|
||||
(type_identifier) @type
|
||||
(primitive_type) @type
|
||||
(sized_type_specifier) @type
|
||||
|
||||
((identifier) @constant
|
||||
(#match? @constant "^[A-Z][A-Z\\d_]*$"))
|
||||
|
||||
(identifier) @variable
|
||||
|
||||
(comment) @comment
|
||||
; inherits: c
|
||||
|
||||
[
|
||||
"in"
|
||||
"out"
|
||||
"inout"
|
||||
"uniform"
|
||||
"shared"
|
||||
"layout"
|
||||
"attribute"
|
||||
"varying"
|
||||
"buffer"
|
||||
"coherent"
|
||||
"readonly"
|
||||
"writeonly"
|
||||
"precision"
|
||||
"highp"
|
||||
"mediump"
|
||||
"lowp"
|
||||
"centroid"
|
||||
"sample"
|
||||
"patch"
|
||||
"smooth"
|
||||
"flat"
|
||||
"noperspective"
|
||||
"invariant"
|
||||
"precise"
|
||||
] @type.qualifier
|
||||
|
||||
"subroutine" @keyword.function
|
||||
|
||||
(extension_storage_class) @storageclass
|
||||
|
||||
(
|
||||
(identifier) @variable.builtin
|
||||
(#match? @variable.builtin "^gl_")
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue