From d1fb4592e44ab37e9b0645dabc19ca15559013de Mon Sep 17 00:00:00 2001 From: woojiq Date: Sun, 21 Jan 2024 11:18:23 +0200 Subject: [PATCH] indents(css, make): add basic queries * Despite the fact that queries look simple, they improve indentation in some edge cases that helix couldn't handle correctly by default. --- book/src/generated/lang-support.md | 4 ++-- runtime/queries/css/indents.scm | 7 +++++++ runtime/queries/make/indents.scm | 8 ++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 runtime/queries/css/indents.scm create mode 100644 runtime/queries/make/indents.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index ee01c40309c3..6fedace63072 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -21,7 +21,7 @@ | cpon | ✓ | | ✓ | | | cpp | ✓ | ✓ | ✓ | `clangd` | | crystal | ✓ | ✓ | | `crystalline` | -| css | ✓ | | | `vscode-css-language-server` | +| css | ✓ | | ✓ | `vscode-css-language-server` | | cue | ✓ | | | `cuelsp` | | d | ✓ | ✓ | ✓ | `serve-d` | | dart | ✓ | | ✓ | `dart` | @@ -97,7 +97,7 @@ | log | ✓ | | | | | lpf | ✓ | | | | | lua | ✓ | ✓ | ✓ | `lua-language-server` | -| make | ✓ | | | | +| make | ✓ | | ✓ | | | markdoc | ✓ | | | `markdoc-ls` | | markdown | ✓ | | | `marksman` | | markdown.inline | ✓ | | | | diff --git a/runtime/queries/css/indents.scm b/runtime/queries/css/indents.scm new file mode 100644 index 000000000000..1dfd977d98d7 --- /dev/null +++ b/runtime/queries/css/indents.scm @@ -0,0 +1,7 @@ +[ + (block) +] @indent + +[ + "}" +] @outdent diff --git a/runtime/queries/make/indents.scm b/runtime/queries/make/indents.scm new file mode 100644 index 000000000000..42b2c60e65d7 --- /dev/null +++ b/runtime/queries/make/indents.scm @@ -0,0 +1,8 @@ +[ + (define_directive) + (rule) +] @indent + +[ + "endef" +] @outdent