fix duplicate tree-sitter symbols and ar -D flag on macOS
This commit is contained in:
parent
ae20a6d5fd
commit
65239ea0f0
1
build.sh
1
build.sh
|
|
@ -12,6 +12,7 @@ SDK=$(xcrun --show-sdk-path)
|
|||
|
||||
RUST_LIB="$ROOT/core/target/release"
|
||||
export MACOSX_DEPLOYMENT_TARGET=14.0
|
||||
export ZERO_AR_DATE=0
|
||||
echo "Building Rust core (release)..."
|
||||
cd "$ROOT/core" && cargo build --release
|
||||
if [ $? -ne 0 ]; then
|
||||
|
|
|
|||
|
|
@ -31,15 +31,13 @@ tree-sitter-css = "0.23"
|
|||
tree-sitter-json = "0.24"
|
||||
tree-sitter-lua = "0.4"
|
||||
tree-sitter-php = "0.23"
|
||||
tree-sitter-toml = "0.20"
|
||||
tree-sitter-toml-ng = "0.7"
|
||||
tree-sitter-yaml = "0.6"
|
||||
tree-sitter-swift = "0.6"
|
||||
tree-sitter-zig = "1"
|
||||
tree-sitter-sql = "0.0.2"
|
||||
tree-sitter-sequel = "0.3"
|
||||
tree-sitter-md = "0.5"
|
||||
tree-sitter-make = "1"
|
||||
tree-sitter-dockerfile = "0.2"
|
||||
tree-sitter-kotlin = "0.3"
|
||||
|
||||
[build-dependencies]
|
||||
cbindgen = "0.27"
|
||||
|
|
|
|||
|
|
@ -1,11 +1,5 @@
|
|||
use tree_sitter_highlight::{HighlightConfiguration, HighlightEvent, Highlighter};
|
||||
use tree_sitter::Language;
|
||||
|
||||
/// Convert an old-API tree-sitter Language (v0.19/v0.20) to current v0.24.
|
||||
/// Both are newtype wrappers around `*const TSLanguage`; the C ABI is identical.
|
||||
unsafe fn lang_compat<T>(old: T) -> Language {
|
||||
std::mem::transmute_copy(&old)
|
||||
}
|
||||
use tree_sitter_highlight::{HighlightConfiguration, HighlightEvent, Highlighter};
|
||||
|
||||
const HIGHLIGHT_NAMES: &[&str] = &[
|
||||
"keyword",
|
||||
|
|
@ -147,13 +141,13 @@ fn lang_def(lang_id: &str) -> Option<LangDef> {
|
|||
locals: "",
|
||||
},
|
||||
"toml" => LangDef {
|
||||
language: unsafe { lang_compat(tree_sitter_toml::language()) },
|
||||
highlights: tree_sitter_toml::HIGHLIGHT_QUERY,
|
||||
language: tree_sitter_toml_ng::LANGUAGE.into(),
|
||||
highlights: tree_sitter_toml_ng::HIGHLIGHTS_QUERY,
|
||||
injections: "",
|
||||
locals: "",
|
||||
},
|
||||
"yaml" => LangDef {
|
||||
language: unsafe { lang_compat(tree_sitter_yaml::language()) },
|
||||
language: tree_sitter_yaml::language(),
|
||||
highlights: tree_sitter_yaml::HIGHLIGHTS_QUERY,
|
||||
injections: "",
|
||||
locals: "",
|
||||
|
|
@ -171,8 +165,8 @@ fn lang_def(lang_id: &str) -> Option<LangDef> {
|
|||
locals: "",
|
||||
},
|
||||
"sql" => LangDef {
|
||||
language: unsafe { lang_compat(tree_sitter_sql::language()) },
|
||||
highlights: include_str!("../queries/sql-highlights.scm"),
|
||||
language: tree_sitter_sequel::LANGUAGE.into(),
|
||||
highlights: tree_sitter_sequel::HIGHLIGHTS_QUERY,
|
||||
injections: "",
|
||||
locals: "",
|
||||
},
|
||||
|
|
@ -182,18 +176,6 @@ fn lang_def(lang_id: &str) -> Option<LangDef> {
|
|||
injections: "",
|
||||
locals: "",
|
||||
},
|
||||
"dockerfile" => LangDef {
|
||||
language: unsafe { lang_compat(tree_sitter_dockerfile::language()) },
|
||||
highlights: include_str!("../queries/dockerfile-highlights.scm"),
|
||||
injections: "",
|
||||
locals: "",
|
||||
},
|
||||
"kotlin" => LangDef {
|
||||
language: unsafe { lang_compat(tree_sitter_kotlin::language()) },
|
||||
highlights: include_str!("../queries/kotlin-highlights.scm"),
|
||||
injections: "",
|
||||
locals: "",
|
||||
},
|
||||
_ => return None,
|
||||
};
|
||||
Some(ld)
|
||||
|
|
|
|||
Loading…
Reference in New Issue