chore: update active-win-pos-rs to version 0.8.4 and disable hyperpolyglot detection temporarily

This commit is contained in:
PandaDEV 2024-12-20 23:27:52 +10:00
parent 6148b7a84a
commit ccb40c4cc9
No known key found for this signature in database
GPG key ID: 13EFF9BAF70EE75C
3 changed files with 10 additions and 234 deletions

233
src-tauri/Cargo.lock generated
View file

@ -4,9 +4,9 @@ version = 3
[[package]] [[package]]
name = "active-win-pos-rs" name = "active-win-pos-rs"
version = "0.8.3" version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c9c1d770875c536934a8e7150061b0dbddb919298f0ff762b0f8fc12c8928877" checksum = "e227f8493de9f5e493f8e762ac7516d2ae42464df2e8122fcafd604f0b16c634"
dependencies = [ dependencies = [
"appkit-nsworkspace-bindings", "appkit-nsworkspace-bindings",
"core-foundation 0.9.4", "core-foundation 0.9.4",
@ -94,15 +94,6 @@ dependencies = [
"libc", "libc",
] ]
[[package]]
name = "ansi_term"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2"
dependencies = [
"winapi",
]
[[package]] [[package]]
name = "anyhow" name = "anyhow"
version = "1.0.86" version = "1.0.86"
@ -349,17 +340,6 @@ version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
[[package]]
name = "atty"
version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
dependencies = [
"hermit-abi 0.1.19",
"libc",
"winapi",
]
[[package]] [[package]]
name = "auto-launch" name = "auto-launch"
version = "0.5.0" version = "0.5.0"
@ -567,16 +547,6 @@ dependencies = [
"regex-automata 0.1.10", "regex-automata 0.1.10",
] ]
[[package]]
name = "bstr"
version = "1.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "786a307d683a5bf92e6fd5fd69a7eb613751668d1d8d67d802846dfe367c62c8"
dependencies = [
"memchr",
"serde",
]
[[package]] [[package]]
name = "built" name = "built"
version = "0.7.4" version = "0.7.4"
@ -756,15 +726,6 @@ dependencies = [
"windows-targets 0.52.6", "windows-targets 0.52.6",
] ]
[[package]]
name = "circular-queue"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d34327ead1c743a10db339de35fb58957564b99d248a67985c55638b22c59b5"
dependencies = [
"version_check",
]
[[package]] [[package]]
name = "clang-sys" name = "clang-sys"
version = "1.8.1" version = "1.8.1"
@ -776,21 +737,6 @@ dependencies = [
"libloading 0.8.6", "libloading 0.8.6",
] ]
[[package]]
name = "clap"
version = "2.34.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c"
dependencies = [
"ansi_term",
"atty",
"bitflags 1.3.2",
"strsim 0.8.0",
"textwrap",
"unicode-width",
"vec_map",
]
[[package]] [[package]]
name = "clipboard-rs" name = "clipboard-rs"
version = "0.2.1" version = "0.2.1"
@ -1206,7 +1152,7 @@ dependencies = [
"ident_case", "ident_case",
"proc-macro2", "proc-macro2",
"quote", "quote",
"strsim 0.11.1", "strsim",
"syn 2.0.87", "syn 2.0.87",
] ]
@ -2072,19 +2018,6 @@ dependencies = [
"x11-dl", "x11-dl",
] ]
[[package]]
name = "globset"
version = "0.4.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "15f1ce686646e7f1e19bf7d5533fe443a45dbfb990e00629110797578b42fb19"
dependencies = [
"aho-corasick",
"bstr 1.11.1",
"log",
"regex-automata 0.4.8",
"regex-syntax",
]
[[package]] [[package]]
name = "gobject-sys" name = "gobject-sys"
version = "0.18.0" version = "0.18.0"
@ -2214,15 +2147,6 @@ version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
[[package]]
name = "hermit-abi"
version = "0.1.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
dependencies = [
"libc",
]
[[package]] [[package]]
name = "hermit-abi" name = "hermit-abi"
version = "0.3.9" version = "0.3.9"
@ -2396,25 +2320,6 @@ dependencies = [
"tracing", "tracing",
] ]
[[package]]
name = "hyperpolyglot"
version = "0.1.7"
source = "git+https://github.com/0pandadev/hyperpolyglot#f4f463d7430d870568584ffd55c901f4576a6bae"
dependencies = [
"clap",
"ignore",
"lazy_static",
"num_cpus",
"pcre2",
"phf 0.11.2",
"phf_codegen 0.11.2",
"polyglot_tokenizer",
"regex",
"serde",
"serde_yaml",
"termcolor",
]
[[package]] [[package]]
name = "iana-time-zone" name = "iana-time-zone"
version = "0.1.60" version = "0.1.60"
@ -2593,22 +2498,6 @@ dependencies = [
"icu_properties", "icu_properties",
] ]
[[package]]
name = "ignore"
version = "0.4.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d89fd380afde86567dfba715db065673989d6253f42b88179abd3eae47bda4b"
dependencies = [
"crossbeam-deque",
"globset",
"log",
"memchr",
"regex-automata 0.4.8",
"same-file",
"walkdir",
"winapi-util",
]
[[package]] [[package]]
name = "image" name = "image"
version = "0.25.5" version = "0.25.5"
@ -2988,12 +2877,6 @@ dependencies = [
"vcpkg", "vcpkg",
] ]
[[package]]
name = "linked-hash-map"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f"
[[package]] [[package]]
name = "linux-raw-sys" name = "linux-raw-sys"
version = "0.4.14" version = "0.4.14"
@ -3382,16 +3265,6 @@ dependencies = [
"libm", "libm",
] ]
[[package]]
name = "num_cpus"
version = "1.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43"
dependencies = [
"hermit-abi 0.3.9",
"libc",
]
[[package]] [[package]]
name = "num_enum" name = "num_enum"
version = "0.7.3" version = "0.7.3"
@ -3800,28 +3673,6 @@ version = "1.0.15"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
[[package]]
name = "pcre2"
version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3be55c43ac18044541d58d897e8f4c55157218428953ebd39d86df3ba0286b2b"
dependencies = [
"libc",
"log",
"pcre2-sys",
]
[[package]]
name = "pcre2-sys"
version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "550f5d18fb1b90c20b87e161852c10cde77858c3900c5059b5ad2a1449f11d8a"
dependencies = [
"cc",
"libc",
"pkg-config",
]
[[package]] [[package]]
name = "peeking_take_while" name = "peeking_take_while"
version = "0.1.2" version = "0.1.2"
@ -3893,16 +3744,6 @@ dependencies = [
"phf_shared 0.10.0", "phf_shared 0.10.0",
] ]
[[package]]
name = "phf_codegen"
version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8d39688d359e6b34654d328e262234662d16cc0f60ec8dcbe5e718709342a5a"
dependencies = [
"phf_generator 0.11.2",
"phf_shared 0.11.2",
]
[[package]] [[package]]
name = "phf_generator" name = "phf_generator"
version = "0.8.0" version = "0.8.0"
@ -4098,14 +3939,6 @@ dependencies = [
"windows-sys 0.52.0", "windows-sys 0.52.0",
] ]
[[package]]
name = "polyglot_tokenizer"
version = "0.2.1"
source = "git+https://github.com/0pandadev/hyperpolyglot#f4f463d7430d870568584ffd55c901f4576a6bae"
dependencies = [
"circular-queue",
]
[[package]] [[package]]
name = "powerfmt" name = "powerfmt"
version = "0.2.0" version = "0.2.0"
@ -4233,7 +4066,6 @@ dependencies = [
"base64 0.22.1", "base64 0.22.1",
"chrono", "chrono",
"global-hotkey", "global-hotkey",
"hyperpolyglot",
"image", "image",
"include_dir", "include_dir",
"lazy_static", "lazy_static",
@ -5036,18 +4868,6 @@ dependencies = [
"syn 2.0.87", "syn 2.0.87",
] ]
[[package]]
name = "serde_yaml"
version = "0.8.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "578a7433b776b56a35785ed5ce9a7e777ac0598aac5a6dd1b4b18a307c7fc71b"
dependencies = [
"indexmap 1.9.3",
"ryu",
"serde",
"yaml-rust",
]
[[package]] [[package]]
name = "serialize-to-javascript" name = "serialize-to-javascript"
version = "0.1.1" version = "0.1.1"
@ -5506,12 +5326,6 @@ dependencies = [
"unicode-properties", "unicode-properties",
] ]
[[package]]
name = "strsim"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
[[package]] [[package]]
name = "strsim" name = "strsim"
version = "0.11.1" version = "0.11.1"
@ -6133,15 +5947,6 @@ dependencies = [
"utf-8", "utf-8",
] ]
[[package]]
name = "termcolor"
version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755"
dependencies = [
"winapi-util",
]
[[package]] [[package]]
name = "texting_robots" name = "texting_robots"
version = "0.2.2" version = "0.2.2"
@ -6149,7 +5954,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b82a718a28dda2e67ad6e0464597b58eae39e2e4d0451e03d1028d71e81bb4a" checksum = "5b82a718a28dda2e67ad6e0464597b58eae39e2e4d0451e03d1028d71e81bb4a"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bstr 0.2.17", "bstr",
"lazy_static", "lazy_static",
"nom", "nom",
"percent-encoding", "percent-encoding",
@ -6158,15 +5963,6 @@ dependencies = [
"url", "url",
] ]
[[package]]
name = "textwrap"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
dependencies = [
"unicode-width",
]
[[package]] [[package]]
name = "thin-slice" name = "thin-slice"
version = "0.1.1" version = "0.1.1"
@ -6597,12 +6393,6 @@ version = "1.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202"
[[package]]
name = "unicode-width"
version = "0.1.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af"
[[package]] [[package]]
name = "unicode_categories" name = "unicode_categories"
version = "0.1.1" version = "0.1.1"
@ -6700,12 +6490,6 @@ version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
[[package]]
name = "vec_map"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
[[package]] [[package]]
name = "version-compare" name = "version-compare"
version = "0.2.0" version = "0.2.0"
@ -7581,15 +7365,6 @@ dependencies = [
"markup5ever", "markup5ever",
] ]
[[package]]
name = "yaml-rust"
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85"
dependencies = [
"linked-hash-map",
]
[[package]] [[package]]
name = "yoke" name = "yoke"
version = "0.7.4" version = "0.7.4"

