Skip to content

Commit

Permalink
chore!(tree-sitter): update query for tree-sitter-haskell rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb committed May 13, 2024
1 parent 89a4f68 commit 6ce2c22
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lua/haskell-snippets/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 6ce2c22

Please sign in to comment.