Skip to content

Commit

Permalink
Update to latest tree-sitter Rust parser on crates.io
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilfred committed Jan 26, 2025
1 parent 8fcfdae commit 6f35d13
Show file tree
Hide file tree
Showing 50 changed files with 19 additions and 181,787 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ effect since 0.46.
File detection now supports Windows-1252 encoded test (an extension of
ISO-8859-1), and is stricter about UTF-16 detection.

Updated to the latest tree-sitter parser for LaTeX, Make and YAML.
Updated to the latest tree-sitter parser for LaTeX, Make, Rust and
YAML.

## 0.62 (released 20th December 2024)

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 @@ -98,6 +98,7 @@ tree-sitter-xml = "0.7.0"
tree-sitter-make = "1.1.1"
tree-sitter-yaml = "0.7.0"
encoding_rs = "0.8.35"
tree-sitter-rust = "0.23.2"

[dev-dependencies]
# assert_cmd 2.0.10 requires predicates 3.
Expand Down
5 changes: 0 additions & 5 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,6 @@ fn main() {
src_dir: "vendored_parsers/tree-sitter-racket-src",
extra_files: vec!["scanner.c"],
},
TreeSitterParser {
name: "tree-sitter-rust",
src_dir: "vendored_parsers/tree-sitter-rust-src",
extra_files: vec!["scanner.c"],
},
TreeSitterParser {
name: "tree-sitter-scheme",
src_dir: "vendored_parsers/tree-sitter-scheme-src",
Expand Down
12 changes: 5 additions & 7 deletions src/parse/tree_sitter_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ extern "C" {
fn tree_sitter_qmljs() -> ts::Language;
fn tree_sitter_r() -> ts::Language;
fn tree_sitter_racket() -> ts::Language;
fn tree_sitter_rust() -> ts::Language;
fn tree_sitter_scheme() -> ts::Language;
fn tree_sitter_smali() -> ts::Language;
fn tree_sitter_scss() -> ts::Language;
Expand Down Expand Up @@ -917,16 +916,15 @@ pub(crate) fn from_language(language: guess::Language) -> TreeSitterConfig {
}
}
Rust => {
let language = unsafe { tree_sitter_rust() };
let language_fn = tree_sitter_rust::LANGUAGE;
let language = tree_sitter::Language::new(language_fn);

TreeSitterConfig {
language: language.clone(),
atom_nodes: vec!["char_literal", "string_literal"].into_iter().collect(),
delimiter_tokens: vec![("{", "}"), ("(", ")"), ("[", "]"), ("|", "|"), ("<", ">")],
highlight_query: ts::Query::new(
&language,
include_str!("../../vendored_parsers/highlights/rust.scm"),
)
.unwrap(),
highlight_query: ts::Query::new(&language, tree_sitter_rust::HIGHLIGHTS_QUERY)
.unwrap(),
sub_languages: vec![],
}
}
Expand Down
1 change: 0 additions & 1 deletion vendored_parsers/highlights/rust.scm

This file was deleted.

1 change: 0 additions & 1 deletion vendored_parsers/tree-sitter-rust-src

This file was deleted.

20 changes: 0 additions & 20 deletions vendored_parsers/tree-sitter-rust/.eslintrc.js

This file was deleted.

10 changes: 0 additions & 10 deletions vendored_parsers/tree-sitter-rust/.gitattributes

This file was deleted.

37 changes: 0 additions & 37 deletions vendored_parsers/tree-sitter-rust/.github/workflows/ci.yml

This file was deleted.

22 changes: 0 additions & 22 deletions vendored_parsers/tree-sitter-rust/.github/workflows/fuzz.yml

This file was deleted.

19 changes: 0 additions & 19 deletions vendored_parsers/tree-sitter-rust/.github/workflows/lint.yml

This file was deleted.

103 changes: 0 additions & 103 deletions vendored_parsers/tree-sitter-rust/.github/workflows/publish.yml

This file was deleted.

8 changes: 0 additions & 8 deletions vendored_parsers/tree-sitter-rust/.gitignore

This file was deleted.

Empty file.
6 changes: 0 additions & 6 deletions vendored_parsers/tree-sitter-rust/.npmignore

This file was deleted.

24 changes: 0 additions & 24 deletions vendored_parsers/tree-sitter-rust/Cargo.toml

This file was deleted.

21 changes: 0 additions & 21 deletions vendored_parsers/tree-sitter-rust/LICENSE

This file was deleted.

Loading

0 comments on commit 6f35d13

Please sign in to comment.