aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries/fsharp/highlights.scm
diff options
context:
space:
mode:
authorkaashyapan2023-07-15 20:58:17 +0000
committerGitHub2023-07-15 20:58:17 +0000
commit2ace6032e7de46893ee87d1a2ac425b9057fa061 (patch)
tree38734b9491cad58516e92e21db344f8205a18962 /runtime/queries/fsharp/highlights.scm
parent86bf0e00fe2ae70a176fb8fc90749bced8f6d7bd (diff)
Add fsharp language support (#7619)
Diffstat (limited to 'runtime/queries/fsharp/highlights.scm')
-rw-r--r--runtime/queries/fsharp/highlights.scm196
1 files changed, 196 insertions, 0 deletions
diff --git a/runtime/queries/fsharp/highlights.scm b/runtime/queries/fsharp/highlights.scm
new file mode 100644
index 00000000..68b70ba7
--- /dev/null
+++ b/runtime/queries/fsharp/highlights.scm
@@ -0,0 +1,196 @@
+;; ----------------------------------------------------------------------------
+;; Literals and comments
+
+[
+ (line_comment)
+ (block_comment)
+ (block_comment_content)
+] @comment
+
+
+;; ----------------------------------------------------------------------------
+;; Punctuation
+
+[
+ "("
+ ")"
+ "{"
+ "}"
+ "["
+ "]"
+ "[|"
+ "|]"
+ "[<"
+ ">]"
+] @punctuation.bracket
+
+[
+ ","
+ ";"
+] @punctuation.delimiter
+
+[
+ "|"
+ "="
+ ">"
+ "<"
+ "-"
+ "~"
+ (infix_op)
+ (prefix_op)
+ (symbolic_op)
+] @operator
+
+
+
+(attribute) @attribute
+
+[
+ "if"
+ "then"
+ "else"
+ "elif"
+ "when"
+ "match"
+ "match!"
+ "and"
+ "or"
+ "&&"
+ "||"
+ "then"
+] @keyword.control.conditional
+
+[
+ "return"
+ "return!"
+] @keyword.control.return
+
+[
+ "for"
+ "while"
+] @keyword.control.return
+
+
+[
+ "open"
+ "#r"
+ "#load"
+] @keyword.control.import
+
+[
+ "abstract"
+ "delegate"
+ "static"
+ "inline"
+ "internal"
+ "mutable"
+ "override"
+ "private"
+ "public"
+ "rec"
+] @keyword.storage.modifier
+
+[
+ "enum"
+ "let"
+ "let!"
+ "member"
+ "module"
+ "namespace"
+ "type"
+] @keyword.storage
+
+[
+ "as"
+ "assert"
+ "begin"
+ "default"
+ "do"
+ "do!"
+ "done"
+ "downcast"
+ "downto"
+ "end"
+ "event"
+ "field"
+ "finally"
+ "fun"
+ "function"
+ "get"
+ "global"
+ "inherit"
+ "interface"
+ "lazy"
+ "new"
+ "not"
+ "null"
+ "of"
+ "param"
+ "property"
+ "set"
+ "struct"
+ "try"
+ "upcast"
+ "use"
+ "use!"
+ "val"
+ "with"
+ "yield"
+ "yield!"
+] @keyword
+
+[
+ "true"
+ "false"
+ "unit"
+ ] @constant.builtin
+
+[
+ (type)
+ (const)
+] @constant
+
+[
+ (union_type_case)
+ (rules (rule (identifier_pattern)))
+] @type.enum
+
+(fsi_directive_decl (string) @namespace)
+
+[
+ (import_decl (long_identifier))
+ (named_module (long_identifier))
+ (namespace (long_identifier))
+ (named_module
+ name: (long_identifier) )
+ (namespace
+ name: (long_identifier) )
+] @namespace
+
+
+(dot_expression
+ base: (long_identifier_or_op) @variable.other.member
+ field: (long_identifier_or_op) @function)
+
+[
+ ;;(value_declaration_left (identifier_pattern) )
+ (function_declaration_left (identifier) )
+ (call_expression (long_identifier_or_op (long_identifier)))
+ ;;(application_expression (long_identifier_or_op (long_identifier)))
+] @function
+
+[
+ (string)
+ (triple_quoted_string)
+] @string
+
+[
+ (int)
+ (int16)
+ (int32)
+ (int64)
+ (float)
+ (decimal)
+] @constant.numeric
+
+