Skip to content

Commit

Permalink
Use tree-sitter-css from crates.io
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilfred committed Dec 20, 2024
1 parent 97dbc9b commit c73b18b
Show file tree
Hide file tree
Showing 45 changed files with 20 additions and 33,320 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ with YAML.

Improved language detection when one argument is a named pipe.

Updated to the latest tree-sitter parser for Bash, C, C++, C#, Go,
Haskell, HTML, Java, JavaScript, JSON, Julia, Objective-C, OCaml, PHP,
Python, Ruby, Scala and TypeScript.
Updated to the latest tree-sitter parser for Bash, C, C++, C#, CSS,
Go, Haskell, HTML, Java, JavaScript, JSON, Julia, Objective-C, OCaml,
PHP, Python, Ruby, Scala and TypeScript.

### Syntax Highlighting

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 @@ -96,6 +96,7 @@ tree-sitter-bash = "0.23.3"
tree-sitter-php = "0.23.11"
tree-sitter-json = "0.24.8"
tree-sitter-html = "0.23.2"
tree-sitter-css = "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 @@ -87,11 +87,6 @@ fn main() {
src_dir: "vendored_parsers/tree-sitter-commonlisp-src",
extra_files: vec![],
},
TreeSitterParser {
name: "tree-sitter-css",
src_dir: "vendored_parsers/tree-sitter-css-src",
extra_files: vec!["scanner.c"],
},
TreeSitterParser {
name: "tree-sitter-dart",
src_dir: "vendored_parsers/tree-sitter-dart-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 @@ -66,7 +66,6 @@ extern "C" {
fn tree_sitter_clojure() -> ts::Language;
fn tree_sitter_cmake() -> ts::Language;
fn tree_sitter_commonlisp() -> ts::Language;
fn tree_sitter_css() -> ts::Language;
fn tree_sitter_dart() -> ts::Language;
fn tree_sitter_devicetree() -> ts::Language;
fn tree_sitter_elisp() -> ts::Language;
Expand Down Expand Up @@ -264,7 +263,9 @@ pub(crate) fn from_language(language: guess::Language) -> TreeSitterConfig {
}
}
Css => {
let language = unsafe { tree_sitter_css() };
let language_fn = tree_sitter_css::LANGUAGE;
let language = tree_sitter::Language::new(language_fn);

TreeSitterConfig {
language: language.clone(),
atom_nodes: vec![
Expand All @@ -276,11 +277,8 @@ pub(crate) fn from_language(language: guess::Language) -> TreeSitterConfig {
.into_iter()
.collect(),
delimiter_tokens: vec![("{", "}"), ("(", ")")],
highlight_query: ts::Query::new(
&language,
include_str!("../../vendored_parsers/highlights/css.scm"),
)
.unwrap(),
highlight_query: ts::Query::new(&language, tree_sitter_css::HIGHLIGHTS_QUERY)
.unwrap(),
sub_languages: vec![],
}
}
Expand Down
1 change: 0 additions & 1 deletion vendored_parsers/highlights/css.scm

This file was deleted.

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

This file was deleted.

22 changes: 0 additions & 22 deletions vendored_parsers/tree-sitter-css/.appveyor.yml

This file was deleted.

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

This file was deleted.

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

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

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

This file was deleted.

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

This file was deleted.

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

This file was deleted.

Loading

0 comments on commit c73b18b

Please sign in to comment.