Skip to content

Commit

Permalink
Merge pull request #48 from SilasMarvin/silas-update-for-publishing
Browse files Browse the repository at this point in the history
Updates to Crate dependencies and small features
  • Loading branch information
SilasMarvin authored Aug 6, 2024
2 parents 8efa75a + 4b6ec21 commit 75d3972
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/lsp-ai/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ ordered-float = "4.2.1"
futures = "0.3"

[build-dependencies]
cc="*"
cc="1"

[features]
default = ["simsimd", "rayon"]
Expand Down
2 changes: 1 addition & 1 deletion crates/splitter-tree-sitter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ tree-sitter-rust = "0.21"
tree-sitter-zig = { git = "https://github.com/maxxnino/tree-sitter-zig" }

[build-dependencies]
cc="*"
cc="1"
22 changes: 20 additions & 2 deletions crates/utils-tree-sitter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,26 @@ tree-sitter-rust = { version = "0.21", optional = true }
# tree-sitter-zig = { git = "https://github.com/maxxnino/tree-sitter-zig", optional = true }

[build-dependencies]
cc="*"
cc="1"

[features]
default = []
all = ["dep:tree-sitter-python", "dep:tree-sitter-bash", "dep:tree-sitter-c", "dep:tree-sitter-cpp", "dep:tree-sitter-c-sharp", "dep:tree-sitter-css", "dep:tree-sitter-elixir", "dep:tree-sitter-erlang", "dep:tree-sitter-go", "dep:tree-sitter-html", "dep:tree-sitter-java", "dep:tree-sitter-javascript", "dep:tree-sitter-json", "dep:tree-sitter-rust", "dep:tree-sitter-haskell", "dep:tree-sitter-lua", "dep:tree-sitter-ocaml"]
all = ["python", "bash", "c", "cpp", "csharp", "css", "elixir", "erlang", "go", "html", "java", "javascript", "json", "rust", "haskell", "lua", "ocaml"]

python = ["dep:tree-sitter-python"]
bash = ["dep:tree-sitter-bash"]
c = ["dep:tree-sitter-c"]
cpp = ["dep:tree-sitter-cpp"]
csharp = ["dep:tree-sitter-c-sharp"]
css = ["dep:tree-sitter-css"]
elixir = ["dep:tree-sitter-elixir"]
erlang = ["dep:tree-sitter-erlang"]
go = ["dep:tree-sitter-go"]
html = ["dep:tree-sitter-html"]
java = ["dep:tree-sitter-java"]
javascript = ["dep:tree-sitter-javascript"]
json = ["dep:tree-sitter-json"]
rust = ["dep:tree-sitter-rust"]
haskell = ["dep:tree-sitter-haskell"]
lua = ["dep:tree-sitter-lua"]
ocaml = ["dep:tree-sitter-ocaml"]
39 changes: 39 additions & 0 deletions crates/utils-tree-sitter/lsp-ai-chat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
!C I currently have the following in my Cargo.toml

[features]
default = []
all = ["dep:tree-sitter-python", "dep:tree-sitter-bash", "dep:tree-sitter-c", "dep:tree-sitter-cpp", "dep:tree-sitter-c-sharp", "dep:tree-sitter-css", "dep:tree-sitter-elixir", "dep:tree-sitter-erlang", "dep:tree-sitter-go", "dep:tree-sitter-html", "dep:tree-sitter-java", "dep:tree-sitter-javascript", "dep:tree-sitter-json", "dep:tree-sitter-rust", "dep:tree-sitter-haskell", "dep:tree-sitter-lua", "dep:tree-sitter-ocaml"]

Update the features to include a feature for each language that activates its relevant dependency


<|assistant|>
Here's how you can update your `Cargo.toml` to include a feature for each language that activates its relevant dependency:

```toml
[features]
default = []
all = ["python", "bash", "c", "cpp", "csharp", "css", "elixir", "erlang", "go", "html", "java", "javascript", "json", "rust", "haskell", "lua", "ocaml"]

python = ["dep:tree-sitter-python"]
bash = ["dep:tree-sitter-bash"]
c = ["dep:tree-sitter-c"]
cpp = ["dep:tree-sitter-cpp"]
csharp = ["dep:tree-sitter-c-sharp"]
css = ["dep:tree-sitter-css"]
elixir = ["dep:tree-sitter-elixir"]
erlang = ["dep:tree-sitter-erlang"]
go = ["dep:tree-sitter-go"]
html = ["dep:tree-sitter-html"]
java = ["dep:tree-sitter-java"]
javascript = ["dep:tree-sitter-javascript"]
json = ["dep:tree-sitter-json"]
rust = ["dep:tree-sitter-rust"]
haskell = ["dep:tree-sitter-haskell"]
lua = ["dep:tree-sitter-lua"]
ocaml = ["dep:tree-sitter-ocaml"]
```

This setup allows you to enable individual language support or use the `all` feature to enable all languages at once.

<|user|>
2 changes: 1 addition & 1 deletion crates/utils-tree-sitter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pub fn get_parser_for_extension(extension: &str) -> Result<Parser, GetParserErro
"C" => parser.set_language(&tree_sitter_c::language())?,
#[cfg(any(feature = "all", feature = "cpp"))]
"C++" => parser.set_language(&tree_sitter_cpp::language())?,
#[cfg(any(feature = "all", feature = "c-sharp"))]
#[cfg(any(feature = "all", feature = "csharp"))]
"C#" => parser.set_language(&tree_sitter_c_sharp::language())?,
#[cfg(any(feature = "all", feature = "css"))]
"CSS" => parser.set_language(&tree_sitter_css::language())?,
Expand Down

0 comments on commit 75d3972

Please sign in to comment.