View file

@ -42,9 +42,9 @@ global-hotkey = "0.6.3"
chrono = { version = "0.4.39", features = ["serde"] } chrono = { version = "0.4.39", features = ["serde"] }
log = { version = "0.4.22", features = ["std"] } log = { version = "0.4.22", features = ["std"] }
uuid = "1.11.0" uuid = "1.11.0"
active-win-pos-rs = "0.8.3" active-win-pos-rs = "0.8.4"
include_dir = "0.7.4" include_dir = "0.7.4"
hyperpolyglot = { git = "https://github.com/0pandadev/hyperpolyglot" } # hyperpolyglot = { git = "https://github.com/0pandadev/hyperpolyglot" }
applications = { git = "https://github.com/HuakunShen/applications-rs", branch = "dev" } applications = { git = "https://github.com/HuakunShen/applications-rs", branch = "dev" }
meta_fetcher = "0.1.1" meta_fetcher = "0.1.1"

View file

@ -1,5 +1,5 @@
use base64::{engine::general_purpose::STANDARD, Engine}; use base64::{engine::general_purpose::STANDARD, Engine};
use hyperpolyglot; // use hyperpolyglot;
use lazy_static::lazy_static; use lazy_static::lazy_static;
use rdev::{simulate, EventType, Key}; use rdev::{simulate, EventType, Key};
use regex::Regex; use regex::Regex;
@ -154,7 +154,8 @@ pub fn setup<R: Runtime>(app: &AppHandle<R>) {
return; return;
} }
if let Some(detection) = hyperpolyglot::detect_from_text(&text) { // Temporarily disabled code detection
/*if let Some(detection) = hyperpolyglot::detect_from_text(&text) {
let language = match detection { let language = match detection {
hyperpolyglot::Detection::Heuristics(lang) => lang.to_string(), hyperpolyglot::Detection::Heuristics(lang) => lang.to_string(),
_ => detection.language().to_string(), _ => detection.language().to_string(),
@ -164,7 +165,7 @@ pub fn setup<R: Runtime>(app: &AppHandle<R>) {
pool, pool,
HistoryItem::new(app_name, ContentType::Code, text, None, app_icon, Some(language)) HistoryItem::new(app_name, ContentType::Code, text, None, app_icon, Some(language))
).await; ).await;
} else if crate::utils::commands::detect_color(&text) { } else*/ if crate::utils::commands::detect_color(&text) {
let _ = db::history::add_history_item( let _ = db::history::add_history_item(
pool, pool,
HistoryItem::new(app_name, ContentType::Color, text, None, app_icon, None) HistoryItem::new(app_name, ContentType::Color, text, None, app_icon, None)