Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

30 changes: 15 additions & 15 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2024"
[dependencies]
clap = { version = "4.5.28", features = ["derive"] }
codegen-sdk-analyzer = { path = "codegen-sdk-analyzer" }
codegen-sdk-cst = { workspace = true , features = ["typescript"]}
codegen-sdk-ast = { workspace = true}
codegen-sdk-common = { workspace = true}
crossbeam = "0.8.4"
glob = "0.3.2"
Expand All @@ -17,21 +17,21 @@ rayon = { workspace = true}
sysinfo = "0.33.1"
rkyv.workspace = true
[features]
# python = [ "codegen-sdk-cst/python"] # TODO: Add python support
typescript = [ "codegen-sdk-cst/typescript"]
tsx = [ "codegen-sdk-cst/tsx"]
jsx = [ "codegen-sdk-cst/jsx"]
javascript = [ "codegen-sdk-cst/typescript"]
json = [ "codegen-sdk-cst/json"]
java = [ "codegen-sdk-cst/java"]
# ruby = [ "codegen-sdk-cst/ruby"]
# rust = [ "codegen-sdk-cst/rust"]
go = [ "codegen-sdk-cst/go"]
# markdown = [ "codegen-sdk-cst/markdown"]
yaml = [ "codegen-sdk-cst/yaml"]
toml = [ "codegen-sdk-cst/toml"]
python = [ "codegen-sdk-ast/python"] # TODO: Add python support
typescript = [ "codegen-sdk-ast/typescript"]
tsx = [ "codegen-sdk-ast/tsx"]
jsx = [ "codegen-sdk-ast/jsx"]
javascript = [ "codegen-sdk-ast/typescript"]
json = [ "codegen-sdk-ast/json"]
java = [ "codegen-sdk-ast/java"]
ruby = [ "codegen-sdk-ast/ruby"]
rust = [ "codegen-sdk-ast/rust"]
go = [ "codegen-sdk-ast/go"]
markdown = [ "codegen-sdk-ast/markdown"]
yaml = [ "codegen-sdk-ast/yaml"]
toml = [ "codegen-sdk-ast/toml"]
ts_query = []
default = ["json", "ts_query", "toml"]
default = ["json", "ts_query", "toml", "typescript"]
[dev-dependencies]
test-log = { workspace = true }
[workspace]
Expand Down
1 change: 1 addition & 0 deletions codegen-sdk-ast/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#![recursion_limit = "512"]
#![allow(unused)]
use codegen_sdk_common::File;
pub use codegen_sdk_common::language::LANGUAGES;
pub use codegen_sdk_cst::*;
use codegen_sdk_macros::include_languages_ast;
pub trait Named {
Expand Down
2 changes: 1 addition & 1 deletion codegen-sdk-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@ yaml = ["dep:tree-sitter-yaml"]
toml = ["dep:tree-sitter-toml-ng"]
markdown = ["dep:tree-sitter-md"]
ts_query = ["dep:tree-sitter-query"]
default = ["all"]
default = []
all = ["python", "typescript", "json", "java", "ts_query", "ruby", "rust", "go", "yaml", "toml"]
2 changes: 1 addition & 1 deletion codegen-sdk-cst-generator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ prettyplease = {workspace = true}
syn = { workspace = true }
tree-sitter = { workspace = true }
log = { workspace = true }
codegen-sdk-common = { workspace = true }
codegen-sdk-common = { workspace = true, features = ["python"]}
anyhow = { workspace = true }
quote = { workspace = true }
proc-macro2 = { workspace = true }
Expand Down
1 change: 1 addition & 0 deletions codegen-sdk-cst/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use codegen_sdk_common::{ParseError, serialize::Cache, traits::CSTNode};
use codegen_sdk_macros::{include_languages, parse_languages};
use rkyv::{api::high::to_bytes_in, from_bytes};
mod language;
pub use codegen_sdk_common::language::LANGUAGES;
pub use language::CSTLanguage;
include_languages!();
pub fn parse_file(
Expand Down
2 changes: 1 addition & 1 deletion codegen-sdk-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ version = "0.1.0"
edition = "2024"

[dependencies]
codegen-sdk-common = { workspace = true }
codegen-sdk-common = { workspace = true, features = ["all"] }
[lib]
proc-macro = true
9 changes: 5 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use std::{path, time::Instant};
use std::{ops::Div, path, time::Instant};

use clap::Parser;
use codegen_sdk_common::{language::LANGUAGES, serialize::Cache, traits::CSTNode};
use codegen_sdk_ast::*;
use codegen_sdk_common::{serialize::Cache, traits::CSTNode};
use glob::glob;
use rayon::prelude::*;
use sysinfo::System;
Expand Down Expand Up @@ -32,7 +33,7 @@ fn parse_file(
if file.is_dir() {
return None;
}
let result = codegen_sdk_cst::parse_file(cache, file);
let result = codegen_sdk_ast::parse_file(cache, file);

return match result {
Ok(program) => Some(program),
Expand Down Expand Up @@ -81,7 +82,7 @@ fn parse_files(dir: String) -> (Vec<Box<dyn CSTNode + Send>>, Vec<String>) {
log::info!(
"{} files cached. {}% of total",
cached,
cached * 100 / files_to_parse.len()
(cached * 100).div(files_to_parse.len())
);
(files, errors)
}
Expand Down