ucn 3.7.23 → 3.7.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/output.js +10 -3
- package/core/project.js +15 -2
- package/package.json +1 -1
package/core/output.js
CHANGED
|
@@ -974,11 +974,11 @@ function formatPlan(plan, options = {}) {
|
|
|
974
974
|
return 'Function not found.';
|
|
975
975
|
}
|
|
976
976
|
if (!plan.found) {
|
|
977
|
-
if (plan.error) {
|
|
978
|
-
return `Error: ${plan.error}\nCurrent parameters: ${plan.currentParams?.join(', ') || 'none'}`;
|
|
979
|
-
}
|
|
980
977
|
return `Function "${plan.function}" not found.`;
|
|
981
978
|
}
|
|
979
|
+
if (plan.error) {
|
|
980
|
+
return `Error: ${plan.error}\nCurrent parameters: ${plan.currentParams?.join(', ') || 'none'}`;
|
|
981
|
+
}
|
|
982
982
|
|
|
983
983
|
const lines = [];
|
|
984
984
|
|
|
@@ -2161,6 +2161,13 @@ function formatPlanJson(plan) {
|
|
|
2161
2161
|
...(plan.currentParams && { currentParams: plan.currentParams })
|
|
2162
2162
|
}, null, 2);
|
|
2163
2163
|
}
|
|
2164
|
+
if (plan.error) {
|
|
2165
|
+
return JSON.stringify({
|
|
2166
|
+
found: true,
|
|
2167
|
+
error: plan.error,
|
|
2168
|
+
...(plan.currentParams && { currentParams: plan.currentParams })
|
|
2169
|
+
}, null, 2);
|
|
2170
|
+
}
|
|
2164
2171
|
|
|
2165
2172
|
return JSON.stringify({
|
|
2166
2173
|
found: true,
|
package/core/project.js
CHANGED
|
@@ -3669,15 +3669,28 @@ class ProjectIndex {
|
|
|
3669
3669
|
newSignature = `${name}(${paramsList})`;
|
|
3670
3670
|
if (def.returnType) newSignature += `: ${def.returnType}`;
|
|
3671
3671
|
|
|
3672
|
+
// For Python/Rust methods, self/cls/&self/&mut self is in paramsStructured
|
|
3673
|
+
// but callers don't pass it. Adjust paramIndex to caller-side position.
|
|
3674
|
+
const fileEntry = this.files.get(def.file);
|
|
3675
|
+
const lang = fileEntry?.language;
|
|
3676
|
+
let selfOffset = 0;
|
|
3677
|
+
if ((lang === 'python' || lang === 'rust') && currentParams.length > 0) {
|
|
3678
|
+
const firstName = currentParams[0].name;
|
|
3679
|
+
if (firstName === 'self' || firstName === 'cls' || firstName === '&self' || firstName === '&mut self') {
|
|
3680
|
+
selfOffset = 1;
|
|
3681
|
+
}
|
|
3682
|
+
}
|
|
3683
|
+
const callerArgIndex = paramIndex - selfOffset;
|
|
3684
|
+
|
|
3672
3685
|
// Describe changes at each call site
|
|
3673
3686
|
for (const fileGroup of impact.byFile) {
|
|
3674
3687
|
for (const site of fileGroup.sites) {
|
|
3675
|
-
if (site.args && site.argCount >
|
|
3688
|
+
if (site.args && site.argCount > callerArgIndex) {
|
|
3676
3689
|
changes.push({
|
|
3677
3690
|
file: site.file,
|
|
3678
3691
|
line: site.line,
|
|
3679
3692
|
expression: site.expression,
|
|
3680
|
-
suggestion: `Remove argument ${
|
|
3693
|
+
suggestion: `Remove argument ${callerArgIndex + 1}: ${site.args[callerArgIndex] || '?'}`,
|
|
3681
3694
|
args: site.args
|
|
3682
3695
|
});
|
|
3683
3696
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ucn",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.24",
|
|
4
4
|
"mcpName": "io.github.mleoca/ucn",
|
|
5
5
|
"description": "Universal Code Navigator — AST-based call graph analysis for AI agents. Find callers, trace impact, detect dead code across JS/TS, Python, Go, Rust, Java, and HTML. CLI, MCP server, and agent skill.",
|
|
6
6
|
"main": "index.js",
|