From 6ce2c22b434979804f9337fd4ecfe0d200c0fd6c Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Mon, 13 May 2024 17:59:24 +0200 Subject: [PATCH] chore!(tree-sitter): update query for tree-sitter-haskell rewrite --- CHANGELOG.md | 12 ++++++++++++ lua/haskell-snippets/module.lua | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59b22a8..9175a13 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,18 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.0.0] - 2024-05-13 + +### BREAKING CHANGE + +- Updated tree-sitter query to be compatible with the + tree-sitter-haskell v0.21.0 rewrite. + - If you are using nvim-treesitter to manage parser installations, run `:TSUpdate` + to ensure you have the latest tree-sitter-haskell version. + - If you are using Nix with an older version of the parser, + you can either package tree-sitter-haskell, + or pin an older version of this plugin. + ## [1.4.3] - 2023-12-15 ### Fixed diff --git a/lua/haskell-snippets/module.lua b/lua/haskell-snippets/module.lua index cb102bc..6ee74e0 100644 --- a/lua/haskell-snippets/module.lua +++ b/lua/haskell-snippets/module.lua @@ -41,7 +41,7 @@ end ---@return string|nil local function treesitter_module_name(apply, content, query_string) assert(has_haskell_parser, 'No tree-sitter parser for Haskell found.') - query_string = query_string or '(module) @mod' + query_string = query_string or '(module_id) @mod' local module_query = vim.treesitter.query.parse(hs_lang, query_string) local lang_tree = vim.treesitter.get_string_parser(content, hs_lang, { injections = { [hs_lang] = '' } }) local root = fast_parse(lang_tree):root()