From 9ec5b49991d4b41efba2e84f1251bdaccebac224 Mon Sep 17 00:00:00 2001 From: dp-github Date: Sat, 14 Jun 2025 12:07:56 -0600 Subject: [PATCH 1/9] add support for numeric arguments to sbn instruction --- src/instructions.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/instructions.rs b/src/instructions.rs index a870bef..5939db6 100644 --- a/src/instructions.rs +++ b/src/instructions.rs @@ -154,7 +154,7 @@ pub(crate) const INSTRUCTIONS: phf::Map<&'static str, InstructionSignature> = ph "lbns" => InstructionSignature(&[REGISTER, VALUE, VALUE, VALUE, SLOT_LOGIC_TYPE, BATCH_MODE]), "lbs" => InstructionSignature(&[REGISTER, VALUE, VALUE, SLOT_LOGIC_TYPE, BATCH_MODE]), "not" => InstructionSignature(&[REGISTER, VALUE]), - "sbn" => InstructionSignature(&[VALUE, VALUE, LOGIC_TYPE, REGISTER]), + "sbn" => InstructionSignature(&[VALUE, VALUE, LOGIC_TYPE, VALUE]), "sbs" => InstructionSignature(&[VALUE, VALUE, SLOT_LOGIC_TYPE, REGISTER]), "sla" => InstructionSignature(&[REGISTER, VALUE, VALUE]), "sll" => InstructionSignature(&[REGISTER, VALUE, VALUE]), From ca0131ecff5bc53f8b6d7d25c1d0a878c5ca85a1 Mon Sep 17 00:00:00 2001 From: Xandaros Date: Mon, 21 Jul 2025 21:09:17 +0200 Subject: [PATCH 2/9] Create LICENSE --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e5d0bca --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Xandaros + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From 124b91147ace9ea2f447ea675d8b8f1b5f85d2c0 Mon Sep 17 00:00:00 2001 From: Sebastian Bularca Date: Wed, 22 Oct 2025 23:40:54 +0200 Subject: [PATCH 3/9] Added a hack to handle the STR(" ") which skips the syntax check when the STR is found. This should be handled better but maybe later. Added get, getd, put, putd plus the missing documentation --- Cargo.lock | 29 +++++++++++++++++++++-------- Cargo.toml | 3 ++- src/instructions.rs | 23 +++++++++++++++++++++++ src/main.rs | 36 +++++++++++++++++++++++++++++++++--- 4 files changed, 79 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fa10d22..d531168 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,12 +1,12 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "aho-corasick" -version = "0.7.20" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -255,11 +255,12 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "ic10lsp" -version = "0.7.4" +version = "0.7.5" dependencies = [ "clap", "phf", "phf_codegen", + "regex", "serde_json", "tokio", "tower-lsp", @@ -571,9 +572,21 @@ dependencies = [ [[package]] name = "regex" -version = "1.7.2" +version = "1.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12de2eff854e5fa4b1295edd650e227e9d8fb0c9e90b12e7f36d6a6811791a29" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cce168fea28d3e05f158bda4576cf0c844d5045bc2cc3620fa0292ed5bb5814c" +checksum = "49530408a136e16e5b486e883fbb6ba058e8e4e8ae6621a77b048b314336e629" dependencies = [ "aho-corasick", "memchr", @@ -582,9 +595,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.29" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "rustix" diff --git a/Cargo.toml b/Cargo.toml index 575c86d..a6f7203 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ic10lsp" -version = "0.7.4" +version = "0.7.5" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -8,6 +8,7 @@ edition = "2021" [dependencies] clap = { version = "4.1.13", features = ["derive"] } phf = {version="0.11.1", features=["macros"]} +regex = "1.9.3" serde_json = "1.0.94" tokio = {version="1.26.0", features=["full"]} tower-lsp = "0.19.0" diff --git a/src/instructions.rs b/src/instructions.rs index 5939db6..d9d75e2 100644 --- a/src/instructions.rs +++ b/src/instructions.rs @@ -163,6 +163,10 @@ pub(crate) const INSTRUCTIONS: phf::Map<&'static str, InstructionSignature> = ph "snan" => InstructionSignature(&[REGISTER, VALUE]), "snanz" => InstructionSignature(&[REGISTER, VALUE]), "ss" => InstructionSignature(&[DEVICE, VALUE, SLOT_LOGIC_TYPE, REGISTER]), + "get" => InstructionSignature(&[REGISTER, DEVICE, VALUE]), + "getd" => InstructionSignature(&[REGISTER, VALUE, VALUE]), + "put" => InstructionSignature(&[DEVICE, VALUE, VALUE]), + "putd" => InstructionSignature(&[VALUE, VALUE, VALUE]) }; pub(crate) const LOGIC_TYPES: phf::Set<&'static str> = phf_set! { @@ -591,6 +595,10 @@ pub(crate) const INSTRUCTION_DOCS: phf::Map<&'static str, &'static str> = phf_ma "peek" => "Register = the value at the top of the stack", "push" => "Pushes the value of a to the stack at sp and increments sp", "pop" => "Register = the value at the top of the stack and decrements sp", + "get" => "Loads the value in the stack memory at index address on provided device into register r?.", + "getd" => "Loads the value in the stack memory at index address on provided device id into register r?.", + "put" => "Adds the value to the stack memory off the provided device at index address.", + "putd" => "Adds the value to the stack memory off the provided device id at index address", "hcf" => "Halt and catch fire", "select" => "Register = b if a is non-zero, otherwise c", "sleep" => "Pauses execution on the IC for a seconds", @@ -601,6 +609,21 @@ pub(crate) const INSTRUCTION_DOCS: phf::Map<&'static str, &'static str> = phf_ma "acos" => "Returns the angle (radians) whos cosine is the specified value", "atan" => "Returns the angle (radians) whos tan is the specified value", "atan2" => "Returns the angle (radians) whose tangent is the quotient of two specified values: a (y) and b (x)", + "brnan" => "Relative branch to line b if a is not a number (NaN)", + "lbns" => "Loads LogicSlotType from slotIndex from all output network devices with provided type and name hashes using the provide batch mode. Average (0), Sum (1), Minimum (2), Maximum (3). Can use either the word, or the number.", + "sbs" => "Stores register value to LogicSlotType on all output network devices with provided type hash in the provided slot.", + "sra" => "Performs a bitwise arithmetic right shift operation on the binary representation of a value. It shifts the bits to the right and fills the vacated leftmost bits with a copy of the sign bit (the most significant bit).", + "sla" => "Performs a bitwise arithmetic left shift operation on the binary representation of a value. It shifts the bits to the left and fills the vacated rightmost bits with zeros (note that this is indistinguishable from 'sll').", + "sll" => "Performs a bitwise logical left shift operation on the binary representation of a value. It shifts the bits to the left and fills the vacated rightmost bits with zeros.", + "bnan" => "Branch to line b if a is not a number (NaN)", + "lbs" => "Loads LogicSlotType from slotIndex from all output network devices with provided type hash using the provide batch mode. Average (0), Sum (1), Minimum (2), Maximum (3). Can use either the word, or the number.", + "not" => "Performs a bitwise logical NOT operation flipping each bit of the input value, resulting in a binary complement. If a bit is 1, it becomes 0, and if a bit is 0, it becomes 1.", + "snanz" => "Register = 0 if a is NaN, otherwise 1", + "ss" => "Stores register value to device stored in a slot LogicSlotType on device.", + "sbn" => "Stores register value to LogicType on all output network devices with provided type hash and name.", + "srl" => "Performs a bitwise logical right shift operation on the binary representation of a value. It shifts the bits to the right and fills the vacated leftmost bits with zeros", + "snan" => "Register = 1 if a is NaN, otherwise 0", + "lbn" => "Loads LogicType from all output network devices with provided type and name hashes using the provide batch mode. Average (0), Sum (1), Minimum (2), Maximum (3). Can use either the word, or the number." }; pub(crate) const LOGIC_TYPE_DOCS: phf::Map<&'static str, &'static str> = phf_map! { diff --git a/src/main.rs b/src/main.rs index d22b21a..0c10152 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,4 @@ +use regex::Regex; use std::{borrow::Cow, collections::HashMap, fmt::Display, net::Ipv4Addr, sync::Arc}; use phf::phf_set; @@ -1176,14 +1177,14 @@ impl LanguageServer for Backend { } impl Backend { - fn node_at_position<'a>(&'a self, position: Position, tree: &'a Tree) -> Option { + fn node_at_position<'a>(&'a self, position: Position, tree: &'a Tree) -> Option> { self.node_at_range( tower_lsp::lsp_types::Range::new(position.into(), position.into()).into(), tree, ) } - fn node_at_range<'a>(&'a self, range: Range, tree: &'a Tree) -> Option { + fn node_at_range<'a>(&'a self, range: Range, tree: &'a Tree) -> Option> { let root = tree.root_node(); let start = Position::from(range.0.start); let end = Position::from(range.0.end); @@ -1216,7 +1217,7 @@ impl Backend { }); } std::collections::hash_map::Entry::Occupied(mut entry) => { - let mut entry = entry.get_mut(); + let entry = entry.get_mut(); entry.document_data.tree = entry.document_data.parser.parse(&text, None); // TODO entry.document_data.content = text; } @@ -1551,6 +1552,7 @@ impl Backend { let Some(tree) = document.tree.as_ref() else { return; }; + let str_lines_var = str_lines(&document.content); // Syntax errors { @@ -1558,6 +1560,10 @@ impl Backend { let query = Query::new(tree_sitter_ic10::language(), "(ERROR)@error").unwrap(); let captures = cursor.captures(&query, tree.root_node(), document.content.as_bytes()); for (capture, _) in captures { + let line = capture.captures[0].node.start_position().row; + if str_lines_var.contains(&line) { + continue; + } diagnostics.push(Diagnostic::new( Range::from(capture.captures[0].node.range()).into(), Some(DiagnosticSeverity::ERROR), @@ -1580,6 +1586,10 @@ impl Backend { .unwrap(); let captures = cursor.captures(&query, tree.root_node(), document.content.as_bytes()); for (capture, _) in captures { + let line = capture.captures[0].node.start_position().row; + if str_lines_var.contains(&line) { + continue; + } diagnostics.push(Diagnostic::new( Range::from(capture.captures[0].node.range()).into(), Some(DiagnosticSeverity::ERROR), @@ -1830,6 +1840,15 @@ impl Backend { } } + let str_lines_set = str_lines(&document.content); + let diagnostics: Vec<_> = diagnostics + .into_iter() + .filter(|diag| { + let line = diag.range.start.line as usize; + !str_lines_set.contains(&line) + }) + .collect(); + self.client .publish_diagnostics(uri.to_owned(), diagnostics, None) .await; @@ -1881,6 +1900,17 @@ impl<'a> NodeEx for Node<'a> { } } +/// Returns a set of line numbers (0-based) that contain STR(" or STR(' (with optional whitespace) +/// Special case for syntax checking after the introduction of this option with the 2025 Sep 15 update +fn str_lines(content: &str) -> std::collections::HashSet { + let re = Regex::new(r#"STR\s*\(\s*(['\"])"#).unwrap(); + content + .lines() + .enumerate() + .filter_map(|(i, line)| if re.is_match(line) { Some(i) } else { None }) + .collect() +} + #[tokio::main] async fn main() { use clap::Parser as _; From 443116ae7d9bffe3bd2c0b554c32c0f092d7709b Mon Sep 17 00:00:00 2001 From: Sebastian Bularca Date: Thu, 23 Oct 2025 01:23:31 +0200 Subject: [PATCH 4/9] Updated packages to support the new commands --- Cargo.lock | 509 ++++++++++++++++++++++++++++------------------------- Cargo.toml | 8 +- 2 files changed, 278 insertions(+), 239 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d531168..1842060 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11,6 +11,56 @@ dependencies = [ "memchr", ] +[[package]] +name = "anstream" +version = "0.6.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" + +[[package]] +name = "anstyle-parse" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2" +dependencies = [ + "windows-sys 0.60.2", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys 0.60.2", +] + [[package]] name = "async-trait" version = "0.1.67" @@ -19,7 +69,7 @@ checksum = "86ea188f25f0255d8f92797797c97ebf5631fa88178beb1a46fdf5622c9a00e4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.8", + "syn 2.0.108", ] [[package]] @@ -54,9 +104,13 @@ checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" [[package]] name = "cc" -version = "1.0.79" +version = "1.2.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "ac9fe6cdbb24b6ade63616c0a0688e45bb56732262c158df3c0c4bea4ca47cb7" +dependencies = [ + "find-msvc-tools", + "shlex", +] [[package]] name = "cfg-if" @@ -66,39 +120,49 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.1.13" +version = "4.5.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c911b090850d79fc64fe9ea01e28e465f65e821e08813ced95bced72f7a8a9b" +checksum = "0c2cfd7bf8a6017ddaa4e32ffe7403d547790db06bd171c1c53926faab501623" dependencies = [ - "bitflags", + "clap_builder", "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a4c05b9e80c5ccd3a7ef080ad7b6ba7d6fc00a985b8b157197075677c82c7a0" +dependencies = [ + "anstream", + "anstyle", "clap_lex", - "is-terminal", - "once_cell", "strsim", - "termcolor", ] [[package]] name = "clap_derive" -version = "4.1.12" +version = "4.5.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a932373bab67b984c790ddf2c9ca295d8e3af3b7ef92de5a5bacdccdee4b09b" +checksum = "2a0b5487afeab2deb2ff4e03a807ad1a03ac532ff5a2cee5d86884440c7f7671" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.8", + "syn 2.0.108", ] [[package]] name = "clap_lex" -version = "0.3.3" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "033f6b7a4acb1f358c742aaca805c939ee73b4c6209ae4318ec7aca81c42e646" -dependencies = [ - "os_str_bytes", -] +checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" + +[[package]] +name = "colorchoice" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" [[package]] name = "dashmap" @@ -114,25 +178,16 @@ dependencies = [ ] [[package]] -name = "errno" -version = "0.2.8" +name = "fastrand" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" -dependencies = [ - "errno-dragonfly", - "libc", - "winapi", -] +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] -name = "errno-dragonfly" -version = "0.1.2" +name = "find-msvc-tools" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", - "libc", -] +checksum = "52051878f80a721bb68ebfbc930e07b65ba72f2da88968ea5c06fd6ca3d3a127" [[package]] name = "form_urlencoded" @@ -228,24 +283,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - -[[package]] -name = "hermit-abi" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] - -[[package]] -name = "hermit-abi" -version = "0.3.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "httparse" @@ -279,27 +319,10 @@ dependencies = [ ] [[package]] -name = "io-lifetimes" -version = "1.0.9" +name = "is_terminal_polyfill" +version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09270fd4fa1111bc614ed2246c7ef56239a3063d5be0d1ec3b589c505d400aeb" -dependencies = [ - "hermit-abi 0.3.1", - "libc", - "windows-sys", -] - -[[package]] -name = "is-terminal" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8687c819457e979cc940d09cb16e42a1bf70aa6b60a549de6d3a62a0ee90c69e" -dependencies = [ - "hermit-abi 0.3.1", - "io-lifetimes", - "rustix", - "windows-sys", -] +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" [[package]] name = "itoa" @@ -309,15 +332,9 @@ checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" [[package]] name = "libc" -version = "0.2.140" +version = "0.2.177" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" - -[[package]] -name = "linux-raw-sys" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" +checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976" [[package]] name = "lock_api" @@ -329,20 +346,11 @@ dependencies = [ "scopeguard", ] -[[package]] -name = "log" -version = "0.4.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] - [[package]] name = "lsp-types" -version = "0.94.0" +version = "0.94.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b63735a13a1f9cd4f4835223d828ed9c2e35c8c5e61837774399f558b6a1237" +checksum = "c66bfd44a06ae10647fe3f8214762e9369fd4248df1350924b4ef9e770a85ea1" dependencies = [ "bitflags", "serde", @@ -353,30 +361,19 @@ dependencies = [ [[package]] name = "memchr" -version = "2.5.0" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" [[package]] name = "mio" -version = "0.8.6" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" +checksum = "69d83b0086dc8ecf3ce9ae2874b2d1290252e2a30720bea58a5c6639b0092873" dependencies = [ "libc", - "log", "wasi", - "windows-sys", -] - -[[package]] -name = "num_cpus" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" -dependencies = [ - "hermit-abi 0.2.6", - "libc", + "windows-sys 0.61.2", ] [[package]] @@ -386,10 +383,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" [[package]] -name = "os_str_bytes" -version = "6.5.0" +name = "once_cell_polyfill" +version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceedf44fb00f2d1984b0bc98102627ce622e083e49a5bacdb3e514fa4238e267" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" [[package]] name = "parking_lot" @@ -411,7 +408,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-sys", + "windows-sys 0.45.0", ] [[package]] @@ -422,19 +419,20 @@ checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "phf" -version = "0.11.1" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "928c6535de93548188ef63bb7c4036bd415cd8f36ad25af44b9789b2ee72a48c" +checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf" dependencies = [ "phf_macros", "phf_shared", + "serde", ] [[package]] name = "phf_codegen" -version = "0.11.1" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56ac890c5e3ca598bbdeaa99964edb5b0258a583a9eb6ef4e89fc85d9224770" +checksum = "49aa7f9d80421bca176ca8dbfebe668cc7a2684708594ec9f3c0db0805d5d6e1" dependencies = [ "phf_generator", "phf_shared", @@ -442,32 +440,32 @@ dependencies = [ [[package]] name = "phf_generator" -version = "0.11.1" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1181c94580fa345f50f19d738aaa39c0ed30a600d95cb2d3e23f94266f14fbf" +checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737" dependencies = [ + "fastrand", "phf_shared", - "rand", ] [[package]] name = "phf_macros" -version = "0.11.1" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92aacdc5f16768709a569e913f7451034034178b05bdc8acda226659a3dccc66" +checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef" dependencies = [ "phf_generator", "phf_shared", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.108", ] [[package]] name = "phf_shared" -version = "0.11.1" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1fb5f6f826b772a8d4c0394209441e7d37cbbb967ae9c7e0e8134365c9ee676" +checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266" dependencies = [ "siphasher", ] @@ -494,9 +492,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" @@ -530,37 +528,22 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.53" +version = "1.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba466839c78239c09faf015484e5cc04860f88242cff4d03eb038f04b4699b73" +checksum = "8e0f6df8eaa422d97d72edcd152e1451618fed47fabbdbd5a8864167b1d4aff7" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.26" +version = "1.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +checksum = "ce25767e7b499d1b604768e7cde645d14cc8584231ea6b295e9c9eb22c02e1d1" dependencies = [ "proc-macro2", ] -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" - [[package]] name = "redox_syscall" version = "0.2.16" @@ -572,9 +555,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.4" +version = "1.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12de2eff854e5fa4b1295edd650e227e9d8fb0c9e90b12e7f36d6a6811791a29" +checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4" dependencies = [ "aho-corasick", "memchr", @@ -584,9 +567,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.7" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49530408a136e16e5b486e883fbb6ba058e8e4e8ae6621a77b048b314336e629" +checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c" dependencies = [ "aho-corasick", "memchr", @@ -595,23 +578,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.5" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" - -[[package]] -name = "rustix" -version = "0.36.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db4165c9963ab29e422d6c26fbc1d37f15bace6b2810221f9d925023480fcf0e" -dependencies = [ - "bitflags", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys", - "windows-sys", -] +checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" [[package]] name = "ryu" @@ -627,33 +596,45 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "serde" -version = "1.0.158" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "771d4d9c4163ee138805e12c710dd365e4f44be8be0503cb1bb9eb989425d9c9" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.158" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e801c1712f48475582b7696ac71e0ca34ebb30e09338425384269d9717c62cad" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.8", + "syn 2.0.108", ] [[package]] name = "serde_json" -version = "1.0.94" +version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c533a59c9d8a93a09c6ab31f0fd5e5f4dd1b8fc9434804029839884765d04ea" +checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" dependencies = [ "itoa", + "memchr", "ryu", "serde", + "serde_core", ] [[package]] @@ -664,9 +645,15 @@ checksum = "bcec881020c684085e55a25f7fd888954d56609ef363479dc5a1305eb0d40cab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.8", + "syn 2.0.108", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-hook-registry" version = "1.4.1" @@ -678,9 +665,9 @@ dependencies = [ [[package]] name = "siphasher" -version = "0.3.10" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" [[package]] name = "slab" @@ -699,19 +686,19 @@ checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" [[package]] name = "socket2" -version = "0.4.9" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881" dependencies = [ "libc", - "winapi", + "windows-sys 0.60.2", ] [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "syn" @@ -726,24 +713,15 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.8" +version = "2.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc02725fd69ab9f26eab07fad303e2497fad6fb9eba4f96c4d1687bdf704ad9" +checksum = "da58917d35242480a05c2897064da0a80589a2a0476c9a3f2fdc83b53502e917" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] -[[package]] -name = "termcolor" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" -dependencies = [ - "winapi-util", -] - [[package]] name = "tinyvec" version = "1.6.0" @@ -761,33 +739,30 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.26.0" +version = "1.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03201d01c3c27a29c8a5cee5b55a93ddae1ccf6f08f65365c2c918f8c1b76f64" +checksum = "ff360e02eab121e0bc37a2d3b4d4dc622e6eda3a8e5253d5435ecf5bd4c68408" dependencies = [ - "autocfg", "bytes", "libc", - "memchr", "mio", - "num_cpus", "parking_lot", "pin-project-lite", "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys", + "windows-sys 0.61.2", ] [[package]] name = "tokio-macros" -version = "1.8.2" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" +checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.108", ] [[package]] @@ -826,9 +801,9 @@ checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" [[package]] name = "tower-lsp" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b38fb0e6ce037835174256518aace3ca621c4f96383c56bb846cfc11b341910" +checksum = "d4ba052b54a6627628d9b3c34c176e7eda8359b7da9acd497b9f20998d118508" dependencies = [ "async-trait", "auto_impl", @@ -849,13 +824,13 @@ dependencies = [ [[package]] name = "tower-lsp-macros" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34723c06344244474fdde365b76aebef8050bf6be61a935b91ee9ff7c4e91157" +checksum = "84fd902d4e0b9a4b27f2f440108dc034e1758628a9b702f8ec61ad66355422fa" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.108", ] [[package]] @@ -898,9 +873,9 @@ dependencies = [ [[package]] name = "tree-sitter" -version = "0.20.9" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4423c784fe11398ca91e505cdc71356b07b1a924fc8735cfab5333afe3e18bc" +checksum = "e747b1f9b7b931ed39a548c1fae149101497de3c1fc8d9e18c62c1a66c683d3d" dependencies = [ "cc", "regex", @@ -908,9 +883,9 @@ dependencies = [ [[package]] name = "tree-sitter-ic10" -version = "0.5.2" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0989008043f359c280ac8f935cab736530e944dbfbfc0c7fc14070edd84d39e6" +checksum = "771e22497f5762147ad0cb7efa983828a32b1e1786a65d8841cf0ac28448dd2b" dependencies = [ "cc", "tree-sitter", @@ -949,6 +924,12 @@ dependencies = [ "serde", ] +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + [[package]] name = "version_check" version = "0.9.4" @@ -962,43 +943,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" +name = "windows-link" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" [[package]] -name = "winapi-util" -version = "0.1.5" +name = "windows-sys" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" dependencies = [ - "winapi", + "windows-targets 0.42.2", ] [[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" +name = "windows-sys" +version = "0.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.5", +] [[package]] name = "windows-sys" -version = "0.45.0" +version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" dependencies = [ - "windows-targets", + "windows-link", ] [[package]] @@ -1007,13 +981,30 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", ] [[package]] @@ -1022,38 +1013,86 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + [[package]] name = "windows_aarch64_msvc" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + [[package]] name = "windows_i686_gnu" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" +[[package]] +name = "windows_i686_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + [[package]] name = "windows_i686_msvc" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + [[package]] name = "windows_x86_64_gnu" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + [[package]] name = "windows_x86_64_msvc" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" diff --git a/Cargo.toml b/Cargo.toml index a6f7203..cc04156 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,13 +7,13 @@ edition = "2021" [dependencies] clap = { version = "4.1.13", features = ["derive"] } -phf = {version="0.11.1", features=["macros"]} +phf = {version="0.13.1", features=["macros"]} regex = "1.9.3" serde_json = "1.0.94" tokio = {version="1.26.0", features=["full"]} -tower-lsp = "0.19.0" +tower-lsp = "0.20.0" tree-sitter = "0.20.9" -tree-sitter-ic10 = "0.5.2" +tree-sitter-ic10 = "0.6.0" [build-dependencies] -phf_codegen = "0.11.1" +phf_codegen = "0.13.1" From 03864775b6aec065d2894cb1611e6908fe993da8 Mon Sep 17 00:00:00 2001 From: Sebastian Bularca Date: Thu, 23 Oct 2025 09:43:30 +0200 Subject: [PATCH 5/9] Better reggex support for checking STR("") prerproc and fixed a possible build error Extended the line length to a 90 default since that is the IC10 standard --- .claude/settings.local.json | 11 +++++++++++ build.rs | 4 +++- src/main.rs | 9 +++++---- 3 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 .claude/settings.local.json diff --git a/.claude/settings.local.json b/.claude/settings.local.json new file mode 100644 index 0000000..2d207a7 --- /dev/null +++ b/.claude/settings.local.json @@ -0,0 +1,11 @@ +{ + "permissions": { + "allow": [ + "Read(//mnt/d/repos/ic10-language-support/syntaxes/**)", + "Read(//mnt/d/repos/ic10-language-support/**)", + "Bash(cargo --version:*)" + ], + "deny": [], + "ask": [] + } +} diff --git a/build.rs b/build.rs index 2e0bf79..ae0f333 100644 --- a/build.rs +++ b/build.rs @@ -21,7 +21,9 @@ fn main() { let mut it = line.splitn(2, ' '); let hash = it.next().unwrap(); let name = it.next().unwrap(); - map_builder.entry(hash, &format!("\"{}\"", name)); + + let formatted_name = format!("\"{}\"", name); + map_builder.entry(hash, formatted_name); if !check_set.contains(name) { set_builder.entry(name); diff --git a/src/main.rs b/src/main.rs index 0c10152..0ef175b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -175,7 +175,7 @@ impl Default for Configuration { fn default() -> Self { Self { max_lines: 128, - max_columns: 52, + max_columns: 90, //lines can be 90 characters long these days warn_overline_comment: true, warn_overcolumn_comment: false, } @@ -1900,14 +1900,15 @@ impl<'a> NodeEx for Node<'a> { } } -/// Returns a set of line numbers (0-based) that contain STR(" or STR(' (with optional whitespace) +/// Returns a set of line numbers (0-based) that contain STR("") or STR('') (with optional whitespace) /// Special case for syntax checking after the introduction of this option with the 2025 Sep 15 update fn str_lines(content: &str) -> std::collections::HashSet { - let re = Regex::new(r#"STR\s*\(\s*(['\"])"#).unwrap(); + let re1 = Regex::new(r#"STR\s*\(\s*"[^"]*"\s*\)"#).unwrap(); + let re2 = Regex::new(r#"STR\s*\(\s*'[^']*'\s*\)"#).unwrap(); content .lines() .enumerate() - .filter_map(|(i, line)| if re.is_match(line) { Some(i) } else { None }) + .filter_map(|(i, line)| if re1.is_match(line) || re2.is_match(line) { Some(i) } else { None }) .collect() } From 2b2540d9369ae8601b872902f4ad9353b04c3c4d Mon Sep 17 00:00:00 2001 From: Sebastian Bularca Date: Thu, 23 Oct 2025 09:56:41 +0200 Subject: [PATCH 6/9] comment change --- src/main.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 0ef175b..00d7e70 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1900,8 +1900,7 @@ impl<'a> NodeEx for Node<'a> { } } -/// Returns a set of line numbers (0-based) that contain STR("") or STR('') (with optional whitespace) -/// Special case for syntax checking after the introduction of this option with the 2025 Sep 15 update +/// Check for STR(""), STR('') anywhere. I am not sure if it can only appear at the end of a content line fn str_lines(content: &str) -> std::collections::HashSet { let re1 = Regex::new(r#"STR\s*\(\s*"[^"]*"\s*\)"#).unwrap(); let re2 = Regex::new(r#"STR\s*\(\s*'[^']*'\s*\)"#).unwrap(); From 4707279dbfabafc54da571533849aaf3eed3ef1d Mon Sep 17 00:00:00 2001 From: Sebastian Bularca Date: Thu, 23 Oct 2025 10:53:23 +0200 Subject: [PATCH 7/9] removed the agent file --- .claude/settings.local.json | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 .claude/settings.local.json diff --git a/.claude/settings.local.json b/.claude/settings.local.json deleted file mode 100644 index 2d207a7..0000000 --- a/.claude/settings.local.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "permissions": { - "allow": [ - "Read(//mnt/d/repos/ic10-language-support/syntaxes/**)", - "Read(//mnt/d/repos/ic10-language-support/**)", - "Bash(cargo --version:*)" - ], - "deny": [], - "ask": [] - } -} From 487ffb2e08e71df33fdb356526daff87241f1999 Mon Sep 17 00:00:00 2001 From: Sebastian Bularca Date: Fri, 24 Oct 2025 09:13:34 +0200 Subject: [PATCH 8/9] Reverted the regex STR changes and added two more keywords - bdnvl bdnvs --- Cargo.lock | 4 +- Cargo.toml | 2 +- src/instructions.rs | 8 +++- src/main.rs | 110 ++++++++++++++++++++------------------------ 4 files changed, 59 insertions(+), 65 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1842060..669ab67 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -883,9 +883,9 @@ dependencies = [ [[package]] name = "tree-sitter-ic10" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "771e22497f5762147ad0cb7efa983828a32b1e1786a65d8841cf0ac28448dd2b" +checksum = "0195927f1610573035c602024bf13d2cf63f07d44374d168d429cecfd009e26d" dependencies = [ "cc", "tree-sitter", diff --git a/Cargo.toml b/Cargo.toml index cc04156..a6e0298 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ serde_json = "1.0.94" tokio = {version="1.26.0", features=["full"]} tower-lsp = "0.20.0" tree-sitter = "0.20.9" -tree-sitter-ic10 = "0.6.0" +tree-sitter-ic10 = "0.6.1" [build-dependencies] phf_codegen = "0.13.1" diff --git a/src/instructions.rs b/src/instructions.rs index d9d75e2..786a1de 100644 --- a/src/instructions.rs +++ b/src/instructions.rs @@ -166,7 +166,9 @@ pub(crate) const INSTRUCTIONS: phf::Map<&'static str, InstructionSignature> = ph "get" => InstructionSignature(&[REGISTER, DEVICE, VALUE]), "getd" => InstructionSignature(&[REGISTER, VALUE, VALUE]), "put" => InstructionSignature(&[DEVICE, VALUE, VALUE]), - "putd" => InstructionSignature(&[VALUE, VALUE, VALUE]) + "putd" => InstructionSignature(&[VALUE, VALUE, VALUE]), + "bdnvl" => InstructionSignature(&[DEVICE, LOGIC_TYPE, VALUE]), + "bdnvs" => InstructionSignature(&[DEVICE, LOGIC_TYPE, VALUE]), }; pub(crate) const LOGIC_TYPES: phf::Set<&'static str> = phf_set! { @@ -623,7 +625,9 @@ pub(crate) const INSTRUCTION_DOCS: phf::Map<&'static str, &'static str> = phf_ma "sbn" => "Stores register value to LogicType on all output network devices with provided type hash and name.", "srl" => "Performs a bitwise logical right shift operation on the binary representation of a value. It shifts the bits to the right and fills the vacated leftmost bits with zeros", "snan" => "Register = 1 if a is NaN, otherwise 0", - "lbn" => "Loads LogicType from all output network devices with provided type and name hashes using the provide batch mode. Average (0), Sum (1), Minimum (2), Maximum (3). Can use either the word, or the number." + "lbn" => "Loads LogicType from all output network devices with provided type and name hashes using the provide batch mode. Average (0), Sum (1), Minimum (2), Maximum (3). Can use either the word, or the number.", + "bdnvl" => "Branch to line c if the provided logic type is not \'loadable\', that is the device would provide an exception if you tried to use LOAD(\"l\")", + "bdnvs" => "Branch to line c if the provided logic type is not \'storable\', that is the device would provide an exception if you tried to use STORE(\"s\")", }; pub(crate) const LOGIC_TYPE_DOCS: phf::Map<&'static str, &'static str> = phf_map! { diff --git a/src/main.rs b/src/main.rs index 00d7e70..8e951a8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,3 @@ -use regex::Regex; use std::{borrow::Cow, collections::HashMap, fmt::Display, net::Ipv4Addr, sync::Arc}; use phf::phf_set; @@ -709,7 +708,10 @@ impl LanguageServer for Backend { return Ok(None); }; - let Some(instruction_node) = line_node.query("(instruction)@x", file_data.document_data.content.as_bytes()) else { + let Some(instruction_node) = line_node.query( + "(instruction)@x", + file_data.document_data.content.as_bytes(), + ) else { return Ok(None); }; @@ -860,7 +862,9 @@ impl LanguageServer for Backend { return Ok(None); }; - let Some(instruction_node) = line_node.query("(instruction)@x", document.content.as_bytes()) else { + let Some(instruction_node) = + line_node.query("(instruction)@x", document.content.as_bytes()) + else { return Ok(None); }; @@ -936,9 +940,13 @@ impl LanguageServer for Backend { }; 'diagnostics: for diagnostic in params.context.diagnostics { - let Some(line_node) = node.find_parent("line") else { continue 'diagnostics; }; + let Some(line_node) = node.find_parent("line") else { + continue 'diagnostics; + }; - let Some(NumberOrString::String(code)) = diagnostic.code.clone() else {continue;}; + let Some(NumberOrString::String(code)) = diagnostic.code.clone() else { + continue; + }; match code.as_str() { LINT_NUMBER_BATCH_MODE => { let replacement = diagnostic.data.as_ref().unwrap().as_str().unwrap(); @@ -1021,7 +1029,8 @@ impl LanguageServer for Backend { params: GotoDefinitionParams, ) -> Result> { let files = self.files.read().await; - let Some(file_data) = files.get(¶ms.text_document_position_params.text_document.uri) else { + let Some(file_data) = files.get(¶ms.text_document_position_params.text_document.uri) + else { return Err(tower_lsp::jsonrpc::Error::internal_error()); }; let document = &file_data.document_data; @@ -1047,7 +1056,8 @@ impl LanguageServer for Backend { async fn hover(&self, params: HoverParams) -> Result> { let files = self.files.read().await; - let Some(file_data) = files.get(¶ms.text_document_position_params.text_document.uri) else { + let Some(file_data) = files.get(¶ms.text_document_position_params.text_document.uri) + else { return Err(tower_lsp::jsonrpc::Error::internal_error()); }; let document = &file_data.document_data; @@ -1102,7 +1112,7 @@ impl LanguageServer for Backend { } } "operation" => { - let Some(signature) = instructions::INSTRUCTIONS.get(name) else { + let Some(signature) = instructions::INSTRUCTIONS.get(name) else { return Ok(None); }; let mut content = name.to_string(); @@ -1388,19 +1398,19 @@ impl Backend { .utf8_text(document.content.as_bytes()) .unwrap(); let Some(signature) = instructions::INSTRUCTIONS.get(operation) else { - if operation != "define" && operation != "alias" && operation != "label" { - diagnostics.push(Diagnostic::new( - Range::from(operation_node.range()).into(), - Some(DiagnosticSeverity::INFORMATION), - None, - None, - format!("Unsupported instruction"), - None, - None, - )); - } - continue; - }; + if operation != "define" && operation != "alias" && operation != "label" { + diagnostics.push(Diagnostic::new( + Range::from(operation_node.range()).into(), + Some(DiagnosticSeverity::INFORMATION), + None, + None, + format!("Unsupported instruction"), + None, + None, + )); + } + continue; + }; let mut argument_count = 0; let mut tree_cursor = capture.walk(); @@ -1413,11 +1423,11 @@ impl Backend { use instructions::DataType; argument_count = argument_count + 1; let Some(parameter) = parameters.next() else { - if first_superfluous_arg.is_none() { - first_superfluous_arg = Some(operand); - } - continue; - }; + if first_superfluous_arg.is_none() { + first_superfluous_arg = Some(operand); + } + continue; + }; let mut types = Vec::new(); let typ = match operand.named_child(0).unwrap().kind() { @@ -1546,13 +1556,14 @@ impl Backend { let config = self.config.read().await; let files = self.files.read().await; - let Some(file_data) = files.get(uri) else {return;}; + let Some(file_data) = files.get(uri) else { + return; + }; let document = &file_data.document_data; let Some(tree) = document.tree.as_ref() else { return; }; - let str_lines_var = str_lines(&document.content); // Syntax errors { @@ -1560,10 +1571,6 @@ impl Backend { let query = Query::new(tree_sitter_ic10::language(), "(ERROR)@error").unwrap(); let captures = cursor.captures(&query, tree.root_node(), document.content.as_bytes()); for (capture, _) in captures { - let line = capture.captures[0].node.start_position().row; - if str_lines_var.contains(&line) { - continue; - } diagnostics.push(Diagnostic::new( Range::from(capture.captures[0].node.range()).into(), Some(DiagnosticSeverity::ERROR), @@ -1586,10 +1593,6 @@ impl Backend { .unwrap(); let captures = cursor.captures(&query, tree.root_node(), document.content.as_bytes()); for (capture, _) in captures { - let line = capture.captures[0].node.start_position().row; - if str_lines_var.contains(&line) { - continue; - } diagnostics.push(Diagnostic::new( Range::from(capture.captures[0].node.range()).into(), Some(DiagnosticSeverity::ERROR), @@ -1693,7 +1696,8 @@ impl Backend { "bdns", "bdnsal", "bdse", "bdseal", "bap", "bapz", "bapzal", "beq", "beqal", "beqz", "beqzal", "bge", "bgeal", "bgez", "bgezal", "bgt", "bgtal", "bgtz", "bgtzal", "ble", "bleal", "blez", "blezal", "blt", "bltal", "bltz", "bltzal", - "bna", "bnaz", "bnazal", "bne", "bneal", "bnez", "bnezal", "j", "jal" + "bna", "bnaz", "bnazal", "bne", "bneal", "bnez", "bnezal", "j", "jal", "bdnvl", + "bdnvs" ); let mut cursor = QueryCursor::new(); let query = Query::new( @@ -1716,7 +1720,11 @@ impl Backend { } tree_cursor.reset(capture); - let Some(last_operand) = capture.children_by_field_name("operand", &mut tree_cursor).into_iter().last() else { + let Some(last_operand) = capture + .children_by_field_name("operand", &mut tree_cursor) + .into_iter() + .last() + else { continue; }; let last_operand = last_operand.child(0).unwrap(); @@ -1761,7 +1769,8 @@ impl Backend { let Ok(value) = node .utf8_text(document.content.as_bytes()) .unwrap() - .parse::() else { + .parse::() + else { diagnostics.push(Diagnostic { range: Range::from(node.range()).into(), severity: Some(DiagnosticSeverity::ERROR), @@ -1809,7 +1818,8 @@ impl Backend { let Ok(value) = node .utf8_text(document.content.as_bytes()) .unwrap() - .parse::() else { + .parse::() + else { diagnostics.push(Diagnostic { range: Range::from(node.range()).into(), severity: Some(DiagnosticSeverity::ERROR), @@ -1840,15 +1850,6 @@ impl Backend { } } - let str_lines_set = str_lines(&document.content); - let diagnostics: Vec<_> = diagnostics - .into_iter() - .filter(|diag| { - let line = diag.range.start.line as usize; - !str_lines_set.contains(&line) - }) - .collect(); - self.client .publish_diagnostics(uri.to_owned(), diagnostics, None) .await; @@ -1900,17 +1901,6 @@ impl<'a> NodeEx for Node<'a> { } } -/// Check for STR(""), STR('') anywhere. I am not sure if it can only appear at the end of a content line -fn str_lines(content: &str) -> std::collections::HashSet { - let re1 = Regex::new(r#"STR\s*\(\s*"[^"]*"\s*\)"#).unwrap(); - let re2 = Regex::new(r#"STR\s*\(\s*'[^']*'\s*\)"#).unwrap(); - content - .lines() - .enumerate() - .filter_map(|(i, line)| if re1.is_match(line) || re2.is_match(line) { Some(i) } else { None }) - .collect() -} - #[tokio::main] async fn main() { use clap::Parser as _; From 5c102046cf2dd960164d867332bf5d1eb5e1de73 Mon Sep 17 00:00:00 2001 From: Martin Zeller Date: Fri, 24 Oct 2025 16:38:15 +0200 Subject: [PATCH 9/9] Update tree-sitter version --- Cargo.lock | 617 ++++++++++++++++++++++++++++++++-------------------- Cargo.toml | 6 +- src/main.rs | 103 +++++---- 3 files changed, 434 insertions(+), 292 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 669ab67..85c1fb1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -63,44 +63,43 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.67" +version = "0.1.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ea188f25f0255d8f92797797c97ebf5631fa88178beb1a46fdf5622c9a00e4" +checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn", ] [[package]] name = "auto_impl" -version = "1.0.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a8c1df849285fbacd587de7818cc7d13be6cd2cbcd47a04fb1801b0e2706e33" +checksum = "ffdcb70bdbc4d478427380519163274ac86e52916e10f0a8889adf0f96d3fee7" dependencies = [ - "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] -name = "autocfg" -version = "1.1.0" +name = "bitflags" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "1.3.2" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" [[package]] name = "bytes" -version = "1.4.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "cc" @@ -114,9 +113,9 @@ dependencies = [ [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "clap" @@ -149,7 +148,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.108", + "syn", ] [[package]] @@ -166,17 +165,34 @@ checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" [[package]] name = "dashmap" -version = "5.4.0" +version = "5.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "907076dfda823b0b36d2a1bb5f90c96660a5bbcd7729e10727f07858f22c4edc" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if", - "hashbrown", + "hashbrown 0.14.5", "lock_api", "once_cell", "parking_lot_core", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + [[package]] name = "fastrand" version = "2.3.0" @@ -191,18 +207,18 @@ checksum = "52051878f80a721bb68ebfbc930e07b65ba72f2da88968ea5c06fd6ca3d3a127" [[package]] name = "form_urlencoded" -version = "1.1.0" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" dependencies = [ "percent-encoding", ] [[package]] name = "futures" -version = "0.3.27" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531ac96c6ff5fd7c62263c5e3c67a603af4fcaee2e1a0ae5565ba3a11e69e549" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -214,9 +230,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.27" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "164713a5a0dcc3e7b4b1ed7d3b433cabc18025386f9339346e8daf15963cf7ac" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -224,44 +240,44 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.27" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86d7a0c1aa76363dac491de0ee99faf6941128376f1cf96f07db7603b7de69dd" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-io" -version = "0.3.27" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d422fa3cbe3b40dca574ab087abb5bc98258ea57eea3fd6f1fa7162c778b91" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-macro" -version = "0.3.27" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3eb14ed937631bd8b8b8977f2c198443447a8355b6e3ca599f38c975e5a963b6" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] name = "futures-sink" -version = "0.3.27" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec93083a4aecafb2a80a885c9de1f0ccae9dbd32c2bb54b0c3a65690e0b8d2f2" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.27" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd65540d33b37b16542a0438c12e6aeead10d4ac5d05bd3f805b8f35ab592879" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.27" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ef6b17e481503ec85211fed8f39d1970f128935ca1f814cd32ac4a6842e84ab" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -277,9 +293,15 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.12.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + +[[package]] +name = "hashbrown" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d" [[package]] name = "heck" @@ -289,9 +311,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "httparse" -version = "1.8.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[package]] name = "ic10lsp" @@ -308,14 +330,121 @@ dependencies = [ "tree-sitter-ic10", ] +[[package]] +name = "icu_collections" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" +dependencies = [ + "displaydoc", + "potential_utf", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" + +[[package]] +name = "icu_properties" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "potential_utf", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" + +[[package]] +name = "icu_provider" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" +dependencies = [ + "displaydoc", + "icu_locale_core", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + [[package]] name = "idna" -version = "0.3.0" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indexmap" +version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +checksum = "6717a8d2a5a929a1a2eb43a12812498ed141a0bcfb7e8f7844fbdbe4303bba9f" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "equivalent", + "hashbrown 0.16.0", ] [[package]] @@ -326,9 +455,9 @@ checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" [[package]] name = "itoa" -version = "1.0.6" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "libc" @@ -336,13 +465,18 @@ version = "0.2.177" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976" +[[package]] +name = "litemap" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" + [[package]] name = "lock_api" -version = "0.4.9" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" dependencies = [ - "autocfg", "scopeguard", ] @@ -352,7 +486,7 @@ version = "0.94.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c66bfd44a06ae10647fe3f8214762e9369fd4248df1350924b4ef9e770a85ea1" dependencies = [ - "bitflags", + "bitflags 1.3.2", "serde", "serde_json", "serde_repr", @@ -378,9 +512,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.17.1" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "once_cell_polyfill" @@ -390,9 +524,9 @@ checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" dependencies = [ "lock_api", "parking_lot_core", @@ -400,22 +534,22 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.7" +version = "0.9.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-sys 0.45.0", + "windows-link", ] [[package]] name = "percent-encoding" -version = "2.2.0" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "phf" @@ -458,7 +592,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.108", + "syn", ] [[package]] @@ -472,22 +606,22 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.0.12" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.12" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -503,34 +637,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] -name = "proc-macro-error" -version = "1.0.4" +name = "potential_utf" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +checksum = "84df19adbe5b5a0782edcab45899906947ab039ccf4573713735ee7de1e6b08a" dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", + "zerovec", ] [[package]] name = "proc-macro2" -version = "1.0.102" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e0f6df8eaa422d97d72edcd152e1451618fed47fabbdbd5a8864167b1d4aff7" +checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" dependencies = [ "unicode-ident", ] @@ -546,11 +665,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.16" +version = "0.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" dependencies = [ - "bitflags", + "bitflags 2.10.0", ] [[package]] @@ -584,15 +703,15 @@ checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" [[package]] name = "ryu" -version = "1.0.13" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" @@ -621,7 +740,7 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn", ] [[package]] @@ -630,6 +749,7 @@ version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" dependencies = [ + "indexmap", "itoa", "memchr", "ryu", @@ -639,13 +759,13 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.12" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcec881020c684085e55a25f7fd888954d56609ef363479dc5a1305eb0d40cab" +checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn", ] [[package]] @@ -656,9 +776,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "b2a4719bff48cee6b39d12c020eeb490953ad2443b7055bd0b21fca26bd8c28b" dependencies = [ "libc", ] @@ -671,18 +791,15 @@ checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" [[package]] name = "slab" -version = "0.4.8" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" -dependencies = [ - "autocfg", -] +checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" [[package]] name = "smallvec" -version = "1.10.0" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "socket2" @@ -694,6 +811,18 @@ dependencies = [ "windows-sys 0.60.2", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "streaming-iterator" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b2231b7c3057d5e4ad0156fb3dc807d900806020c5ffa3ee6ff2c8c76fb8520" + [[package]] name = "strsim" version = "0.11.1" @@ -702,9 +831,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "syn" -version = "1.0.109" +version = "2.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +checksum = "da58917d35242480a05c2897064da0a80589a2a0476c9a3f2fdc83b53502e917" dependencies = [ "proc-macro2", "quote", @@ -712,31 +841,26 @@ dependencies = [ ] [[package]] -name = "syn" -version = "2.0.108" +name = "synstructure" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da58917d35242480a05c2897064da0a80589a2a0476c9a3f2fdc83b53502e917" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "unicode-ident", + "syn", ] [[package]] -name = "tinyvec" -version = "1.6.0" +name = "tinystr" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" dependencies = [ - "tinyvec_macros", + "displaydoc", + "zerovec", ] -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - [[package]] name = "tokio" version = "1.48.0" @@ -762,21 +886,20 @@ checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn", ] [[package]] name = "tokio-util" -version = "0.7.7" +version = "0.7.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2" +checksum = "14307c986784f72ef81c89db7d9e28d6ac26d16213b109ea501696195e6e3ce5" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", - "tracing", ] [[package]] @@ -795,9 +918,9 @@ dependencies = [ [[package]] name = "tower-layer" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] name = "tower-lsp" @@ -830,22 +953,21 @@ checksum = "84fd902d4e0b9a4b27f2f440108dc034e1758628a9b702f8ec61ad66355422fa" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn", ] [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ - "cfg-if", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -853,70 +975,65 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.23" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] name = "tracing-core" -version = "0.1.30" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" dependencies = [ "once_cell", ] [[package]] name = "tree-sitter" -version = "0.20.10" +version = "0.25.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e747b1f9b7b931ed39a548c1fae149101497de3c1fc8d9e18c62c1a66c683d3d" +checksum = "78f873475d258561b06f1c595d93308a7ed124d9977cb26b148c2084a4a3cc87" dependencies = [ "cc", "regex", + "regex-syntax", + "serde_json", + "streaming-iterator", + "tree-sitter-language", ] [[package]] name = "tree-sitter-ic10" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0195927f1610573035c602024bf13d2cf63f07d44374d168d429cecfd009e26d" +checksum = "9e25547141b800305dee2a552a23eb613d7e4b7d2cd4c55af1819510f04a4e05" dependencies = [ "cc", "tree-sitter", ] [[package]] -name = "unicode-bidi" -version = "0.3.13" +name = "tree-sitter-language" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "c4013970217383f67b18aef68f6fb2e8d409bc5755227092d32efb0422ba24b8" [[package]] name = "unicode-ident" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" - -[[package]] -name = "unicode-normalization" -version = "0.1.22" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" -dependencies = [ - "tinyvec", -] +checksum = "462eeb75aeb73aea900253ce739c8e18a67423fadf006037cd3ff27e82748a06" [[package]] name = "url" -version = "2.3.1" +version = "2.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" dependencies = [ "form_urlencoded", "idna", @@ -925,22 +1042,22 @@ dependencies = [ ] [[package]] -name = "utf8parse" -version = "0.2.2" +name = "utf8_iter" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] -name = "version_check" -version = "0.9.4" +name = "utf8parse" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "windows-link" @@ -948,22 +1065,13 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - [[package]] name = "windows-sys" version = "0.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" dependencies = [ - "windows-targets 0.53.5", + "windows-targets", ] [[package]] @@ -975,21 +1083,6 @@ dependencies = [ "windows-link", ] -[[package]] -name = "windows-targets" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - [[package]] name = "windows-targets" version = "0.53.5" @@ -997,46 +1090,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" dependencies = [ "windows-link", - "windows_aarch64_gnullvm 0.53.1", - "windows_aarch64_msvc 0.53.1", - "windows_i686_gnu 0.53.1", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", "windows_i686_gnullvm", - "windows_i686_msvc 0.53.1", - "windows_x86_64_gnu 0.53.1", - "windows_x86_64_gnullvm 0.53.1", - "windows_x86_64_msvc 0.53.1", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - [[package]] name = "windows_aarch64_msvc" version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - [[package]] name = "windows_i686_gnu" version = "0.53.1" @@ -1051,48 +1126,108 @@ checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" [[package]] name = "windows_i686_msvc" -version = "0.42.2" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" [[package]] -name = "windows_i686_msvc" +name = "windows_x86_64_gnu" version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" [[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" +name = "windows_x86_64_gnullvm" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" [[package]] -name = "windows_x86_64_gnu" +name = "windows_x86_64_msvc" version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" [[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" +name = "writeable" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" [[package]] -name = "windows_x86_64_gnullvm" -version = "0.53.1" +name = "yoke" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" +checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] [[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" +name = "yoke-derive" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" +checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] [[package]] -name = "windows_x86_64_msvc" -version = "0.53.1" +name = "zerofrom" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerotrie" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7aa2bd55086f1ab526693ecbe444205da57e25f4489879da80635a46d90e73b" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/Cargo.toml b/Cargo.toml index a6e0298..8aa8a09 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,10 +10,10 @@ clap = { version = "4.1.13", features = ["derive"] } phf = {version="0.13.1", features=["macros"]} regex = "1.9.3" serde_json = "1.0.94" -tokio = {version="1.26.0", features=["full"]} +tokio = {version="1.48.0", features=["full"]} tower-lsp = "0.20.0" -tree-sitter = "0.20.9" -tree-sitter-ic10 = "0.6.1" +tree-sitter = "0.25.7" +tree-sitter-ic10 = "0.6.2" [build-dependencies] phf_codegen = "0.13.1" diff --git a/src/main.rs b/src/main.rs index 8e951a8..30cecb8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -31,7 +31,7 @@ use tower_lsp::{ }, Client, LanguageServer, LspService, Server, }; -use tree_sitter::{Node, Parser, Query, QueryCursor, Tree}; +use tree_sitter::{Node, Parser, Query, QueryCursor, StreamingIterator as _, Tree}; mod cli; mod instructions; @@ -352,9 +352,10 @@ impl LanguageServer for Backend { }; let mut cursor = QueryCursor::new(); - let query = Query::new(tree_sitter_ic10::language(), "(number)@x").unwrap(); + let query = Query::new(&tree_sitter_ic10::language(), "(number)@x").unwrap(); - for (capture, _) in cursor.captures(&query, tree.root_node(), document.content.as_bytes()) { + let mut captures = cursor.captures(&query, tree.root_node(), document.content.as_bytes()); + while let Some((capture, _)) = captures.next() { let node = capture.captures[0].node; let range = Range::from(node.range()); @@ -416,7 +417,7 @@ impl LanguageServer for Backend { let mut cursor = QueryCursor::new(); let query = Query::new( - tree_sitter_ic10::language(), + &tree_sitter_ic10::language(), "(comment) @comment (instruction (operation)@keyword) (logictype)@string @@ -438,7 +439,8 @@ impl LanguageServer for Backend { let float_idx = query.capture_index_for_name("float").unwrap(); let variable_idx = query.capture_index_for_name("variable").unwrap(); - for (capture, _) in cursor.captures(&query, tree.root_node(), document.content.as_bytes()) { + let mut captures = cursor.captures(&query, tree.root_node(), document.content.as_bytes()); + while let Some((capture, _)) = captures.next() { let node = capture.captures[0].node; let idx = capture.captures[0].index; let start = node.range().start_point; @@ -510,7 +512,7 @@ impl LanguageServer for Backend { let mut cursor = QueryCursor::new(); let query = Query::new( - tree_sitter_ic10::language(), + &tree_sitter_ic10::language(), "(instruction (operation \"define\") . (operand)@name)@define (instruction (operation \"alias\") . (operand)@name)@alias (instruction (operation \"label\") . (operand)@name)@alias @@ -522,9 +524,9 @@ impl LanguageServer for Backend { let label_idx = query.capture_index_for_name("label").unwrap(); let name_idx = query.capture_index_for_name("name").unwrap(); - let matches = cursor.matches(&query, tree.root_node(), document.content.as_bytes()); + let mut matches = cursor.matches(&query, tree.root_node(), document.content.as_bytes()); - for matched in matches { + while let Some(matched) = matches.next() { let main_match = { let mut ret = None; for cap in matched.captures { @@ -1213,7 +1215,7 @@ impl Backend { std::collections::hash_map::Entry::Vacant(entry) => { let mut parser = Parser::new(); parser - .set_language(tree_sitter_ic10::language()) + .set_language(&tree_sitter_ic10::language()) .expect("Could not set language"); let key = entry.key().clone(); entry.insert(FileData { @@ -1249,7 +1251,7 @@ impl Backend { let mut cursor = QueryCursor::new(); let query = Query::new( - tree_sitter_ic10::language(), + &tree_sitter_ic10::language(), "(instruction (operation \"define\"))@define (instruction (operation \"alias\"))@alias (instruction (operation \"label\"))@alias @@ -1261,9 +1263,10 @@ impl Backend { let alias_idx = query.capture_index_for_name("alias").unwrap(); let label_idx = query.capture_index_for_name("label").unwrap(); - let captures = cursor.captures(&query, tree.root_node(), document.content.as_bytes()); + let mut captures = + cursor.captures(&query, tree.root_node(), document.content.as_bytes()); - for (capture, _) in captures { + while let Some((capture, _)) = captures.next() { let capture_idx = capture.captures[0].index; if capture_idx == define_idx || capture_idx == alias_idx { if let Some(name_node) = capture.captures[0].node.child_by_field_name("operand") @@ -1386,11 +1389,11 @@ impl Backend { }; let mut cursor = QueryCursor::new(); - let query = Query::new(tree_sitter_ic10::language(), "(instruction)@a").unwrap(); + let query = Query::new(&tree_sitter_ic10::language(), "(instruction)@a").unwrap(); - let captures = cursor.captures(&query, tree.root_node(), document.content.as_bytes()); + let mut captures = cursor.captures(&query, tree.root_node(), document.content.as_bytes()); - for (capture, _) in captures { + while let Some((capture, _)) = captures.next() { let capture = capture.captures[0].node; if let Some(operation_node) = capture.child_by_field_name("operation") { @@ -1568,9 +1571,10 @@ impl Backend { // Syntax errors { let mut cursor = QueryCursor::new(); - let query = Query::new(tree_sitter_ic10::language(), "(ERROR)@error").unwrap(); - let captures = cursor.captures(&query, tree.root_node(), document.content.as_bytes()); - for (capture, _) in captures { + let query = Query::new(&tree_sitter_ic10::language(), "(ERROR)@error").unwrap(); + let mut captures = + cursor.captures(&query, tree.root_node(), document.content.as_bytes()); + while let Some((capture, _)) = captures.next() { diagnostics.push(Diagnostic::new( Range::from(capture.captures[0].node.range()).into(), Some(DiagnosticSeverity::ERROR), @@ -1587,12 +1591,13 @@ impl Backend { { let mut cursor = QueryCursor::new(); let query = Query::new( - tree_sitter_ic10::language(), + &tree_sitter_ic10::language(), "(instruction (invalid_instruction)@error)", ) .unwrap(); - let captures = cursor.captures(&query, tree.root_node(), document.content.as_bytes()); - for (capture, _) in captures { + let mut captures = + cursor.captures(&query, tree.root_node(), document.content.as_bytes()); + while let Some((capture, _)) = captures.next() { diagnostics.push(Diagnostic::new( Range::from(capture.captures[0].node.range()).into(), Some(DiagnosticSeverity::ERROR), @@ -1612,10 +1617,10 @@ impl Backend { { let mut cursor = QueryCursor::new(); - let query = Query::new(tree_sitter_ic10::language(), "(instruction)@x").unwrap(); - for (capture, _) in - cursor.captures(&query, tree.root_node(), document.content.as_bytes()) - { + let query = Query::new(&tree_sitter_ic10::language(), "(instruction)@x").unwrap(); + let mut captures = + cursor.captures(&query, tree.root_node(), document.content.as_bytes()); + while let Some((capture, _)) = captures.next() { let node = capture.captures[0].node; if node.end_position().column > config.max_columns { diagnostics.push(Diagnostic { @@ -1634,10 +1639,10 @@ impl Backend { } if config.warn_overcolumn_comment { - let query = Query::new(tree_sitter_ic10::language(), "(comment)@x").unwrap(); - for (capture, _) in - cursor.captures(&query, tree.root_node(), document.content.as_bytes()) - { + let query = Query::new(&tree_sitter_ic10::language(), "(comment)@x").unwrap(); + let mut captures = + cursor.captures(&query, tree.root_node(), document.content.as_bytes()); + while let Some((capture, _)) = captures.next() { let node = capture.captures[0].node; if node.end_position().column > config.max_columns { diagnostics.push(Diagnostic { @@ -1660,11 +1665,11 @@ impl Backend { tree_sitter::Point::new(config.max_lines, 0) ..tree_sitter::Point::new(usize::MAX, usize::MAX), ); - let query = Query::new(tree_sitter_ic10::language(), "(instruction)@x").unwrap(); + let query = Query::new(&tree_sitter_ic10::language(), "(instruction)@x").unwrap(); + let mut captures = + cursor.captures(&query, tree.root_node(), document.content.as_bytes()); - for (capture, _) in - cursor.captures(&query, tree.root_node(), document.content.as_bytes()) - { + while let Some((capture, _)) = captures.next() { let node = capture.captures[0].node; diagnostics.push(Diagnostic { range: Range::from(node.range()).into(), @@ -1675,10 +1680,10 @@ impl Backend { } if config.warn_overline_comment { - let query = Query::new(tree_sitter_ic10::language(), "(comment)@x").unwrap(); - for (capture, _) in - cursor.captures(&query, tree.root_node(), document.content.as_bytes()) - { + let query = Query::new(&tree_sitter_ic10::language(), "(comment)@x").unwrap(); + let mut captures = + cursor.captures(&query, tree.root_node(), document.content.as_bytes()); + while let Some((capture, _)) = captures.next() { let node = capture.captures[0].node; diagnostics.push(Diagnostic { range: Range::from(node.range()).into(), @@ -1701,13 +1706,14 @@ impl Backend { ); let mut cursor = QueryCursor::new(); let query = Query::new( - tree_sitter_ic10::language(), + &tree_sitter_ic10::language(), "(instruction operand: (operand (number))) @x", ) .unwrap(); let mut tree_cursor = tree.walk(); - let captures = cursor.captures(&query, tree.root_node(), document.content.as_bytes()); - for (capture, _) in captures { + let mut captures = + cursor.captures(&query, tree.root_node(), document.content.as_bytes()); + while let Some((capture, _)) = captures.next() { let capture = capture.captures[0].node; let Some(operation_node) = capture.child_by_field_name("operation") else { continue; @@ -1747,14 +1753,14 @@ impl Backend { { let mut cursor = QueryCursor::new(); let query = Query::new( - tree_sitter_ic10::language(), + &tree_sitter_ic10::language(), "(instruction (operation)@op (operand (number)@n) .)", ) .unwrap(); - let matches = cursor.matches(&query, tree.root_node(), document.content.as_bytes()); + let mut matches = cursor.matches(&query, tree.root_node(), document.content.as_bytes()); - for query_match in matches { + while let Some(query_match) = matches.next() { { let operation_node = query_match.captures[0].node; let operation_text = operation_node @@ -1805,14 +1811,15 @@ impl Backend { { let mut cursor = QueryCursor::new(); let query = Query::new( - tree_sitter_ic10::language(), + &tree_sitter_ic10::language(), "(instruction (operation \"lr\") . (operand) . (operand) . (operand (number)@n))", ) .unwrap(); - let captures = cursor.captures(&query, tree.root_node(), document.content.as_bytes()); + let mut captures = + cursor.captures(&query, tree.root_node(), document.content.as_bytes()); - for (capture, _) in captures { + while let Some((capture, _)) = captures.next() { let node = capture.captures[0].node; let Ok(value) = node @@ -1890,7 +1897,7 @@ impl<'a> NodeEx for Node<'a> { fn query(&self, query: &str, content: impl AsRef<[u8]>) -> Option> { let mut cursor = QueryCursor::new(); - let query = Query::new(tree_sitter_ic10::language(), query).unwrap(); + let query = Query::new(&tree_sitter_ic10::language(), query).unwrap(); let mut captures = cursor.captures(&query, self.clone(), content.as_ref()); captures @@ -1908,7 +1915,7 @@ async fn main() { let mut parser = Parser::new(); parser - .set_language(tree_sitter_ic10::language()) + .set_language(&tree_sitter_ic10::language()) .expect("Failed to set language"); let (service, socket) = LspService::new(|client| Backend {