From a45a349452cb5e5d543cd89cd4bc6ffb484a74cc Mon Sep 17 00:00:00 2001 From: Tudyx <56633664+Tudyx@users.noreply.github.com> Date: Sun, 26 Nov 2023 12:16:21 +0100 Subject: [PATCH 1/2] add log tree-sitter --- book/src/generated/lang-support.md | 1 + languages.toml | 9 +++++++++ runtime/queries/log/highlights.scm | 10 ++++++++++ 3 files changed, 20 insertions(+) create mode 100644 runtime/queries/log/highlights.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index c21ca2501e8a..ed4014e308f1 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -91,6 +91,7 @@ | llvm | ✓ | ✓ | ✓ | | | llvm-mir | ✓ | ✓ | ✓ | | | llvm-mir-yaml | ✓ | | ✓ | | +| log | ✓ | | | | | lpf | ✓ | | | | | lua | ✓ | ✓ | ✓ | `lua-language-server` | | make | ✓ | | | | diff --git a/languages.toml b/languages.toml index ef4687af8a71..5c7a7ca8bdad 100644 --- a/languages.toml +++ b/languages.toml @@ -2942,3 +2942,12 @@ indent = { tab-width = 2, unit = " " } [[grammar]] name = "dbml" source = { git = "https://github.com/dynamotn/tree-sitter-dbml", rev = "2e2fa5640268c33c3d3f27f7e676f631a9c68fd9" } + +[[language]] +name = "log" +scope = "source.log" +file-types = ["log"] + +[[grammar]] +name = "log" +source = { git = "https://github.com/Tudyx/tree-sitter-log", rev = "62cfe307e942af3417171243b599cc7deac5eab9" } diff --git a/runtime/queries/log/highlights.scm b/runtime/queries/log/highlights.scm new file mode 100644 index 000000000000..3bb4314bbe81 --- /dev/null +++ b/runtime/queries/log/highlights.scm @@ -0,0 +1,10 @@ +(trace) @ui.virtual.inlay-hint +(debug) @diff.plus +(info) @info +(warn) @warning +(error) @error +(year_month_day) @keyword +(time) @constant +(string_literal) @string +(number) @constant.numeric +(constant) @constant.builtin From f10c9deff12863b46f3a652faf3464c02efc4464 Mon Sep 17 00:00:00 2001 From: Tudyx <56633664+Tudyx@users.noreply.github.com> Date: Mon, 27 Nov 2023 19:52:16 +0100 Subject: [PATCH 2/2] better highlight queries --- runtime/queries/log/highlights.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/queries/log/highlights.scm b/runtime/queries/log/highlights.scm index 3bb4314bbe81..6820b3fd0204 100644 --- a/runtime/queries/log/highlights.scm +++ b/runtime/queries/log/highlights.scm @@ -1,5 +1,5 @@ -(trace) @ui.virtual.inlay-hint -(debug) @diff.plus +(trace) @comment +(debug) @hint (info) @info (warn) @warning (error) @error