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
4 changes: 2 additions & 2 deletions 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/rpg-core/src/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ impl RPGraph {
}
}
let mut result: Vec<(String, Vec<String>)> = by_file.into_iter().collect();
result.sort_by(|a, b| b.1.len().cmp(&a.1.len()));
result.sort_by_key(|x| std::cmp::Reverse(x.1.len()));
result
}

Expand Down
4 changes: 2 additions & 2 deletions crates/rpg-encoder/src/semantic_lifting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ pub fn apply_features(
pub fn aggregate_module_features(graph: &mut RPGraph) -> usize {
let module_data: Vec<(String, Vec<String>)> = graph
.file_index
.iter()
.filter_map(|(_, ids)| {
.values()
.filter_map(|ids| {
let module_id = ids.iter().find(|id| {
graph
.entities
Expand Down
4 changes: 2 additions & 2 deletions crates/rpg-lift/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl AnthropicProvider {
model: model.unwrap_or_else(|| Self::DEFAULT_MODEL.to_string()),
agent: ureq::Agent::new_with_config(
ureq::config::Config::builder()
.timeout_global(Some(std::time::Duration::from_secs(120)))
.timeout_global(Some(std::time::Duration::from_mins(2)))
.build(),
),
}
Expand Down Expand Up @@ -193,7 +193,7 @@ impl OpenAiProvider {
base_url: base_url.unwrap_or_else(|| Self::DEFAULT_BASE_URL.to_string()),
agent: ureq::Agent::new_with_config(
ureq::config::Config::builder()
.timeout_global(Some(std::time::Duration::from_secs(120)))
.timeout_global(Some(std::time::Duration::from_mins(2)))
.build(),
),
}
Expand Down
6 changes: 3 additions & 3 deletions crates/rpg-mcp/src/tools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1867,10 +1867,10 @@ impl RpgServer {
} else {
cat_node.semantic_features.join(", ")
};
result.push_str(&format!(" - {}/{}: {}\n", area_name, cat_name, cat_feats,));
result.push_str(&format!(" - {}/{}: {}\n", area_name, cat_name, cat_feats));
for sub_name in cat_node.children.keys() {
result
.push_str(&format!(" - {}/{}/{}\n", area_name, cat_name, sub_name,));
.push_str(&format!(" - {}/{}/{}\n", area_name, cat_name, sub_name));
}
}
}
Expand Down Expand Up @@ -2914,7 +2914,7 @@ impl RpgServer {
);

if result.primary_entities.is_empty() {
return Ok(format!("{}No entities found for: {}", notice, params.query,));
return Ok(format!("{}No entities found for: {}", notice, params.query));
}

Ok(format!(
Expand Down
2 changes: 1 addition & 1 deletion crates/rpg-nav/src/cycles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ pub fn detect_cycles(graph: &RPGraph, config: &CycleConfig) -> CycleReport {
stats
})
.collect();
area_breakdown.sort_by(|a, b| b.cycle_count.cmp(&a.cycle_count));
area_breakdown.sort_by_key(|x| std::cmp::Reverse(x.cycle_count));

let areas_in_cycles = area_breakdown.len();

Expand Down
2 changes: 1 addition & 1 deletion crates/rpg-nav/src/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ fn build_hot_spots(graph: &RPGraph, top_n: usize) -> Vec<HotSpot> {
(id.as_str(), connections)
})
.collect();
scored.sort_by(|a, b| b.1.cmp(&a.1));
scored.sort_by_key(|x| std::cmp::Reverse(x.1));

scored
.into_iter()
Expand Down
8 changes: 4 additions & 4 deletions crates/rpg-parser/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ fn generate_lang_registry(defs: &[LangToml]) -> String {
\x20 .filter(|(_, count)| **count > 0)\n\
\x20 .map(|(idx, count)| (Self::from_index(idx), *count))\n\
\x20 .collect();\n\
\x20 langs.sort_by(|a, b| b.1.cmp(&a.1));\n\
\x20 langs.sort_by_key(|x| ::std::cmp::Reverse(x.1));\n\
\x20 langs.into_iter().map(|(lang, _)| lang).collect()\n\
\x20 }\n\n\
\x20 /// Count files per language in the project.\n\
Expand Down Expand Up @@ -373,7 +373,7 @@ fn generate_lang_registry(defs: &[LangToml]) -> String {
);
for def in defs {
if !def.grammar.aliases.is_empty() {
code.push_str(&format!(" \"{}\" => match file_ext {{\n", def.name,));
code.push_str(&format!(" \"{}\" => match file_ext {{\n", def.name));
for alias in &def.grammar.aliases {
let ext_patterns: Vec<String> = alias
.for_extensions
Expand Down Expand Up @@ -429,7 +429,7 @@ fn generate_lang_registry(defs: &[LangToml]) -> String {
if let Some(ref builtin) = def.builtin
&& let Some(ref extractor) = builtin.dep_extractor
{
code.push_str(&format!(" {} => Some(\"{}\"),\n", i, extractor,));
code.push_str(&format!(" {} => Some(\"{}\"),\n", i, extractor));
}
}
code.push_str(" _ => None,\n }\n}\n\n");
Expand All @@ -444,7 +444,7 @@ fn generate_lang_registry(defs: &[LangToml]) -> String {
if let Some(ref builtin) = def.builtin
&& let Some(ref extractor) = builtin.entity_extractor
{
code.push_str(&format!(" {} => Some(\"{}\"),\n", i, extractor,));
code.push_str(&format!(" {} => Some(\"{}\"),\n", i, extractor));
}
}
code.push_str(" _ => None,\n }\n}\n");
Expand Down
29 changes: 13 additions & 16 deletions crates/rpg-parser/src/deps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,22 +360,19 @@ fn collect_rust_calls(
}
}
}
"method_call_expression" | "field_expression" => {
// obj.method() — tree-sitter-rust uses "method_call_expression" for x.foo()
// but some versions nest it differently
if child.kind() == "method_call_expression" {
// The method name is in the "name" field
if let Some(method_node) = child.child_by_field_name("name") {
let callee = source[method_node.byte_range()].to_string();
if !callee.is_empty() {
let call_row = child.start_position().row;
let caller = find_enclosing_scope(scopes, call_row)
.unwrap_or_else(|| "<module>".to_string());
calls.push(CallDep {
caller_entity: caller,
callee,
});
}
"method_call_expression" => {
// obj.method() — tree-sitter-rust uses "method_call_expression" for x.foo().
// The method name is in the "name" field.
if let Some(method_node) = child.child_by_field_name("name") {
let callee = source[method_node.byte_range()].to_string();
if !callee.is_empty() {
let call_row = child.start_position().row;
let caller = find_enclosing_scope(scopes, call_row)
.unwrap_or_else(|| "<module>".to_string());
calls.push(CallDep {
caller_entity: caller,
callee,
});
}
}
}
Expand Down
Loading