From c15a44cf1391889b937f92902489b8332bb64909 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Thu, 24 Oct 2024 13:41:14 -0700 Subject: [PATCH 1/6] Fix use of tree-sitter binding due to change in crate --- dsc_lib/src/parser/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dsc_lib/src/parser/mod.rs b/dsc_lib/src/parser/mod.rs index b0440b2f..69a10808 100644 --- a/dsc_lib/src/parser/mod.rs +++ b/dsc_lib/src/parser/mod.rs @@ -26,7 +26,7 @@ impl Statement { /// This function will return an error if the underlying parser fails to initialize. pub fn new() -> Result { let mut parser = Parser::new(); - parser.set_language(&tree_sitter_dscexpression::LANGUAGE.into())?; + parser.set_language(&tree_sitter_dscexpression::language())?; let function_dispatcher = FunctionDispatcher::new(); Ok(Self { parser, From 7c2efeae9fdafc7cb04ed6cc9ba3361636cad6a2 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Thu, 24 Oct 2024 14:21:38 -0700 Subject: [PATCH 2/6] specify tree-sitter-rust dependency explicitly to get version that resolves language change --- dsc/Cargo.lock | 11 +++++++++++ dsc_lib/Cargo.lock | 11 +++++++++++ tools/test_group_resource/Cargo.lock | 11 +++++++++++ tree-sitter-dscexpression/Cargo.lock | 11 +++++++++++ tree-sitter-dscexpression/Cargo.toml | 3 ++- 5 files changed, 46 insertions(+), 1 deletion(-) diff --git a/dsc/Cargo.lock b/dsc/Cargo.lock index ef6004e5..188680f3 100644 --- a/dsc/Cargo.lock +++ b/dsc/Cargo.lock @@ -1876,6 +1876,7 @@ dependencies = [ "cc", "tree-sitter", "tree-sitter-language", + "tree-sitter-rust", ] [[package]] @@ -1884,6 +1885,16 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8ddffe35a0e5eeeadf13ff7350af564c6e73993a24db62caee1822b185c2600" +[[package]] +name = "tree-sitter-rust" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cffbbcb780348fbae8395742ae5b34c1fd794e4085d43aac9f259387f9a84dc8" +dependencies = [ + "cc", + "tree-sitter-language", +] + [[package]] name = "unicode-bidi" version = "0.3.17" diff --git a/dsc_lib/Cargo.lock b/dsc_lib/Cargo.lock index 6ed62eb1..855bbeed 100644 --- a/dsc_lib/Cargo.lock +++ b/dsc_lib/Cargo.lock @@ -1475,6 +1475,7 @@ dependencies = [ "cc", "tree-sitter", "tree-sitter-language", + "tree-sitter-rust", ] [[package]] @@ -1483,6 +1484,16 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8ddffe35a0e5eeeadf13ff7350af564c6e73993a24db62caee1822b185c2600" +[[package]] +name = "tree-sitter-rust" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cffbbcb780348fbae8395742ae5b34c1fd794e4085d43aac9f259387f9a84dc8" +dependencies = [ + "cc", + "tree-sitter-language", +] + [[package]] name = "unicode-bidi" version = "0.3.17" diff --git a/tools/test_group_resource/Cargo.lock b/tools/test_group_resource/Cargo.lock index 1b4df837..69ded569 100644 --- a/tools/test_group_resource/Cargo.lock +++ b/tools/test_group_resource/Cargo.lock @@ -1486,6 +1486,7 @@ dependencies = [ "cc", "tree-sitter", "tree-sitter-language", + "tree-sitter-rust", ] [[package]] @@ -1494,6 +1495,16 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8ddffe35a0e5eeeadf13ff7350af564c6e73993a24db62caee1822b185c2600" +[[package]] +name = "tree-sitter-rust" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cffbbcb780348fbae8395742ae5b34c1fd794e4085d43aac9f259387f9a84dc8" +dependencies = [ + "cc", + "tree-sitter-language", +] + [[package]] name = "unicode-bidi" version = "0.3.17" diff --git a/tree-sitter-dscexpression/Cargo.lock b/tree-sitter-dscexpression/Cargo.lock index d6afaa84..1689b8e6 100644 --- a/tree-sitter-dscexpression/Cargo.lock +++ b/tree-sitter-dscexpression/Cargo.lock @@ -87,6 +87,7 @@ dependencies = [ "cc", "tree-sitter", "tree-sitter-language", + "tree-sitter-rust", ] [[package]] @@ -94,3 +95,13 @@ name = "tree-sitter-language" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8ddffe35a0e5eeeadf13ff7350af564c6e73993a24db62caee1822b185c2600" + +[[package]] +name = "tree-sitter-rust" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cffbbcb780348fbae8395742ae5b34c1fd794e4085d43aac9f259387f9a84dc8" +dependencies = [ + "cc", + "tree-sitter-language", +] diff --git a/tree-sitter-dscexpression/Cargo.toml b/tree-sitter-dscexpression/Cargo.toml index a085a5ae..8467568c 100644 --- a/tree-sitter-dscexpression/Cargo.toml +++ b/tree-sitter-dscexpression/Cargo.toml @@ -22,6 +22,7 @@ path = "bindings/rust/lib.rs" [dependencies] tree-sitter = "0.24.3" tree-sitter-language = "0.1.2" +tree-sitter-rust = "0.23.0" [build-dependencies] -cc = "1.1.29" +cc = "1.1" From e5dd00aa479bce3d966decf3389ae4fec5679c68 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Thu, 24 Oct 2024 14:38:06 -0700 Subject: [PATCH 3/6] try setting dependency first --- tree-sitter-dscexpression/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tree-sitter-dscexpression/Cargo.toml b/tree-sitter-dscexpression/Cargo.toml index 8467568c..99b0961f 100644 --- a/tree-sitter-dscexpression/Cargo.toml +++ b/tree-sitter-dscexpression/Cargo.toml @@ -20,9 +20,9 @@ include = [ path = "bindings/rust/lib.rs" [dependencies] +tree-sitter-rust = "0.23.0" tree-sitter = "0.24.3" tree-sitter-language = "0.1.2" -tree-sitter-rust = "0.23.0" [build-dependencies] cc = "1.1" From b11481b799ed4e15f3ea80f7325604391b525746 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Thu, 24 Oct 2024 14:43:51 -0700 Subject: [PATCH 4/6] update version and explicitly add tree-sitter-rust to dsc_lib --- dsc/Cargo.lock | 3 ++- dsc/Cargo.toml | 2 +- dsc_lib/Cargo.lock | 1 + dsc_lib/Cargo.toml | 3 ++- tools/test_group_resource/Cargo.lock | 1 + tree-sitter-dscexpression/Cargo.toml | 2 +- 6 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dsc/Cargo.lock b/dsc/Cargo.lock index 188680f3..96e38a4c 100644 --- a/dsc/Cargo.lock +++ b/dsc/Cargo.lock @@ -469,7 +469,7 @@ dependencies = [ [[package]] name = "dsc" -version = "3.0.0-preview.11" +version = "3.0.0-rc.1" dependencies = [ "clap", "clap_complete", @@ -517,6 +517,7 @@ dependencies = [ "tracing-indicatif", "tree-sitter", "tree-sitter-dscexpression", + "tree-sitter-rust", ] [[package]] diff --git a/dsc/Cargo.toml b/dsc/Cargo.toml index b0bdd9ca..5b1c6428 100644 --- a/dsc/Cargo.toml +++ b/dsc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dsc" -version = "3.0.0-preview.11" +version = "3.0.0-rc.1" edition = "2021" [profile.release] diff --git a/dsc_lib/Cargo.lock b/dsc_lib/Cargo.lock index 855bbeed..7750672d 100644 --- a/dsc_lib/Cargo.lock +++ b/dsc_lib/Cargo.lock @@ -391,6 +391,7 @@ dependencies = [ "tracing-indicatif", "tree-sitter", "tree-sitter-dscexpression", + "tree-sitter-rust", ] [[package]] diff --git a/dsc_lib/Cargo.toml b/dsc_lib/Cargo.toml index f4a2cfd7..1babf7df 100644 --- a/dsc_lib/Cargo.toml +++ b/dsc_lib/Cargo.toml @@ -25,10 +25,11 @@ tokio = { version = "1.40.0", features = ["full"] } tracing = "0.1.37" tracing-indicatif = { version = "0.3.6" } tree-sitter = "0.24.3" +tree-sitter-rust = "0.23.0" tree-sitter-dscexpression = { path = "../tree-sitter-dscexpression" } [dev-dependencies] serde_yaml = "0.9.3" [build-dependencies] -cc="1.1.30" +cc="1.1" diff --git a/tools/test_group_resource/Cargo.lock b/tools/test_group_resource/Cargo.lock index 69ded569..16638746 100644 --- a/tools/test_group_resource/Cargo.lock +++ b/tools/test_group_resource/Cargo.lock @@ -391,6 +391,7 @@ dependencies = [ "tracing-indicatif", "tree-sitter", "tree-sitter-dscexpression", + "tree-sitter-rust", ] [[package]] diff --git a/tree-sitter-dscexpression/Cargo.toml b/tree-sitter-dscexpression/Cargo.toml index 99b0961f..cfd39fa4 100644 --- a/tree-sitter-dscexpression/Cargo.toml +++ b/tree-sitter-dscexpression/Cargo.toml @@ -20,8 +20,8 @@ include = [ path = "bindings/rust/lib.rs" [dependencies] -tree-sitter-rust = "0.23.0" tree-sitter = "0.24.3" +tree-sitter-rust = "0.23.0" tree-sitter-language = "0.1.2" [build-dependencies] From 8e85617d78eeaa69ec1a5ff15802f931e482fdd3 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Thu, 24 Oct 2024 14:58:54 -0700 Subject: [PATCH 5/6] update edition year for tree-sitter-dscexpression --- tree-sitter-dscexpression/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tree-sitter-dscexpression/Cargo.toml b/tree-sitter-dscexpression/Cargo.toml index cfd39fa4..2ec36032 100644 --- a/tree-sitter-dscexpression/Cargo.toml +++ b/tree-sitter-dscexpression/Cargo.toml @@ -5,7 +5,7 @@ version = "1.0.0" keywords = ["incremental", "parsing", "DSCExpression"] categories = ["parsing", "text-editors"] repository = "https://github.com/powershell/dsc" -edition = "2018" +edition = "2021" license = "MIT" build = "bindings/rust/build.rs" From 60061ce5fab79e2b13395f5f11eacb72611d5d6e Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Thu, 24 Oct 2024 15:15:29 -0700 Subject: [PATCH 6/6] revert back binding change since the generated code uses the LANGUAGE syntax --- dsc_lib/src/parser/mod.rs | 2 +- tree-sitter-dscexpression/Cargo.lock | 4 ++-- tree-sitter-dscexpression/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dsc_lib/src/parser/mod.rs b/dsc_lib/src/parser/mod.rs index 69a10808..b0440b2f 100644 --- a/dsc_lib/src/parser/mod.rs +++ b/dsc_lib/src/parser/mod.rs @@ -26,7 +26,7 @@ impl Statement { /// This function will return an error if the underlying parser fails to initialize. pub fn new() -> Result { let mut parser = Parser::new(); - parser.set_language(&tree_sitter_dscexpression::language())?; + parser.set_language(&tree_sitter_dscexpression::LANGUAGE.into())?; let function_dispatcher = FunctionDispatcher::new(); Ok(Self { parser, diff --git a/tree-sitter-dscexpression/Cargo.lock b/tree-sitter-dscexpression/Cargo.lock index 1689b8e6..0e3d508f 100644 --- a/tree-sitter-dscexpression/Cargo.lock +++ b/tree-sitter-dscexpression/Cargo.lock @@ -28,9 +28,9 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "regex" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", diff --git a/tree-sitter-dscexpression/Cargo.toml b/tree-sitter-dscexpression/Cargo.toml index 2ec36032..6d2d2c20 100644 --- a/tree-sitter-dscexpression/Cargo.toml +++ b/tree-sitter-dscexpression/Cargo.toml @@ -20,8 +20,8 @@ include = [ path = "bindings/rust/lib.rs" [dependencies] -tree-sitter = "0.24.3" tree-sitter-rust = "0.23.0" +tree-sitter = "0.24.3" tree-sitter-language = "0.1.2" [build-dependencies]