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"
|
RUST_LIB="$ROOT/core/target/release"
|
||||||
export MACOSX_DEPLOYMENT_TARGET=14.0
|
export MACOSX_DEPLOYMENT_TARGET=14.0
|
||||||
|
export ZERO_AR_DATE=0
|
||||||
echo "Building Rust core (release)..."
|
echo "Building Rust core (release)..."
|
||||||
cd "$ROOT/core" && cargo build --release
|
cd "$ROOT/core" && cargo build --release
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
|
|
|
||||||
|
|
@ -31,15 +31,13 @@ tree-sitter-css = "0.23"
|
||||||
tree-sitter-json = "0.24"
|
tree-sitter-json = "0.24"
|
||||||
tree-sitter-lua = "0.4"
|
tree-sitter-lua = "0.4"
|
||||||
tree-sitter-php = "0.23"
|
tree-sitter-php = "0.23"
|
||||||
tree-sitter-toml = "0.20"
|
tree-sitter-toml-ng = "0.7"
|
||||||
tree-sitter-yaml = "0.6"
|
tree-sitter-yaml = "0.6"
|
||||||
tree-sitter-swift = "0.6"
|
tree-sitter-swift = "0.6"
|
||||||
tree-sitter-zig = "1"
|
tree-sitter-zig = "1"
|
||||||
tree-sitter-sql = "0.0.2"
|
tree-sitter-sequel = "0.3"
|
||||||
tree-sitter-md = "0.5"
|
tree-sitter-md = "0.5"
|
||||||
tree-sitter-make = "1"
|
tree-sitter-make = "1"
|
||||||
tree-sitter-dockerfile = "0.2"
|
|
||||||
tree-sitter-kotlin = "0.3"
|
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
cbindgen = "0.27"
|
cbindgen = "0.27"
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,5 @@
|
||||||
use tree_sitter_highlight::{HighlightConfiguration, HighlightEvent, Highlighter};
|
|
||||||
use tree_sitter::Language;
|
use tree_sitter::Language;
|
||||||
|
use tree_sitter_highlight::{HighlightConfiguration, HighlightEvent, Highlighter};
|
||||||
/// 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)
|
|
||||||
}
|
|
||||||
|
|
||||||
const HIGHLIGHT_NAMES: &[&str] = &[
|
const HIGHLIGHT_NAMES: &[&str] = &[
|
||||||
"keyword",
|
"keyword",
|
||||||
|
|
@ -147,13 +141,13 @@ fn lang_def(lang_id: &str) -> Option<LangDef> {
|
||||||
locals: "",
|
locals: "",
|
||||||
},
|
},
|
||||||
"toml" => LangDef {
|
"toml" => LangDef {
|
||||||
language: unsafe { lang_compat(tree_sitter_toml::language()) },
|
language: tree_sitter_toml_ng::LANGUAGE.into(),
|
||||||
highlights: tree_sitter_toml::HIGHLIGHT_QUERY,
|
highlights: tree_sitter_toml_ng::HIGHLIGHTS_QUERY,
|
||||||
injections: "",
|
injections: "",
|
||||||
locals: "",
|
locals: "",
|
||||||
},
|
},
|
||||||
"yaml" => LangDef {
|
"yaml" => LangDef {
|
||||||
language: unsafe { lang_compat(tree_sitter_yaml::language()) },
|
language: tree_sitter_yaml::language(),
|
||||||
highlights: tree_sitter_yaml::HIGHLIGHTS_QUERY,
|
highlights: tree_sitter_yaml::HIGHLIGHTS_QUERY,
|
||||||
injections: "",
|
injections: "",
|
||||||
locals: "",
|
locals: "",
|
||||||
|
|
@ -171,8 +165,8 @@ fn lang_def(lang_id: &str) -> Option<LangDef> {
|
||||||
locals: "",
|
locals: "",
|
||||||
},
|
},
|
||||||
"sql" => LangDef {
|
"sql" => LangDef {
|
||||||
language: unsafe { lang_compat(tree_sitter_sql::language()) },
|
language: tree_sitter_sequel::LANGUAGE.into(),
|
||||||
highlights: include_str!("../queries/sql-highlights.scm"),
|
highlights: tree_sitter_sequel::HIGHLIGHTS_QUERY,
|
||||||
injections: "",
|
injections: "",
|
||||||
locals: "",
|
locals: "",
|
||||||
},
|
},
|
||||||
|
|
@ -182,18 +176,6 @@ fn lang_def(lang_id: &str) -> Option<LangDef> {
|
||||||
injections: "",
|
injections: "",
|
||||||
locals: "",
|
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,
|
_ => return None,
|
||||||
};
|
};
|
||||||
Some(ld)
|
Some(ld)
|
||||||
|
|
|
||||||
1
debug.sh
1
debug.sh
|
|
@ -12,6 +12,7 @@ LOGFILE="$HOME/swiftly/debug.log"
|
||||||
SDK=$(xcrun --show-sdk-path)
|
SDK=$(xcrun --show-sdk-path)
|
||||||
|
|
||||||
RUST_LIB="$ROOT/core/target/debug"
|
RUST_LIB="$ROOT/core/target/debug"
|
||||||
|
export ZERO_AR_DATE=0
|
||||||
echo "Building Rust core (debug)..."
|
echo "Building Rust core (debug)..."
|
||||||
cd "$ROOT/core" && cargo build
|
cd "$ROOT/core" && cargo build
|
||||||
cd "$ROOT"
|
cd "$ROOT"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue