From ac88302858b86ae5b308a69c16d581adff07dff6 Mon Sep 17 00:00:00 2001 From: Quentin Boyer Date: Mon, 6 Jan 2025 22:40:57 +0100 Subject: [PATCH] neovim: Add JS injections for maud --- neovim/default.nix | 15 +++++++++++++++ neovim/lsp.nix | 3 +++ 2 files changed, 18 insertions(+) diff --git a/neovim/default.nix b/neovim/default.nix index 0167716..baf235a 100644 --- a/neovim/default.nix +++ b/neovim/default.nix @@ -231,6 +231,20 @@ }; }; + extraFiles."queries/rust/injections.scm".text = '' + ;; extends + + (call_expression + function: ((identifier) @_func (#eq? @_func "JS")) + arguments: (arguments (raw_string_literal (string_content) @injection.content)) + (#set! injection.language "javascript")) + + (token_tree + (identifier) @_func (#eq? @_func "JS") + (token_tree (raw_string_literal (string_content) @injection.content)) + (#set! injection.language "javascript")) + ''; + plugins.treesitter = { enable = true; @@ -262,6 +276,7 @@ groovy html ini + javascript json just lalrpop diff --git a/neovim/lsp.nix b/neovim/lsp.nix index 3c7919e..d37efe7 100644 --- a/neovim/lsp.nix +++ b/neovim/lsp.nix @@ -53,6 +53,9 @@ nargs = 1, force = true, }) + + -- rust-analyzer overrides injections + vim.api.nvim_set_hl(0, "@lsp.type.string.rust", {}) ''; # Language Servers