diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index a43a837d1..f707cb7f2 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -80,7 +80,7 @@ ecma (queries only)[^ecma] | unstable | `HFIJL` | | @steelsojka [facility](https://github.com/FacilityApi/tree-sitter-facility) | unstable | `HFIJ ` | | @bryankenote [faust](https://github.com/khiner/tree-sitter-faust) | unstable | `H  J ` | | @khiner [fennel](https://github.com/alexmozaidze/tree-sitter-fennel) | unstable | `HF JL` | | @alexmozaidze -[fga](https://github.com/matoous/tree-sitter-fga) | unstable | `H    ` | | @matoous +[fga](https://github.com/matoous/tree-sitter-fga) | unstable | `H  J ` | | @matoous [fidl](https://github.com/google/tree-sitter-fidl) | unstable | `HF J ` | | @chaopeng [firrtl](https://github.com/tree-sitter-grammars/tree-sitter-firrtl) | unstable | `HFIJL` | | @amaanq [fish](https://github.com/ram02z/tree-sitter-fish) | unstable | `HFIJL` | | @ram02z diff --git a/runtime/queries/fga/highlights.scm b/runtime/queries/fga/highlights.scm index e420c6c9d..aac8ff291 100644 --- a/runtime/queries/fga/highlights.scm +++ b/runtime/queries/fga/highlights.scm @@ -6,7 +6,8 @@ field: (identifier) @function.method)) ((type_identifier) @type.builtin - (#match? @type.builtin "^(string|int|map|uint|list|timestamp|bool|duration|double|ipaddress)$")) + (#any-of? @type.builtin + "string" "int" "map" "uint" "list" "timestamp" "bool" "duration" "double" "ipaddress")) (condition_declaration name: (identifier) @function) @@ -14,6 +15,17 @@ (version) @number [ + "(" + ")" + "[" + "]" +] @punctuation.bracket + +[ + "+" + "-" + "|" + "^" "*" "/" "%" @@ -21,25 +33,18 @@ "<<" "&" "&^" -] @operator - -[ - "+" - "-" - "|" - "^" -] @operator +] @keyword.operator [ "or" "and" "but not" -] @operator +] @keyword.operator [ "model" + "module" "schema" - "type" "relations" "define" "from" @@ -47,4 +52,6 @@ "condition" @keyword.function +"type" @keyword.operator + (comment) @comment diff --git a/runtime/queries/fga/injections.scm b/runtime/queries/fga/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/fga/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment"))