diff --git a/Cargo.lock b/Cargo.lock index 5a84072..0383174 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -87,9 +87,12 @@ checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952" [[package]] name = "cc" -version = "1.1.6" +version = "1.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aba8f4e9906c7ce3c73463f62a7f0c65183ada1a2d47e397cc8810827f9694f" +checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" +dependencies = [ + "shlex", +] [[package]] name = "cfg-if" @@ -509,13 +512,12 @@ dependencies = [ [[package]] name = "protols" -version = "0.6.0" +version = "0.7.0" dependencies = [ "async-lsp", "futures", "hard-xml", "insta", - "protols-tree-sitter-proto", "serde", "tempfile", "tokio", @@ -525,19 +527,10 @@ dependencies = [ "tracing-appender", "tracing-subscriber", "tree-sitter", + "tree-sitter-proto", "walkdir", ] -[[package]] -name = "protols-tree-sitter-proto" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bac092da66e21a71eb832925de7b542f8ac34f75fd05cd2fc3e272863e3fd2b" -dependencies = [ - "cc", - "tree-sitter", -] - [[package]] name = "quote" version = "1.0.36" @@ -558,9 +551,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.5" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" +checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" dependencies = [ "aho-corasick", "memchr", @@ -570,9 +563,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" dependencies = [ "aho-corasick", "memchr", @@ -581,9 +574,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "rustc-demangle" @@ -676,6 +669,12 @@ dependencies = [ "lazy_static", ] +[[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.2" @@ -716,6 +715,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "streaming-iterator" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b2231b7c3057d5e4ad0156fb3dc807d900806020c5ffa3ee6ff2c8c76fb8520" + [[package]] name = "syn" version = "1.0.109" @@ -966,12 +971,31 @@ dependencies = [ [[package]] name = "tree-sitter" -version = "0.22.6" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df7cc499ceadd4dcdf7ec6d4cbc34ece92c3fa07821e287aedecd4416c516dca" +checksum = "f9871f16d6cf5c4757dcf30d5d2172a2df6987c510c017bbb7abfb7f9aa24d06" dependencies = [ "cc", "regex", + "regex-syntax", + "streaming-iterator", + "tree-sitter-language", +] + +[[package]] +name = "tree-sitter-language" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8ddffe35a0e5eeeadf13ff7350af564c6e73993a24db62caee1822b185c2600" + +[[package]] +name = "tree-sitter-proto" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f2795023f9f2c575df39c341c4b137b2d059eab805d13978dce1a2058bbb5c1" +dependencies = [ + "cc", + "tree-sitter-language", ] [[package]] @@ -1061,7 +1085,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index cc113ef..02f507d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "protols" description = "Language server for proto3 files" -version = "0.6.2" +version = "0.7.0" edition = "2021" license = "MIT" homepage = "https://github.com/coder3101/protols" repository = "https://github.com/coder3101/protols" readme = "README.md" -keywords = ["lsp", "proto3"] +keywords = ["lsp", "proto"] exclude = ["assets/*", "sample/*"] @@ -19,9 +19,9 @@ tokio-util = { version = "0.7.11", features = ["compat"] } tower = "0.4.13" tracing = "0.1.40" tracing-subscriber = "0.3.18" -tree-sitter = "0.22.6" +tree-sitter = "0.24.3" tracing-appender = "0.2.3" -protols-tree-sitter-proto = "0.2.0" +tree-sitter-proto = "0.1.0" walkdir = "2.5.0" hard-xml = "1.36.0" tempfile = "3.12.0" diff --git a/README.md b/README.md index cbc1b60..c2c9d6a 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Crates.io](https://img.shields.io/crates/v/protols.svg)](https://crates.io/crates/protols) [![Build and Test](https://github.com/coder3101/protols/actions/workflows/ci.yml/badge.svg)](https://github.com/coder3101/protols/actions/workflows/ci.yml) -**Protols** is an open-source Language Server Protocol (LSP) for **proto3** files, powered by the robust and efficient [tree-sitter](https://tree-sitter.github.io/tree-sitter/) parser. With Protols, you get powerful code assistance for protobuf files, including auto-completion, syntax diagnostics, and more. +**Protols** is an open-source Language Server Protocol (LSP) for **proto** files, powered by the robust and efficient [tree-sitter](https://tree-sitter.github.io/tree-sitter/) parser. With Protols, you get powerful code assistance for protobuf files, including auto-completion, syntax diagnostics, and more. ![](./assets/protols.mov) @@ -73,4 +73,4 @@ Allows renaming of symbols like messages and enums, along with all their usages --- -Protols is designed to supercharge your workflow with **proto3** files. We welcome contributions and feedback from the community! Feel free to check out the [repository](https://github.com/coder3101/protols) and join in on improving this tool! 🎉 +Protols is designed to supercharge your workflow with **proto** files. We welcome contributions and feedback from the community! Feel free to check out the [repository](https://github.com/coder3101/protols) and join in on improving this tool! 🎉 diff --git a/src/parser/mod.rs b/src/parser/mod.rs index 4aa2e81..877c7c8 100644 --- a/src/parser/mod.rs +++ b/src/parser/mod.rs @@ -23,7 +23,7 @@ pub struct ParsedTree { impl ProtoParser { pub fn new() -> Self { let mut parser = tree_sitter::Parser::new(); - if let Err(e) = parser.set_language(&protols_tree_sitter_proto::language()) { + if let Err(e) = parser.set_language(&tree_sitter_proto::LANGUAGE.into()) { panic!("failed to set ts language parser {:?}", e); } Self { parser }