Moritz Jörg 1 month ago committed by GitHub
commit f5801960c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -3129,7 +3129,7 @@ language-servers = ["fsharp-ls"]
[[grammar]] [[grammar]]
name = "fsharp" name = "fsharp"
source = { git = "https://github.com/kaashyapan/tree-sitter-fsharp", rev = "18da392fd9bd5e79f357abcce13f61f3a15e3951" } source = { git = "https://github.com/ionide/tree-sitter-fsharp", rev = "ed675061da3df4b5a27d1d2e19297abd807268c2" }
[[language]] [[language]]
name = "t32" name = "t32"

@ -4,9 +4,11 @@
[ [
(line_comment) (line_comment)
(block_comment) (block_comment)
(block_comment_content) ] @comment @spell
] @comment
(xml_doc) @comment.doc @spell
(identifier) @variable (#set! "priority" 90)
;; ---------------------------------------------------------------------------- ;; ----------------------------------------------------------------------------
;; Punctuation ;; Punctuation
@ -20,17 +22,19 @@
"]" "]"
"[|" "[|"
"|]" "|]"
; "{|"
; "|}"
"[<" "[<"
">]" ">]"
] @punctuation.bracket ] @punctuation.bracket
[ [
"," ","
";" ";"
"|"
] @punctuation.delimiter ] @punctuation.delimiter
[ [
"|"
"=" "="
">" ">"
"<" "<"
@ -38,11 +42,8 @@
"~" "~"
(infix_op) (infix_op)
(prefix_op) (prefix_op)
(symbolic_op)
] @operator ] @operator
(attribute) @attribute (attribute) @attribute
[ [
@ -53,131 +54,150 @@
"when" "when"
"match" "match"
"match!" "match!"
"and" "then"
"or"
"&&" "&&"
"||" "||"
"then" ] @keyword.conditional
] @keyword.control.conditional
[
"and"
"or"
"not"
"upcast"
"downcast"
] @keyword.operator
[ [
"return" "return"
"return!" "return!"
] @keyword.control.return "yield"
"yield!"
] @keyword.return
[ [
"for" "for"
"while" "while"
] @keyword.control.return "downto"
"to"
] @keyword.repeat
[ [
"open" "open"
"#r" "#r"
"#load" "#load"
] @keyword.control.import ] @keyword.import
[ [
"abstract" "abstract"
"delegate" "delegate"
"static" "static"
"inline" "inline"
"internal"
"mutable" "mutable"
"override" "override"
"private"
"public"
"rec" "rec"
] @keyword.storage.modifier "global"
(access_modifier)
] @keyword.modifier
[ [
"enum"
"let" "let"
"let!" "let!"
"use"
"use!"
"member" "member"
"module" ] @keyword.function
"namespace"
[
"enum"
"type" "type"
] @keyword.storage "inherit"
"interface"
] @keyword.type
[
"try"
"with"
"finally"
] @keyword.exception
[ [
"as" "as"
"assert" "assert"
"begin" "begin"
"end"
"done"
"default" "default"
"do" "do"
"do!" "do!"
"done"
"downcast"
"downto"
"end"
"event" "event"
"field" "field"
"finally"
"fun" "fun"
"function" "function"
"get" "get"
"global" "set"
"inherit"
"interface"
"lazy" "lazy"
"new" "new"
"not"
"null" "null"
"of" "of"
"param" "param"
"property" "property"
"set"
"struct" "struct"
"try"
"upcast"
"use"
"use!"
"val" "val"
"with" "module"
"yield" "namespace"
"yield!"
] @keyword ] @keyword
[ (bool) @boolean
"true"
"false"
"unit"
] @constant.builtin
[ (type) @variable
(type)
(const) (const) @constant
] @constant
(wildcard_pattern) @variable.parameter.builtin
(type_definition (_ (type_name (identifier) @type.definition))) @type
[ [
(union_type_case) (union_type_case)
(rules (rule (identifier_pattern))) (rules (rule (identifier_pattern)))
] @type.enum ] @type
(fsi_directive_decl (string) @namespace) (fsi_directive_decl (string) @module)
[ [
(import_decl (long_identifier)) (import_decl (long_identifier))
(named_module (long_identifier)) (named_module (long_identifier))
(namespace (long_identifier)) (namespace (long_identifier))
(named_module (named_module
name: (long_identifier) ) name: (long_identifier) )
(namespace (namespace
name: (long_identifier) ) name: (long_identifier) )
] @namespace ] @module
(dot_expression (dot_expression
base: (long_identifier_or_op) @variable.other.member base: (_) @variable.member
field: (long_identifier_or_op) @function) field: (long_identifier_or_op) @property)
[ (value_declaration_left (identifier_pattern) @variable)
;;(value_declaration_left (identifier_pattern) )
(function_declaration_left (identifier) ) (function_declaration_left
(call_expression (long_identifier_or_op (long_identifier))) (identifier)* @function
;;(application_expression (long_identifier_or_op (long_identifier))) [
] @function (argument_patterns)
(argument_patterns (long_identifier (identifier)))
] @variable.parameter)
(member_defn
(method_or_prop_defn
(property_or_ident
instance: (identifier) @variable.parameter.builtin
method: (identifier) @variable.member)
args: _ @variable.parameter))
(call_expression (long_identifier_or_op (long_identifier))) @function.method.call
(application_expression (long_identifier_or_op (long_identifier))) @function.call
[ [
(string) (string)
@ -189,8 +209,9 @@
(int16) (int16)
(int32) (int32)
(int64) (int64)
] @number
[
(float) (float)
(decimal) (decimal)
] @constant.numeric ] @number.float

@ -0,0 +1,10 @@
; Comments
((line_comment) @injection.content
(#set! injection.language "comment"))
((block_comment) @injection.content
(#set! injection.language "comment"))
((xml_doc
(xml_doc_content) @injection.content)
(#set! injection.language "comment"))
Loading…
Cancel
Save