Skip to content

Commit

Permalink
Use tree-sitter-ruby from crates.io
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilfred committed Dec 20, 2024
1 parent 79bdf87 commit a9ed8bf
Show file tree
Hide file tree
Showing 51 changed files with 16 additions and 469,393 deletions.
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 @@ -79,6 +79,7 @@ smallvec = "1.13.2"
tree-sitter-language = "0.1.3"
streaming-iterator = "0.1.9"
tree-sitter-haskell = "0.23.1"
tree-sitter-ruby = "0.23.1"

[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 @@ -293,11 +293,6 @@ fn main() {
src_dir: "vendored_parsers/tree-sitter-racket-src",
extra_files: vec!["scanner.c"],
},
TreeSitterParser {
name: "tree-sitter-ruby",
src_dir: "vendored_parsers/tree-sitter-ruby-src",
extra_files: vec!["scanner.cc"],
},
TreeSitterParser {
name: "tree-sitter-rust",
src_dir: "vendored_parsers/tree-sitter-rust-src",
Expand Down
11 changes: 4 additions & 7 deletions src/parse/tree_sitter_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ extern "C" {
fn tree_sitter_qmljs() -> ts::Language;
fn tree_sitter_r() -> ts::Language;
fn tree_sitter_racket() -> ts::Language;
fn tree_sitter_ruby() -> ts::Language;
fn tree_sitter_rust() -> ts::Language;
fn tree_sitter_scala() -> ts::Language;
fn tree_sitter_scheme() -> ts::Language;
Expand Down Expand Up @@ -944,7 +943,8 @@ pub(crate) fn from_language(language: guess::Language) -> TreeSitterConfig {
}
}
Ruby => {
let language = unsafe { tree_sitter_ruby() };
let language_fn = tree_sitter_ruby::LANGUAGE;
let language = tree_sitter::Language::new(language_fn);
TreeSitterConfig {
language: language.clone(),
atom_nodes: vec!["string", "heredoc_body", "regex"]
Expand All @@ -959,11 +959,8 @@ pub(crate) fn from_language(language: guess::Language) -> TreeSitterConfig {
("begin", "end"),
("class", "end"),
],
highlight_query: ts::Query::new(
&language,
include_str!("../../vendored_parsers/highlights/ruby.scm"),
)
.unwrap(),
highlight_query: ts::Query::new(&language, tree_sitter_ruby::HIGHLIGHTS_QUERY)
.unwrap(),
sub_languages: vec![],
}
}
Expand Down
1 change: 0 additions & 1 deletion vendored_parsers/highlights/ruby.scm

This file was deleted.

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

This file was deleted.

2 changes: 0 additions & 2 deletions vendored_parsers/tree-sitter-ruby/.gitattributes

This file was deleted.

This file was deleted.

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

This file was deleted.

13 changes: 0 additions & 13 deletions vendored_parsers/tree-sitter-ruby/.gitignore

This file was deleted.

Empty file.
5 changes: 0 additions & 5 deletions vendored_parsers/tree-sitter-ruby/.npmignore

This file was deleted.

31 changes: 0 additions & 31 deletions vendored_parsers/tree-sitter-ruby/Cargo.toml

This file was deleted.

22 changes: 0 additions & 22 deletions vendored_parsers/tree-sitter-ruby/LICENSE

This file was deleted.

114 changes: 0 additions & 114 deletions vendored_parsers/tree-sitter-ruby/Makefile

This file was deleted.

10 changes: 0 additions & 10 deletions vendored_parsers/tree-sitter-ruby/README.md

This file was deleted.

19 changes: 0 additions & 19 deletions vendored_parsers/tree-sitter-ruby/binding.gyp

This file was deleted.

16 changes: 0 additions & 16 deletions vendored_parsers/tree-sitter-ruby/bindings/c/tree-sitter.h.in

This file was deleted.

11 changes: 0 additions & 11 deletions vendored_parsers/tree-sitter-ruby/bindings/c/tree-sitter.pc.in

This file was deleted.

Loading

0 comments on commit a9ed8bf

Please sign in to comment.