From 0c21c227e1ca9d5681dc7e08739b28458c346692 Mon Sep 17 00:00:00 2001 From: Viktor Kleen Date: Fri, 26 May 2023 07:23:15 +0000 Subject: [PATCH] Update languages.toml for Nickel (#7059) --- languages.toml | 8 +++++++- runtime/queries/nickel/highlights.scm | 4 ++-- runtime/queries/nickel/indents.scm | 2 +- runtime/queries/nickel/injections.scm | 3 +++ 4 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 runtime/queries/nickel/injections.scm diff --git a/languages.toml b/languages.toml index ba24fde76..423ade69a 100644 --- a/languages.toml +++ b/languages.toml @@ -648,9 +648,15 @@ comment-token = "#" language-servers = [ "nls" ] indent = { tab-width = 2, unit = " " } +[language.auto-pairs] +'(' = ')' +'{' = '}' +'[' = ']' +'"' = '"' + [[grammar]] name = "nickel" -source = { git = "https://github.com/nickel-lang/tree-sitter-nickel", rev = "9d83db400b6c11260b9106f131f93ddda8131933" } +source = { git = "https://github.com/nickel-lang/tree-sitter-nickel", rev = "3a794388773f2424a97b2186828aa3fac4c66ce6" } [[language]] name = "nix" diff --git a/runtime/queries/nickel/highlights.scm b/runtime/queries/nickel/highlights.scm index cd458df27..4e4bf6694 100644 --- a/runtime/queries/nickel/highlights.scm +++ b/runtime/queries/nickel/highlights.scm @@ -20,7 +20,7 @@ ) (record_operand (atom (ident) @variable)) -(let_expr +(let_in_block "let" @keyword "rec"? @keyword pat: (pattern @@ -53,7 +53,7 @@ (interpolation_end) @punctuation.bracket ["forall" "default" "doc"] @keyword -["if" "then" "else" "switch"] @keyword.control.conditional +["if" "then" "else" "match"] @keyword.control.conditional "import" @keyword.control.import (infix_expr diff --git a/runtime/queries/nickel/indents.scm b/runtime/queries/nickel/indents.scm index 8be5a6bd2..0a428448c 100644 --- a/runtime/queries/nickel/indents.scm +++ b/runtime/queries/nickel/indents.scm @@ -1,7 +1,7 @@ [ (fun_expr) (let_expr) - (switch_expr) + (match_expr) (ite_expr) (uni_record) diff --git a/runtime/queries/nickel/injections.scm b/runtime/queries/nickel/injections.scm new file mode 100644 index 000000000..9f00b90a1 --- /dev/null +++ b/runtime/queries/nickel/injections.scm @@ -0,0 +1,3 @@ +(annot_atom doc: (static_string) + @injection.content + (#set! injection.language "markdown"))