neuroplex 0.3.0 → 0.4.0
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/dist/brain/local.d.ts +2 -0
- package/dist/brain/local.js.map +1 -1
- package/dist/brain/obsidian.js +1 -0
- package/dist/brain/obsidian.js.map +1 -1
- package/dist/cli/index.js +92 -21
- package/dist/cli/index.js.map +1 -1
- package/dist/config/config.d.ts +15 -0
- package/dist/config/config.js +42 -1
- package/dist/config/config.js.map +1 -1
- package/dist/graph/schema.d.ts +2 -1
- package/dist/graph/schema.js +1 -0
- package/dist/graph/schema.js.map +1 -1
- package/dist/mcp/http.js +4 -1
- package/dist/mcp/http.js.map +1 -1
- package/dist/query/queries.js +3 -3
- package/dist/query/queries.js.map +1 -1
- package/dist/scan/assemble.d.ts +15 -0
- package/dist/scan/assemble.js +240 -15
- package/dist/scan/assemble.js.map +1 -1
- package/dist/scan/discover.js +3 -0
- package/dist/scan/discover.js.map +1 -1
- package/dist/scan/extract.js +8 -1
- package/dist/scan/extract.js.map +1 -1
- package/dist/scan/extractors/csharp.d.ts +4 -0
- package/dist/scan/extractors/csharp.js +565 -0
- package/dist/scan/extractors/csharp.js.map +1 -0
- package/dist/scan/extractors/python.js +170 -15
- package/dist/scan/extractors/python.js.map +1 -1
- package/dist/scan/extractors/typescript.js +405 -23
- package/dist/scan/extractors/typescript.js.map +1 -1
- package/dist/scan/parser.js +1 -0
- package/dist/scan/parser.js.map +1 -1
- package/dist/scan/repos.d.ts +38 -0
- package/dist/scan/repos.js +155 -0
- package/dist/scan/repos.js.map +1 -0
- package/dist/scan/scan.d.ts +15 -0
- package/dist/scan/scan.js +26 -16
- package/dist/scan/scan.js.map +1 -1
- package/dist/scan/types.d.ts +36 -1
- package/dist/scan/types.js +2 -1
- package/dist/scan/types.js.map +1 -1
- package/dist/sync/sync.js +37 -16
- package/dist/sync/sync.js.map +1 -1
- package/package.json +1 -1
- package/skills/neuroplex/SKILL.md +10 -0
|
@@ -0,0 +1,565 @@
|
|
|
1
|
+
import { lineRange, namedChildren } from '../parser.js';
|
|
2
|
+
import { emptyExtraction } from '../types.js';
|
|
3
|
+
const TYPE_KINDS = new Map([
|
|
4
|
+
['class_declaration', 'class'],
|
|
5
|
+
['record_declaration', 'class'],
|
|
6
|
+
['struct_declaration', 'class'],
|
|
7
|
+
['interface_declaration', 'interface'],
|
|
8
|
+
['enum_declaration', 'type'],
|
|
9
|
+
]);
|
|
10
|
+
/** Members whose parameters and locals form one variable scope; their calls go to the type. */
|
|
11
|
+
const MEMBER_SCOPES = new Set([
|
|
12
|
+
'constructor_declaration',
|
|
13
|
+
'destructor_declaration',
|
|
14
|
+
'property_declaration',
|
|
15
|
+
'indexer_declaration',
|
|
16
|
+
'operator_declaration',
|
|
17
|
+
'conversion_operator_declaration',
|
|
18
|
+
'event_declaration',
|
|
19
|
+
]);
|
|
20
|
+
const VERB_ATTRIBUTES = new Map([
|
|
21
|
+
['HttpGet', 'GET'],
|
|
22
|
+
['HttpPost', 'POST'],
|
|
23
|
+
['HttpPut', 'PUT'],
|
|
24
|
+
['HttpPatch', 'PATCH'],
|
|
25
|
+
['HttpDelete', 'DELETE'],
|
|
26
|
+
['HttpHead', 'HEAD'],
|
|
27
|
+
['HttpOptions', 'OPTIONS'],
|
|
28
|
+
]);
|
|
29
|
+
const MINIMAL_API = new Map([
|
|
30
|
+
['MapGet', 'GET'],
|
|
31
|
+
['MapPost', 'POST'],
|
|
32
|
+
['MapPut', 'PUT'],
|
|
33
|
+
['MapPatch', 'PATCH'],
|
|
34
|
+
['MapDelete', 'DELETE'],
|
|
35
|
+
['MapMethods', 'ANY'],
|
|
36
|
+
]);
|
|
37
|
+
const CLIENT_METHODS = new Map([
|
|
38
|
+
['GetAsync', 'GET'],
|
|
39
|
+
['GetFromJsonAsync', 'GET'],
|
|
40
|
+
['GetStringAsync', 'GET'],
|
|
41
|
+
['GetStreamAsync', 'GET'],
|
|
42
|
+
['GetByteArrayAsync', 'GET'],
|
|
43
|
+
['PostAsync', 'POST'],
|
|
44
|
+
['PostAsJsonAsync', 'POST'],
|
|
45
|
+
['PutAsync', 'PUT'],
|
|
46
|
+
['PutAsJsonAsync', 'PUT'],
|
|
47
|
+
['PatchAsync', 'PATCH'],
|
|
48
|
+
['PatchAsJsonAsync', 'PATCH'],
|
|
49
|
+
['DeleteAsync', 'DELETE'],
|
|
50
|
+
['DeleteFromJsonAsync', 'DELETE'],
|
|
51
|
+
]);
|
|
52
|
+
const HANDLER_TYPES = new Set(['lambda_expression', 'anonymous_method_expression', 'identifier', 'member_access_expression']);
|
|
53
|
+
const STRING_TYPES = new Set([
|
|
54
|
+
'string_literal',
|
|
55
|
+
'verbatim_string_literal',
|
|
56
|
+
'raw_string_literal',
|
|
57
|
+
'interpolated_string_expression',
|
|
58
|
+
]);
|
|
59
|
+
/** Parents that continue a method chain (`app.MapGet(...).WithName(...)`, `await x.Y()`). */
|
|
60
|
+
const CHAIN_PARENTS = new Set([
|
|
61
|
+
'invocation_expression',
|
|
62
|
+
'member_access_expression',
|
|
63
|
+
'await_expression',
|
|
64
|
+
'parenthesized_expression',
|
|
65
|
+
]);
|
|
66
|
+
const INTERFACE_NAME = /^I[A-Z]/;
|
|
67
|
+
/** Extracts symbols, imports, calls, heritage and HTTP routes from a C# tree. */
|
|
68
|
+
export function extractCSharp(root) {
|
|
69
|
+
return new CSharpExtractor().run(root);
|
|
70
|
+
}
|
|
71
|
+
class CSharpExtractor {
|
|
72
|
+
out = emptyExtraction();
|
|
73
|
+
names = new Set();
|
|
74
|
+
seenCalls = new Set();
|
|
75
|
+
/** `var api = app.MapGroup("/api")` → `api` → `/api`. */
|
|
76
|
+
groups = new Map();
|
|
77
|
+
run(root) {
|
|
78
|
+
this.walk(root, {
|
|
79
|
+
owner: undefined,
|
|
80
|
+
type: undefined,
|
|
81
|
+
typeExported: false,
|
|
82
|
+
inInterface: false,
|
|
83
|
+
controller: undefined,
|
|
84
|
+
scopes: [],
|
|
85
|
+
});
|
|
86
|
+
return this.out;
|
|
87
|
+
}
|
|
88
|
+
walk(node, ctx) {
|
|
89
|
+
switch (node.type) {
|
|
90
|
+
case 'ERROR':
|
|
91
|
+
case 'attribute_list':
|
|
92
|
+
return;
|
|
93
|
+
case 'using_directive':
|
|
94
|
+
this.addUsing(node);
|
|
95
|
+
return;
|
|
96
|
+
case 'method_declaration':
|
|
97
|
+
this.visitMethod(node, ctx);
|
|
98
|
+
return;
|
|
99
|
+
case 'invocation_expression':
|
|
100
|
+
this.visitInvocation(node, ctx);
|
|
101
|
+
return;
|
|
102
|
+
case 'object_creation_expression':
|
|
103
|
+
this.visitCreation(node, ctx);
|
|
104
|
+
break;
|
|
105
|
+
case 'variable_declarator':
|
|
106
|
+
this.trackGroup(node);
|
|
107
|
+
break;
|
|
108
|
+
default:
|
|
109
|
+
if (TYPE_KINDS.has(node.type)) {
|
|
110
|
+
this.visitType(node, ctx);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
if (MEMBER_SCOPES.has(node.type))
|
|
114
|
+
ctx = withScope(ctx, memberScope(node));
|
|
115
|
+
}
|
|
116
|
+
this.walkChildren(node, ctx);
|
|
117
|
+
}
|
|
118
|
+
walkChildren(node, ctx) {
|
|
119
|
+
for (const child of namedChildren(node))
|
|
120
|
+
this.walk(child, ctx);
|
|
121
|
+
}
|
|
122
|
+
// ---- symbols ----
|
|
123
|
+
visitType(node, ctx) {
|
|
124
|
+
const id = node.childForFieldName('name')?.text;
|
|
125
|
+
const kind = TYPE_KINDS.get(node.type);
|
|
126
|
+
if (!id || !kind) {
|
|
127
|
+
this.walkChildren(node, ctx);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
const name = ctx.type ? `${ctx.type}.${id}` : id;
|
|
131
|
+
// Top-level types default to `internal`; nested ones to `private` (public inside interfaces).
|
|
132
|
+
const exported = ctx.type
|
|
133
|
+
? ctx.typeExported && isAccessible(node, ctx.inInterface)
|
|
134
|
+
: isAccessible(node, true);
|
|
135
|
+
this.addSymbol(name, kind, node, exported);
|
|
136
|
+
this.addHeritage(name, node);
|
|
137
|
+
const prefix = attributes(node).find((a) => a.name === 'Route' || a.name === 'RoutePrefix')?.template;
|
|
138
|
+
this.walkChildren(node, {
|
|
139
|
+
owner: name,
|
|
140
|
+
type: name,
|
|
141
|
+
typeExported: exported,
|
|
142
|
+
inInterface: node.type === 'interface_declaration',
|
|
143
|
+
controller: { name: id.replace(/Controller$/, ''), prefix: prefix ?? '' },
|
|
144
|
+
scopes: [{ member: false, types: typeScope(node) }, ...ctx.scopes],
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
visitMethod(node, ctx) {
|
|
148
|
+
const id = node.childForFieldName('name')?.text;
|
|
149
|
+
if (!id || !ctx.type) {
|
|
150
|
+
this.walkChildren(node, ctx);
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
const name = `${ctx.type}.${id}`;
|
|
154
|
+
const exported = ctx.typeExported && isAccessible(node, ctx.inInterface);
|
|
155
|
+
const http = ctx.controller ? actionRoute(node, id, ctx.controller) : undefined;
|
|
156
|
+
this.addSymbol(name, http ? 'route' : 'method', node, exported, http);
|
|
157
|
+
this.walkChildren(node, { ...withScope(ctx, memberScope(node)), owner: name });
|
|
158
|
+
}
|
|
159
|
+
addSymbol(name, kind, node, exported, http) {
|
|
160
|
+
if (this.names.has(name))
|
|
161
|
+
return;
|
|
162
|
+
this.names.add(name);
|
|
163
|
+
this.out.symbols.push({ name, kind, range: lineRange(node), exported, ...(http ? { http } : {}) });
|
|
164
|
+
}
|
|
165
|
+
/** `name`, or `name (2)`, `name (3)`... when already taken in this file. */
|
|
166
|
+
uniqueName(name) {
|
|
167
|
+
if (!this.names.has(name))
|
|
168
|
+
return name;
|
|
169
|
+
let n = 2;
|
|
170
|
+
while (this.names.has(`${name} (${n})`))
|
|
171
|
+
n++;
|
|
172
|
+
return `${name} (${n})`;
|
|
173
|
+
}
|
|
174
|
+
// ---- imports ----
|
|
175
|
+
addUsing(node) {
|
|
176
|
+
if (node.childForFieldName('name'))
|
|
177
|
+
return; // `using A = B;` aliases
|
|
178
|
+
const target = namedChildren(node).find((c) => c.type === 'qualified_name' || c.type === 'identifier');
|
|
179
|
+
if (target)
|
|
180
|
+
this.out.imports.push({ specifier: target.text, bindings: [], line: line(node) });
|
|
181
|
+
}
|
|
182
|
+
// ---- calls, minimal APIs and requests ----
|
|
183
|
+
visitInvocation(node, ctx) {
|
|
184
|
+
const fn = node.childForFieldName('function');
|
|
185
|
+
const target = fn ? callTarget(fn) : undefined;
|
|
186
|
+
if (target && ctx.owner)
|
|
187
|
+
this.addCall(ctx, target, node);
|
|
188
|
+
// Any receiver counts for client calls (`_factory.CreateClient().GetAsync(...)`).
|
|
189
|
+
const member = fn ? memberName(fn) : undefined;
|
|
190
|
+
const method = member ? CLIENT_METHODS.get(member) : undefined;
|
|
191
|
+
const url = method ? firstStringArg(node) : undefined;
|
|
192
|
+
if (method && url !== undefined)
|
|
193
|
+
this.addRequest(ctx, method, url, node);
|
|
194
|
+
const handler = this.addMinimalRoute(node, fn, member);
|
|
195
|
+
for (const child of namedChildren(node)) {
|
|
196
|
+
if (child.type !== 'argument_list') {
|
|
197
|
+
this.walk(child, ctx);
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
for (const arg of namedChildren(child)) {
|
|
201
|
+
const value = argValue(arg);
|
|
202
|
+
if (handler && value?.id === handler.node.id) {
|
|
203
|
+
this.walk(value, { ...withScope(ctx, memberScope(value)), owner: handler.name });
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
this.walk(arg, ctx);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
visitCreation(node, ctx) {
|
|
212
|
+
const type = node.childForFieldName('type');
|
|
213
|
+
const callee = type ? typeName(type) : undefined;
|
|
214
|
+
if (!callee || !ctx.owner)
|
|
215
|
+
return;
|
|
216
|
+
this.addCall(ctx, { callee }, node);
|
|
217
|
+
if (callee !== 'HttpRequestMessage')
|
|
218
|
+
return;
|
|
219
|
+
// `new HttpRequestMessage(HttpMethod.Post, "url")`
|
|
220
|
+
const [methodArg, urlArg] = callArgs(node);
|
|
221
|
+
const url = urlArg ? stringValue(urlArg) : undefined;
|
|
222
|
+
if (url !== undefined)
|
|
223
|
+
this.addRequest(ctx, methodArg ? requestMethod(methodArg) : 'GET', url, node);
|
|
224
|
+
}
|
|
225
|
+
addCall(ctx, target, node) {
|
|
226
|
+
const caller = ctx.owner;
|
|
227
|
+
if (!caller)
|
|
228
|
+
return;
|
|
229
|
+
const key = `${caller}\0${target.callee}\0${target.object ?? ''}`;
|
|
230
|
+
if (this.seenCalls.has(key))
|
|
231
|
+
return;
|
|
232
|
+
this.seenCalls.add(key);
|
|
233
|
+
const objectType = target.object !== undefined && target.object !== 'this'
|
|
234
|
+
? lookupType(ctx.scopes, target.object, target.viaThis === true)
|
|
235
|
+
: undefined;
|
|
236
|
+
this.out.calls.push({
|
|
237
|
+
caller,
|
|
238
|
+
callee: target.callee,
|
|
239
|
+
...(target.object !== undefined ? { object: target.object } : {}),
|
|
240
|
+
...(objectType !== undefined ? { objectType } : {}),
|
|
241
|
+
line: line(node),
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
addRequest(ctx, method, url, node) {
|
|
245
|
+
if (ctx.owner)
|
|
246
|
+
this.out.requests.push({ caller: ctx.owner, method, url, line: line(node) });
|
|
247
|
+
}
|
|
248
|
+
/** `app.MapGet("/x", handler)` → a `GET /x` route symbol; returns the handler that owns its calls. */
|
|
249
|
+
addMinimalRoute(node, fn, callee) {
|
|
250
|
+
const method = callee ? MINIMAL_API.get(callee) : undefined;
|
|
251
|
+
const receiver = memberReceiver(fn);
|
|
252
|
+
const args = callArgs(node);
|
|
253
|
+
const template = args[0] ? stringValue(args[0]) : undefined;
|
|
254
|
+
const handler = args.at(-1);
|
|
255
|
+
if (!method || !receiver || template === undefined || args.length < 2 || !handler)
|
|
256
|
+
return undefined;
|
|
257
|
+
if (!HANDLER_TYPES.has(handler.type))
|
|
258
|
+
return undefined;
|
|
259
|
+
const path = joinPath(this.groupPrefix(receiver), template);
|
|
260
|
+
const name = this.uniqueName(`${method} ${path}`);
|
|
261
|
+
this.addSymbol(name, 'route', statementOf(node), false, { method, path });
|
|
262
|
+
return { name, node: handler };
|
|
263
|
+
}
|
|
264
|
+
trackGroup(declarator) {
|
|
265
|
+
const name = declarator.childForFieldName('name')?.text;
|
|
266
|
+
const value = namedChildren(declarator).at(-1);
|
|
267
|
+
if (!name || value?.type !== 'invocation_expression')
|
|
268
|
+
return;
|
|
269
|
+
const prefix = this.groupPrefix(value);
|
|
270
|
+
if (prefix)
|
|
271
|
+
this.groups.set(name, prefix);
|
|
272
|
+
}
|
|
273
|
+
/** Route prefix of a `MapGroup` receiver: a tracked variable or a `x.MapGroup("/p")` call. */
|
|
274
|
+
groupPrefix(node) {
|
|
275
|
+
if (node.type === 'identifier')
|
|
276
|
+
return this.groups.get(node.text) ?? '';
|
|
277
|
+
if (node.type !== 'invocation_expression')
|
|
278
|
+
return '';
|
|
279
|
+
const fn = node.childForFieldName('function');
|
|
280
|
+
if (fn?.type !== 'member_access_expression' || fn.childForFieldName('name')?.text !== 'MapGroup')
|
|
281
|
+
return '';
|
|
282
|
+
const first = callArgs(node)[0];
|
|
283
|
+
const prefix = first ? stringValue(first) : undefined;
|
|
284
|
+
const receiver = fn.childForFieldName('expression');
|
|
285
|
+
if (prefix === undefined || !receiver)
|
|
286
|
+
return '';
|
|
287
|
+
return joinPath(this.groupPrefix(receiver), prefix);
|
|
288
|
+
}
|
|
289
|
+
// ---- heritage ----
|
|
290
|
+
addHeritage(symbol, node) {
|
|
291
|
+
const bases = namedChildren(node).find((c) => c.type === 'base_list');
|
|
292
|
+
if (!bases)
|
|
293
|
+
return;
|
|
294
|
+
for (const base of namedChildren(bases)) {
|
|
295
|
+
const target = typeName(base);
|
|
296
|
+
if (!target)
|
|
297
|
+
continue;
|
|
298
|
+
const relation = node.type !== 'interface_declaration' && INTERFACE_NAME.test(target) ? 'implements' : 'extends';
|
|
299
|
+
this.out.heritage.push({ symbol, relation, target });
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
// ---- helpers ----
|
|
304
|
+
function line(node) {
|
|
305
|
+
return node.startPosition.row + 1;
|
|
306
|
+
}
|
|
307
|
+
function withScope(ctx, types) {
|
|
308
|
+
return { ...ctx, scopes: [{ member: true, types }, ...ctx.scopes] };
|
|
309
|
+
}
|
|
310
|
+
function modifiers(node) {
|
|
311
|
+
return namedChildren(node)
|
|
312
|
+
.filter((c) => c.type === 'modifier')
|
|
313
|
+
.map((c) => c.text);
|
|
314
|
+
}
|
|
315
|
+
/** `public`/`internal` → true; `private`/`protected` → false; no access modifier → `fallback`. */
|
|
316
|
+
function isAccessible(node, fallback) {
|
|
317
|
+
const mods = modifiers(node);
|
|
318
|
+
if (mods.includes('public') || mods.includes('internal'))
|
|
319
|
+
return true;
|
|
320
|
+
if (mods.includes('private') || mods.includes('protected'))
|
|
321
|
+
return false;
|
|
322
|
+
return fallback;
|
|
323
|
+
}
|
|
324
|
+
/** Simple type name: generics, nullability and namespace qualification dropped. */
|
|
325
|
+
function typeName(node) {
|
|
326
|
+
switch (node.type) {
|
|
327
|
+
case 'identifier':
|
|
328
|
+
case 'predefined_type':
|
|
329
|
+
return node.text;
|
|
330
|
+
case 'generic_name':
|
|
331
|
+
return namedChildren(node).find((c) => c.type === 'identifier')?.text;
|
|
332
|
+
case 'qualified_name':
|
|
333
|
+
case 'alias_qualified_name': {
|
|
334
|
+
const name = node.childForFieldName('name');
|
|
335
|
+
return name ? typeName(name) : undefined;
|
|
336
|
+
}
|
|
337
|
+
case 'nullable_type':
|
|
338
|
+
case 'primary_constructor_base_type': {
|
|
339
|
+
const inner = node.childForFieldName('type') ?? namedChildren(node)[0];
|
|
340
|
+
return inner ? typeName(inner) : undefined;
|
|
341
|
+
}
|
|
342
|
+
default:
|
|
343
|
+
return undefined;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
function addTyped(types, typeNode, nameNode) {
|
|
347
|
+
if (!typeNode || nameNode?.type !== 'identifier' || types.has(nameNode.text))
|
|
348
|
+
return;
|
|
349
|
+
const type = typeName(typeNode);
|
|
350
|
+
if (type)
|
|
351
|
+
types.set(nameNode.text, type);
|
|
352
|
+
}
|
|
353
|
+
/** Variables declared in a variable_declaration (`Foo a, b;`); `var` gives no type. */
|
|
354
|
+
function addDeclaration(types, declaration) {
|
|
355
|
+
const type = declaration.childForFieldName('type');
|
|
356
|
+
if (!type || type.type === 'implicit_type')
|
|
357
|
+
return;
|
|
358
|
+
for (const declarator of namedChildren(declaration)) {
|
|
359
|
+
if (declarator.type === 'variable_declarator')
|
|
360
|
+
addTyped(types, type, declarator.childForFieldName('name'));
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
/** Fields, properties and primary-constructor parameters of a type. */
|
|
364
|
+
function typeScope(node) {
|
|
365
|
+
const types = new Map();
|
|
366
|
+
for (const param of namedChildren(namedChildren(node).find((c) => c.type === 'parameter_list') ?? node)) {
|
|
367
|
+
if (param.type === 'parameter')
|
|
368
|
+
addTyped(types, param.childForFieldName('type'), param.childForFieldName('name'));
|
|
369
|
+
}
|
|
370
|
+
const body = node.childForFieldName('body');
|
|
371
|
+
for (const member of body ? namedChildren(body) : []) {
|
|
372
|
+
if (member.type === 'property_declaration') {
|
|
373
|
+
addTyped(types, member.childForFieldName('type'), member.childForFieldName('name'));
|
|
374
|
+
}
|
|
375
|
+
else if (member.type === 'field_declaration') {
|
|
376
|
+
const declaration = namedChildren(member).find((c) => c.type === 'variable_declaration');
|
|
377
|
+
if (declaration)
|
|
378
|
+
addDeclaration(types, declaration);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
return types;
|
|
382
|
+
}
|
|
383
|
+
/** Parameters and explicitly typed locals anywhere inside a member, lambda or local function. */
|
|
384
|
+
function memberScope(node) {
|
|
385
|
+
const types = new Map();
|
|
386
|
+
const visit = (n) => {
|
|
387
|
+
if (n.type === 'parameter' || n.type === 'declaration_expression') {
|
|
388
|
+
addTyped(types, n.childForFieldName('type'), n.childForFieldName('name'));
|
|
389
|
+
}
|
|
390
|
+
else if (n.type === 'variable_declaration') {
|
|
391
|
+
addDeclaration(types, n);
|
|
392
|
+
}
|
|
393
|
+
else if (n.type === 'foreach_statement') {
|
|
394
|
+
const type = n.childForFieldName('type');
|
|
395
|
+
if (type?.type !== 'implicit_type')
|
|
396
|
+
addTyped(types, type, n.childForFieldName('left'));
|
|
397
|
+
}
|
|
398
|
+
for (const child of namedChildren(n))
|
|
399
|
+
visit(child);
|
|
400
|
+
};
|
|
401
|
+
visit(node);
|
|
402
|
+
return types;
|
|
403
|
+
}
|
|
404
|
+
/** Declared type of `name`: locals and parameters first, then fields (only fields for `this.x`). */
|
|
405
|
+
function lookupType(scopes, name, fieldsOnly) {
|
|
406
|
+
for (const scope of scopes) {
|
|
407
|
+
if (fieldsOnly && scope.member)
|
|
408
|
+
continue;
|
|
409
|
+
const type = scope.types.get(name);
|
|
410
|
+
if (type)
|
|
411
|
+
return type;
|
|
412
|
+
}
|
|
413
|
+
return undefined;
|
|
414
|
+
}
|
|
415
|
+
/** `Foo()`, `obj.Bar()`, `this.Bar()`, `this._x.Bar()`, `obj?.Bar()`; undefined for other shapes. */
|
|
416
|
+
function callTarget(fn) {
|
|
417
|
+
if (fn.type === 'identifier')
|
|
418
|
+
return fn.text === 'nameof' ? undefined : { callee: fn.text };
|
|
419
|
+
if (fn.type === 'generic_name')
|
|
420
|
+
return simpleCallee(fn);
|
|
421
|
+
const receiver = fn.type === 'member_access_expression'
|
|
422
|
+
? fn.childForFieldName('expression')
|
|
423
|
+
: fn.type === 'conditional_access_expression'
|
|
424
|
+
? fn.childForFieldName('condition')
|
|
425
|
+
: null;
|
|
426
|
+
const callee = memberName(fn);
|
|
427
|
+
if (!callee || !receiver)
|
|
428
|
+
return undefined;
|
|
429
|
+
if (receiver.type === 'identifier' || receiver.type === 'this')
|
|
430
|
+
return { callee, object: receiver.text };
|
|
431
|
+
if (receiver.type === 'member_access_expression' && receiver.childForFieldName('expression')?.type === 'this') {
|
|
432
|
+
const field = receiver.childForFieldName('name');
|
|
433
|
+
if (field?.type === 'identifier')
|
|
434
|
+
return { callee, object: field.text, viaThis: true };
|
|
435
|
+
}
|
|
436
|
+
return undefined; // base.M(), a.b.C(), F().G()...
|
|
437
|
+
}
|
|
438
|
+
/** Member name of `x.Name(...)` / `x?.Name(...)`, generic arguments dropped. */
|
|
439
|
+
function memberName(fn) {
|
|
440
|
+
const nameNode = fn.type === 'member_access_expression'
|
|
441
|
+
? fn.childForFieldName('name')
|
|
442
|
+
: fn.type === 'conditional_access_expression'
|
|
443
|
+
? namedChildren(fn).find((c) => c.type === 'member_binding_expression')?.childForFieldName('name')
|
|
444
|
+
: undefined;
|
|
445
|
+
return nameNode ? simpleCallee(nameNode)?.callee : undefined;
|
|
446
|
+
}
|
|
447
|
+
function simpleCallee(node) {
|
|
448
|
+
const name = node.type === 'generic_name' ? namedChildren(node).find((c) => c.type === 'identifier') : node;
|
|
449
|
+
return name?.type === 'identifier' ? { callee: name.text } : undefined;
|
|
450
|
+
}
|
|
451
|
+
/** Receiver of a member call (`app` in `app.MapGet(...)`). */
|
|
452
|
+
function memberReceiver(fn) {
|
|
453
|
+
if (fn?.type !== 'member_access_expression')
|
|
454
|
+
return undefined;
|
|
455
|
+
return fn.childForFieldName('expression') ?? undefined;
|
|
456
|
+
}
|
|
457
|
+
/** Expression of an `argument` node (skipping `name:` labels and `ref`/`out`). */
|
|
458
|
+
function argValue(arg) {
|
|
459
|
+
return namedChildren(arg).at(-1);
|
|
460
|
+
}
|
|
461
|
+
function callArgs(call) {
|
|
462
|
+
const list = call.childForFieldName('arguments') ?? namedChildren(call).find((c) => c.type === 'argument_list');
|
|
463
|
+
if (!list)
|
|
464
|
+
return [];
|
|
465
|
+
return namedChildren(list)
|
|
466
|
+
.filter((a) => a.type === 'argument')
|
|
467
|
+
.map(argValue)
|
|
468
|
+
.filter((v) => v !== undefined);
|
|
469
|
+
}
|
|
470
|
+
function firstStringArg(call) {
|
|
471
|
+
const first = callArgs(call)[0];
|
|
472
|
+
return first ? stringValue(first) : undefined;
|
|
473
|
+
}
|
|
474
|
+
/** Content of a string literal; interpolations become `{}`. Undefined for non-literals. */
|
|
475
|
+
function stringValue(node) {
|
|
476
|
+
if (!STRING_TYPES.has(node.type))
|
|
477
|
+
return undefined;
|
|
478
|
+
if (node.type === 'string_literal')
|
|
479
|
+
return node.text.slice(1, -1);
|
|
480
|
+
if (node.type === 'verbatim_string_literal')
|
|
481
|
+
return node.text.slice(2, -1);
|
|
482
|
+
if (node.type === 'raw_string_literal')
|
|
483
|
+
return node.text.replace(/^"+/, '').replace(/"+$/, '');
|
|
484
|
+
let text = '';
|
|
485
|
+
for (const child of node.children) {
|
|
486
|
+
if (!child)
|
|
487
|
+
continue;
|
|
488
|
+
if (child.type === 'interpolation')
|
|
489
|
+
text += '{}';
|
|
490
|
+
else if (child.isNamed && child.type !== 'interpolation_start' && child.type !== 'interpolation_quote') {
|
|
491
|
+
text += child.text;
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
return text;
|
|
495
|
+
}
|
|
496
|
+
/** `HttpMethod.Post` → `POST`; `new HttpMethod("PATCH")` → `PATCH`; otherwise `GET`. */
|
|
497
|
+
function requestMethod(node) {
|
|
498
|
+
if (node.type === 'member_access_expression') {
|
|
499
|
+
return node.childForFieldName('name')?.text.toUpperCase() ?? 'GET';
|
|
500
|
+
}
|
|
501
|
+
if (node.type === 'object_creation_expression') {
|
|
502
|
+
const first = callArgs(node)[0];
|
|
503
|
+
const literal = first ? stringValue(first) : undefined;
|
|
504
|
+
if (literal)
|
|
505
|
+
return literal.toUpperCase();
|
|
506
|
+
}
|
|
507
|
+
return 'GET';
|
|
508
|
+
}
|
|
509
|
+
/** The statement holding a call chain, or the call itself when it is not a statement. */
|
|
510
|
+
function statementOf(call) {
|
|
511
|
+
let top = call;
|
|
512
|
+
while (top.parent && CHAIN_PARENTS.has(top.parent.type))
|
|
513
|
+
top = top.parent;
|
|
514
|
+
return top.parent?.type === 'expression_statement' ? top.parent : call;
|
|
515
|
+
}
|
|
516
|
+
function attributes(node) {
|
|
517
|
+
const result = [];
|
|
518
|
+
for (const list of namedChildren(node)) {
|
|
519
|
+
if (list.type !== 'attribute_list')
|
|
520
|
+
continue;
|
|
521
|
+
for (const attr of namedChildren(list)) {
|
|
522
|
+
const nameNode = attr.childForFieldName('name');
|
|
523
|
+
const name = nameNode ? typeName(nameNode)?.replace(/Attribute$/, '') : undefined;
|
|
524
|
+
if (!name)
|
|
525
|
+
continue;
|
|
526
|
+
const template = attributeTemplate(attr);
|
|
527
|
+
result.push({ name, ...(template !== undefined ? { template } : {}) });
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
return result;
|
|
531
|
+
}
|
|
532
|
+
function attributeTemplate(attr) {
|
|
533
|
+
const args = namedChildren(attr).find((c) => c.type === 'attribute_argument_list');
|
|
534
|
+
for (const arg of args ? namedChildren(args) : []) {
|
|
535
|
+
const parts = namedChildren(arg);
|
|
536
|
+
const value = parts.at(-1);
|
|
537
|
+
if (!value || value.type === 'assignment_expression')
|
|
538
|
+
continue; // `Name = "x"`, `Order = 1`
|
|
539
|
+
// `template: "x"` names its argument; other labels are not the template.
|
|
540
|
+
if (parts.length > 1 && parts[0]?.text !== 'template')
|
|
541
|
+
continue;
|
|
542
|
+
return stringValue(value);
|
|
543
|
+
}
|
|
544
|
+
return undefined;
|
|
545
|
+
}
|
|
546
|
+
/** HTTP endpoint of a controller action from its `[HttpX]` / `[Route]` attributes. */
|
|
547
|
+
function actionRoute(node, action, controller) {
|
|
548
|
+
const attrs = attributes(node);
|
|
549
|
+
const verb = attrs.find((a) => VERB_ATTRIBUTES.has(a.name));
|
|
550
|
+
const route = attrs.find((a) => a.name === 'Route');
|
|
551
|
+
if (!verb && !route)
|
|
552
|
+
return undefined;
|
|
553
|
+
const method = verb ? (VERB_ATTRIBUTES.get(verb.name) ?? 'ANY') : 'ANY';
|
|
554
|
+
const template = verb?.template ?? route?.template ?? '';
|
|
555
|
+
const absolute = template.startsWith('/') || template.startsWith('~/');
|
|
556
|
+
const raw = absolute ? template.replace(/^~/, '') : joinPath(controller.prefix, template);
|
|
557
|
+
const path = raw.replace(/\[controller\]/gi, controller.name).replace(/\[action\]/gi, action);
|
|
558
|
+
return { method, path: joinPath(path, '') };
|
|
559
|
+
}
|
|
560
|
+
/** Joins route segments: leading `/`, collapsed slashes, no trailing slash (root stays `/`). */
|
|
561
|
+
function joinPath(prefix, template) {
|
|
562
|
+
const path = `/${prefix}/${template}`.replace(/\/+/g, '/');
|
|
563
|
+
return path.length > 1 ? path.replace(/\/$/, '') : path;
|
|
564
|
+
}
|
|
565
|
+
//# sourceMappingURL=csharp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"csharp.js","sourceRoot":"","sources":["../../../src/scan/extractors/csharp.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAmB,MAAM,cAAc,CAAC;AACzE,OAAO,EAAE,eAAe,EAA0C,MAAM,aAAa,CAAC;AAEtF,MAAM,UAAU,GAAG,IAAI,GAAG,CAAqB;IAC7C,CAAC,mBAAmB,EAAE,OAAO,CAAC;IAC9B,CAAC,oBAAoB,EAAE,OAAO,CAAC;IAC/B,CAAC,oBAAoB,EAAE,OAAO,CAAC;IAC/B,CAAC,uBAAuB,EAAE,WAAW,CAAC;IACtC,CAAC,kBAAkB,EAAE,MAAM,CAAC;CAC7B,CAAC,CAAC;AACH,+FAA+F;AAC/F,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC;IAC5B,yBAAyB;IACzB,wBAAwB;IACxB,sBAAsB;IACtB,qBAAqB;IACrB,sBAAsB;IACtB,iCAAiC;IACjC,mBAAmB;CACpB,CAAC,CAAC;AACH,MAAM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