Skip to content

Commit

Permalink
Use tree-sitter-haskell from crates.io
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilfred committed Dec 20, 2024
1 parent 943ea4b commit bbe4890
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ with YAML.

Improved language detection when one argument is a named pipe.

Updated to the latest tree-sitter parser for Haskell.

### Syntax Highlighting

Improved syntax highlighting, particularly for keywords.
Expand Down
11 changes: 11 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ line-numbers = "0.3.0"
smallvec = "1.13.2"
tree-sitter-language = "0.1.3"
streaming-iterator = "0.1.9"
tree-sitter-haskell = "0.23.1"

[dev-dependencies]
# assert_cmd 2.0.10 requires predicates 3.
Expand Down
4 changes: 2 additions & 2 deletions src/parse/tree_sitter_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ extern "C" {
fn tree_sitter_go() -> ts::Language;
fn tree_sitter_hare() -> ts::Language;
fn tree_sitter_hack() -> ts::Language;
fn tree_sitter_haskell() -> ts::Language;
fn tree_sitter_hcl() -> ts::Language;
fn tree_sitter_html() -> ts::Language;
fn tree_sitter_janet_simple() -> ts::Language;
Expand Down Expand Up @@ -490,7 +489,8 @@ pub(crate) fn from_language(language: guess::Language) -> TreeSitterConfig {
}
}
Haskell => {
let language = unsafe { tree_sitter_haskell() };
let language_fn = tree_sitter_haskell::LANGUAGE;
let language = tree_sitter::Language::new(language_fn);
TreeSitterConfig {
language: language.clone(),
atom_nodes: vec![
Expand Down

0 comments on commit bbe4890

Please sign in to comment.