From 23f929e516c1399d0243fefe2e789843274a6786 Mon Sep 17 00:00:00 2001 From: Alexander Brevig Date: Thu, 18 Aug 2022 00:38:18 +0200 Subject: [PATCH 1/2] feat: add taskwarrior .task files to languages, now task N edit will be nice --- book/src/generated/lang-support.md | 1 + languages.toml | 13 +++++++++++++ runtime/queries/task/highlights.scm | 4 ++++ runtime/queries/task/injections.scm | 2 ++ 4 files changed, 20 insertions(+) create mode 100644 runtime/queries/task/highlights.scm create mode 100644 runtime/queries/task/injections.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 941b7a7afaae..e9ef56cf745b 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -99,6 +99,7 @@ | svelte | ✓ | | ✓ | `svelteserver` | | swift | ✓ | | | `sourcekit-lsp` | | tablegen | ✓ | ✓ | ✓ | | +| task | ✓ | | | | | tfvars | | | | `terraform-ls` | | toml | ✓ | | | `taplo` | | tsq | ✓ | | | | diff --git a/languages.toml b/languages.toml index 1bab34330de3..8c57ecf223a7 100644 --- a/languages.toml +++ b/languages.toml @@ -1640,3 +1640,16 @@ language-server = { command = "slint-lsp", args = [] } [[grammar]] name = "slint" source = { git = "https://github.com/jrmoulton/tree-sitter-slint", rev = "0d4dda94f96623302dfc234e06be62a5717f47da" } + +[[language]] +name = "task" +scope = "source.task" +injection-regex = "task" +file-types = ["task"] +roots = [] +comment-token = "#" +indent = { tab-width = 2, unit = " " } + +[[grammar]] +name = "task" +source = { git = "https://github.com/alexanderbrevig/tree-sitter-task", rev = "f2cb435c5dbf3ee19493e224485d977cb2d36d8b" } diff --git a/runtime/queries/task/highlights.scm b/runtime/queries/task/highlights.scm new file mode 100644 index 000000000000..fc9ca5e4abf7 --- /dev/null +++ b/runtime/queries/task/highlights.scm @@ -0,0 +1,4 @@ +(comment) @comment +(datetime) @type +(identifier) @identifier +(keyword) @keyword diff --git a/runtime/queries/task/injections.scm b/runtime/queries/task/injections.scm new file mode 100644 index 000000000000..321c90add371 --- /dev/null +++ b/runtime/queries/task/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) From aeded3c10b41508c2d044cb8bcf728f9b5138d89 Mon Sep 17 00:00:00 2001 From: Alexander Brevig Date: Fri, 19 Aug 2022 01:07:51 +0200 Subject: [PATCH 2/2] Update runtime/queries/task/highlights.scm Co-authored-by: Michael Davis --- runtime/queries/task/highlights.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/queries/task/highlights.scm b/runtime/queries/task/highlights.scm index fc9ca5e4abf7..90441307cdaa 100644 --- a/runtime/queries/task/highlights.scm +++ b/runtime/queries/task/highlights.scm @@ -1,4 +1,4 @@ (comment) @comment (datetime) @type -(identifier) @identifier +(identifier) @variable (keyword) @keyword