mirror of https://github.com/helix-editor/helix
Merge branch 'master' into cursor-shape-new
commit
b3b4e78585
@ -1 +1 @@
|
||||
Subproject commit 237f4eb4417c28f643a29d795ed227246afb66f9
|
||||
Subproject commit b6ec26f181dd059eedd506fa5fbeae1b8e5556c8
|
@ -0,0 +1 @@
|
||||
Subproject commit a4b9187417d6be349ee5fd4b6e77b4172c6827dd
|
@ -0,0 +1 @@
|
||||
Subproject commit e1cfca3c79896ff79842f057ea13e529b66af636
|
@ -1,2 +1,9 @@
|
||||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
|
||||
((sigil
|
||||
(sigil_name) @_sigil_name
|
||||
(quoted_content) @injection.content)
|
||||
(#match? @_sigil_name "^(r|R)$")
|
||||
(#set! injection.language "regex")
|
||||
(#set! injection.combined))
|
||||
|
@ -1,45 +1,125 @@
|
||||
(variable) @variable
|
||||
(operator) @operator
|
||||
(exp_name (constructor) @constructor)
|
||||
(constructor_operator) @operator
|
||||
(module) @namespace
|
||||
(type) @type
|
||||
(type) @class
|
||||
(constructor) @constructor
|
||||
(pragma) @pragma
|
||||
(comment) @comment
|
||||
(signature name: (variable) @type)
|
||||
(function name: (variable) @function)
|
||||
(constraint class: (class_name (type)) @class)
|
||||
(class (class_head class: (class_name (type)) @class))
|
||||
(instance (instance_head class: (class_name (type)) @class))
|
||||
;; ----------------------------------------------------------------------------
|
||||
;; Literals and comments
|
||||
|
||||
(integer) @constant.numeric.integer
|
||||
(exp_negation) @constant.numeric.integer
|
||||
(exp_literal (float)) @constant.numeric.float
|
||||
(char) @constant.character
|
||||
(con_unit) @literal
|
||||
(con_list) @literal
|
||||
(tycon_arrow) @operator
|
||||
(where) @keyword
|
||||
"module" @keyword
|
||||
"let" @keyword
|
||||
"in" @keyword
|
||||
"class" @keyword
|
||||
"instance" @keyword
|
||||
"data" @keyword
|
||||
"newtype" @keyword
|
||||
"family" @keyword
|
||||
"type" @keyword
|
||||
"import" @keyword
|
||||
"qualified" @keyword
|
||||
"as" @keyword
|
||||
"deriving" @keyword
|
||||
"via" @keyword
|
||||
"stock" @keyword
|
||||
"anyclass" @keyword
|
||||
"do" @keyword
|
||||
"mdo" @keyword
|
||||
"rec" @keyword
|
||||
(string) @string
|
||||
|
||||
(con_unit) @constant.builtin ; unit, as in ()
|
||||
|
||||
(comment) @comment
|
||||
|
||||
|
||||
;; ----------------------------------------------------------------------------
|
||||
;; Punctuation
|
||||
|
||||
[
|
||||
"("
|
||||
")"
|
||||
"{"
|
||||
"}"
|
||||
"["
|
||||
"]"
|
||||
] @punctuation.bracket
|
||||
|
||||
[
|
||||
(comma)
|
||||
";"
|
||||
] @punctuation.delimiter
|
||||
|
||||
|
||||
;; ----------------------------------------------------------------------------
|
||||
;; Keywords, operators, includes
|
||||
|
||||
(pragma) @constant.macro
|
||||
|
||||
[
|
||||
"if"
|
||||
"then"
|
||||
"else"
|
||||
"case"
|
||||
"of"
|
||||
] @keyword.control.conditional
|
||||
|
||||
[
|
||||
"import"
|
||||
"qualified"
|
||||
"module"
|
||||
] @keyword.control.import
|
||||
|
||||
[
|
||||
(operator)
|
||||
(constructor_operator)
|
||||
(type_operator)
|
||||
(tycon_arrow)
|
||||
(qualified_module) ; grabs the `.` (dot), ex: import System.IO
|
||||
(all_names)
|
||||
(wildcard)
|
||||
"="
|
||||
"|"
|
||||
"::"
|
||||
"=>"
|
||||
"->"
|
||||
"<-"
|
||||
"\\"
|
||||
"`"
|
||||
"@"
|
||||
] @operator
|
||||
|
||||
(qualified_module (module) @constructor)
|
||||
(qualified_type (module) @namespace)
|
||||
(qualified_variable (module) @namespace)
|
||||
(import (module) @namespace)
|
||||
|
||||
[
|
||||
(where)
|
||||
"let"
|
||||
"in"
|
||||
"class"
|
||||
"instance"
|
||||
"data"
|
||||
"newtype"
|
||||
"family"
|
||||
"type"
|
||||
"as"
|
||||
"hiding"
|
||||
"deriving"
|
||||
"via"
|
||||
"stock"
|
||||
"anyclass"
|
||||
"do"
|
||||
"mdo"
|
||||
"rec"
|
||||
"forall"
|
||||
"∀"
|
||||
"infix"
|
||||
"infixl"
|
||||
"infixr"
|
||||
] @keyword
|
||||
|
||||
|
||||
;; ----------------------------------------------------------------------------
|
||||
;; Functions and variables
|
||||
|
||||
(signature name: (variable) @type)
|
||||
(function name: (variable) @function)
|
||||
|
||||
(variable) @variable
|
||||
"_" @variable.builtin
|
||||
|
||||
(exp_infix (variable) @operator) ; consider infix functions as operators
|
||||
|
||||
("@" @namespace) ; "as" pattern operator, e.g. x@Constructor
|
||||
|
||||
|
||||
;; ----------------------------------------------------------------------------
|
||||
;; Types
|
||||
|
||||
(type) @type
|
||||
|
||||
(constructor) @constructor
|
||||
|
||||
; True or False
|
||||
((constructor) @_bool (#match? @_bool "(True|False)")) @constant.builtin.boolean
|
||||
|
@ -0,0 +1,170 @@
|
||||
[
|
||||
"("
|
||||
")"
|
||||
"{"
|
||||
"}"
|
||||
] @punctuation.bracket
|
||||
|
||||
[
|
||||
":"
|
||||
"&:"
|
||||
"::"
|
||||
"|"
|
||||
";"
|
||||
"\""
|
||||
"'"
|
||||
","
|
||||
] @punctuation.delimiter
|
||||
|
||||
[
|
||||
"$"
|
||||
"$$"
|
||||
] @punctuation.special
|
||||
|
||||
(automatic_variable
|
||||
[ "@" "%" "<" "?" "^" "+" "/" "*" "D" "F"] @punctuation.special)
|
||||
|
||||
(automatic_variable
|
||||
"/" @error . ["D" "F"])
|
||||
|
||||
[
|
||||
"="
|
||||
":="
|
||||
"::="
|
||||
"?="
|
||||
"+="
|
||||
"!="
|
||||
"@"
|
||||
"-"
|
||||
"+"
|
||||
] @operator
|
||||
|
||||
[
|
||||
(text)
|
||||
(string)
|
||||
(raw_text)
|
||||
] @string
|
||||
|
||||
(variable_assignment (word) @string)
|
||||
|
||||
[
|
||||
"ifeq"
|
||||
"ifneq"
|
||||
"ifdef"
|
||||
"ifndef"
|
||||
"else"
|
||||
"endif"
|
||||
"if"
|
||||
"or" ; boolean functions are conditional in make grammar
|
||||
"and"
|
||||
] @keyword.control.conditional
|
||||
|
||||
"foreach" @keyword.control.repeat
|
||||
|
||||
[
|
||||
"define"
|
||||
"endef"
|
||||
"vpath"
|
||||
"undefine"
|
||||
"export"
|
||||
"unexport"
|
||||
"override"
|
||||
"private"
|
||||
; "load"
|
||||
] @keyword
|
||||
|
||||
[
|
||||
"include"
|
||||
"sinclude"
|
||||
"-include"
|
||||
] @keyword.control.import
|
||||
|
||||
[
|
||||
"subst"
|
||||
"patsubst"
|
||||
"strip"
|
||||
"findstring"
|
||||
"filter"
|
||||
"filter-out"
|
||||
"sort"
|
||||
"word"
|
||||
"words"
|
||||
"wordlist"
|
||||
"firstword"
|
||||
"lastword"
|
||||
"dir"
|
||||
"notdir"
|
||||
"suffix"
|
||||
"basename"
|
||||
"addsuffix"
|
||||
"addprefix"
|
||||
"join"
|
||||
"wildcard"
|
||||
"realpath"
|
||||
"abspath"
|
||||
"call"
|
||||
"eval"
|
||||
"file"
|
||||
"value"
|
||||
"shell"
|
||||
] @keyword.function
|
||||
|
||||
[
|
||||
"error"
|
||||
"warning"
|
||||
"info"
|
||||
] @keyword.control.exception
|
||||
|
||||
;; Variable
|
||||
(variable_assignment
|
||||
name: (word) @variable)
|
||||
|
||||
(variable_reference
|
||||
(word) @variable)
|
||||
|
||||
(comment) @comment
|
||||
|
||||
((word) @clean @string.regexp
|
||||
(#match? @clean "[%\*\?]"))
|
||||
|
||||
(function_call
|
||||
function: "error"
|
||||
(arguments (text) @error))
|
||||
|
||||
(function_call
|
||||
function: "warning"
|
||||
(arguments (text) @warning))
|
||||
|
||||
(function_call
|
||||
function: "info"
|
||||
(arguments (text) @info))
|
||||
|
||||
;; Install Command Categories
|
||||
;; Others special variables
|
||||
;; Variables Used by Implicit Rules
|
||||
[
|
||||
"VPATH"
|
||||
".RECIPEPREFIX"
|
||||
] @constant.builtin
|
||||
|
||||
(variable_assignment
|
||||
name: (word) @clean @constant.builtin
|
||||
(#match? @clean "^(AR|AS|CC|CXX|CPP|FC|M2C|PC|CO|GET|LEX|YACC|LINT|MAKEINFO|TEX|TEXI2DVI|WEAVE|CWEAVE|TANGLE|CTANGLE|RM|ARFLAGS|ASFLAGS|CFLAGS|CXXFLAGS|COFLAGS|CPPFLAGS|FFLAGS|GFLAGS|LDFLAGS|LDLIBS|LFLAGS|YFLAGS|PFLAGS|RFLAGS|LINTFLAGS|PRE_INSTALL|POST_INSTALL|NORMAL_INSTALL|PRE_UNINSTALL|POST_UNINSTALL|NORMAL_UNINSTALL|MAKEFILE_LIST|MAKE_RESTARTS|MAKE_TERMOUT|MAKE_TERMERR|\.DEFAULT_GOAL|\.RECIPEPREFIX|\.EXTRA_PREREQS)$"))
|
||||
|
||||
(variable_reference
|
||||
(word) @clean @constant.builtin
|
||||
(#match? @clean "^(AR|AS|CC|CXX|CPP|FC|M2C|PC|CO|GET|LEX|YACC|LINT|MAKEINFO|TEX|TEXI2DVI|WEAVE|CWEAVE|TANGLE|CTANGLE|RM|ARFLAGS|ASFLAGS|CFLAGS|CXXFLAGS|COFLAGS|CPPFLAGS|FFLAGS|GFLAGS|LDFLAGS|LDLIBS|LFLAGS|YFLAGS|PFLAGS|RFLAGS|LINTFLAGS|PRE_INSTALL|POST_INSTALL|NORMAL_INSTALL|PRE_UNINSTALL|POST_UNINSTALL|NORMAL_UNINSTALL|MAKEFILE_LIST|MAKE_RESTARTS|MAKE_TERMOUT|MAKE_TERMERR|\.DEFAULT_GOAL|\.RECIPEPREFIX|\.EXTRA_PREREQS\.VARIABLES|\.FEATURES|\.INCLUDE_DIRS|\.LOADED)$"))
|
||||
|
||||
;; Standart targets
|
||||
(targets
|
||||
(word) @constant.macro
|
||||
(#match? @constant.macro "^(all|install|install-html|install-dvi|install-pdf|install-ps|uninstall|install-strip|clean|distclean|mostlyclean|maintainer-clean|TAGS|info|dvi|html|pdf|ps|dist|check|installcheck|installdirs)$"))
|
||||
|
||||
(targets
|
||||
(word) @constant.macro
|
||||
(#match? @constant.macro "^(all|install|install-html|install-dvi|install-pdf|install-ps|uninstall|install-strip|clean|distclean|mostlyclean|maintainer-clean|TAGS|info|dvi|html|pdf|ps|dist|check|installcheck|installdirs)$"))
|
||||
|
||||
;; Builtin targets
|
||||
(targets
|
||||
(word) @constant.macro
|
||||
(#match? @constant.macro "^\.(PHONY|SUFFIXES|DEFAULT|PRECIOUS|INTERMEDIATE|SECONDARY|SECONDEXPANSION|DELETE_ON_ERROR|IGNORE|LOW_RESOLUTION_TIME|SILENT|EXPORT_ALL_VARIABLES|NOTPARALLEL|ONESHELL|POSIX)$"))
|
@ -0,0 +1,53 @@
|
||||
; upstream: https://github.com/tree-sitter/tree-sitter-regex/blob/e1cfca3c79896ff79842f057ea13e529b66af636/queries/highlights.scm
|
||||
|
||||
[
|
||||
"("
|
||||
")"
|
||||
"(?"
|
||||
"(?:"
|
||||
"(?<"
|
||||
">"
|
||||
"["
|
||||
"]"
|
||||
"{"
|
||||
"}"
|
||||
] @punctuation.bracket
|
||||
|
||||
[
|
||||
"*"
|
||||
"+"
|
||||
"|"
|
||||
"="
|
||||
"<="
|
||||
"!"
|
||||
"<!"
|
||||
"?"
|
||||
] @operator
|
||||
|
||||
[
|
||||
(identity_escape)
|
||||
(control_letter_escape)
|
||||
(character_class_escape)
|
||||
(control_escape)
|
||||
(start_assertion)
|
||||
(end_assertion)
|
||||
(boundary_assertion)
|
||||
(non_boundary_assertion)
|
||||
] @constant.character.escape
|
||||
|
||||
(group_name) @property
|
||||
|
||||
(count_quantifier
|
||||
[
|
||||
(decimal_digits) @constant.numeric
|
||||
"," @punctuation.delimiter
|
||||
])
|
||||
|
||||
(character_class
|
||||
[
|
||||
"^" @operator
|
||||
(class_range "-" @operator)
|
||||
])
|
||||
|
||||
(class_character) @constant.character
|
||||
(pattern_character) @string
|
Loading…
Reference in New Issue