From 8677d3fdfaa7e514429dc036fad8b5f14cdadfa0 Mon Sep 17 00:00:00 2001 From: Preston Baxter Date: Tue, 23 Jan 2024 22:41:20 -0600 Subject: [PATCH] Add highlights and language deff --- package.json | 10 +++++++- .../highlight.scm => queries/highlights.scm | 24 +++++-------------- tests/{test.ls => test.logstash} | 0 3 files changed, 15 insertions(+), 19 deletions(-) rename quieries/highlight.scm => queries/highlights.scm (50%) rename tests/{test.ls => test.logstash} (100%) diff --git a/package.json b/package.json index 3eecad8..578ca97 100644 --- a/package.json +++ b/package.json @@ -13,5 +13,13 @@ }, "devDependencies": { "tree-sitter-cli": "^0.20.8" - } + }, + "tree-sitter": [ + { + "scope": "grammar.js", + "file-types": [ + "logstash" + ] + } + ] } diff --git a/quieries/highlight.scm b/queries/highlights.scm similarity index 50% rename from quieries/highlight.scm rename to queries/highlights.scm index 9d8a424..e32cd61 100644 --- a/quieries/highlight.scm +++ b/queries/highlights.scm @@ -4,11 +4,11 @@ "input" "output" "filter" + "if" + "else" + (plugin_name) ] @keyword -((identifier) @keyword - (#match? @keyword "^(private|protected|public)$")) - ; Literals [ @@ -16,36 +16,22 @@ (bareword) ] @string -(regex) @string.special.regex -(escape_sequence) @escape +(regexp) @string.special.regex [ (number) ] @number -[ - (nil) - (true) - (false) -]@constant.builtin - -(interpolation - "%{" @punctuation.special - "}" @punctuation.special) @embedded - (comment) @comment ; Operators [ -"=" "=>" -"->" ] @operator [ "," - ";" "." ] @punctuation.delimiter @@ -57,3 +43,5 @@ "{" "}" ] @punctuation.bracket + +(selector_element) @variable.parameter diff --git a/tests/test.ls b/tests/test.logstash similarity index 100% rename from tests/test.ls rename to tests/test.logstash