gitnexus 1.6.5 → 1.6.6-rc.2
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/_shared/index.d.ts +2 -2
- package/dist/_shared/index.d.ts.map +1 -1
- package/dist/_shared/index.js.map +1 -1
- package/dist/_shared/scope-resolution/registries/context.d.ts +27 -0
- package/dist/_shared/scope-resolution/registries/context.d.ts.map +1 -1
- package/dist/_shared/scope-resolution/registries/context.js.map +1 -1
- package/dist/_shared/scope-resolution/symbol-definition.d.ts +20 -0
- package/dist/_shared/scope-resolution/symbol-definition.d.ts.map +1 -1
- package/dist/core/ingestion/language-provider.d.ts +29 -0
- package/dist/core/ingestion/languages/c-cpp.js +46 -0
- package/dist/core/ingestion/languages/cpp/arity-metadata.d.ts +17 -0
- package/dist/core/ingestion/languages/cpp/arity-metadata.js +51 -2
- package/dist/core/ingestion/languages/cpp/arity.d.ts +4 -1
- package/dist/core/ingestion/languages/cpp/arity.js +4 -1
- package/dist/core/ingestion/languages/cpp/captures.js +73 -0
- package/dist/core/ingestion/languages/cpp/constraint-extractor.d.ts +73 -0
- package/dist/core/ingestion/languages/cpp/constraint-extractor.js +308 -0
- package/dist/core/ingestion/languages/cpp/constraint-filter.d.ts +31 -0
- package/dist/core/ingestion/languages/cpp/constraint-filter.js +135 -0
- package/dist/core/ingestion/languages/cpp/scope-resolver.js +6 -0
- package/dist/core/ingestion/languages/cpp/type-classifier.d.ts +26 -0
- package/dist/core/ingestion/languages/cpp/type-classifier.js +49 -0
- package/dist/core/ingestion/model/symbol-table.d.ts +2 -1
- package/dist/core/ingestion/model/symbol-table.js +3 -0
- package/dist/core/ingestion/parsing-processor.js +35 -2
- package/dist/core/ingestion/scope-extractor.js +63 -0
- package/dist/core/ingestion/scope-resolution/contract/scope-resolver.d.ts +21 -1
- package/dist/core/ingestion/scope-resolution/graph-bridge/ids.d.ts +1 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/ids.js +14 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/node-lookup.js +12 -0
- package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.d.ts +11 -1
- package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.js +50 -21
- package/dist/core/ingestion/scope-resolution/passes/overload-narrowing.d.ts +30 -7
- package/dist/core/ingestion/scope-resolution/passes/overload-narrowing.js +49 -18
- package/dist/core/ingestion/scope-resolution/passes/receiver-bound-calls.d.ts +1 -1
- package/dist/core/ingestion/scope-resolution/passes/receiver-bound-calls.js +10 -4
- package/dist/core/ingestion/scope-resolution/pipeline/run.js +1 -0
- package/dist/core/ingestion/utils/template-arguments.d.ts +19 -0
- package/dist/core/ingestion/utils/template-arguments.js +30 -0
- package/dist/core/ingestion/workers/parse-worker.d.ts +2 -1
- package/dist/core/ingestion/workers/parse-worker.js +1 -0
- package/package.json +1 -1
|
@@ -249,7 +249,10 @@ export function emitReceiverBoundCalls(graph, scopes, parsedFiles, nodeLookup, h
|
|
|
249
249
|
for (const ownerId of chain) {
|
|
250
250
|
const methodOverloads = model.methods.lookupAllByOwner(ownerId, memberName);
|
|
251
251
|
if (methodOverloads.length > 0) {
|
|
252
|
-
const narrowed = narrowOverloadCandidates(methodOverloads, site.arity, site.argumentTypes,
|
|
252
|
+
const narrowed = narrowOverloadCandidates(methodOverloads, site.arity, site.argumentTypes, {
|
|
253
|
+
conversionRankFn: provider.conversionRankFn,
|
|
254
|
+
constraintCompatibility: provider.constraintCompatibility,
|
|
255
|
+
});
|
|
253
256
|
if (isOverloadAmbiguousAfterNormalization(narrowed, site.arity)) {
|
|
254
257
|
ambiguous = true;
|
|
255
258
|
break;
|
|
@@ -467,7 +470,7 @@ export function emitReceiverBoundCalls(graph, scopes, parsedFiles, nodeLookup, h
|
|
|
467
470
|
let memberDef;
|
|
468
471
|
let ambiguous = false;
|
|
469
472
|
for (const ownerId of chain) {
|
|
470
|
-
const picked = pickOverload(ownerId, memberName, site, model, provider
|
|
473
|
+
const picked = pickOverload(ownerId, memberName, site, model, provider);
|
|
471
474
|
if (picked === OVERLOAD_AMBIGUOUS) {
|
|
472
475
|
ambiguous = true;
|
|
473
476
|
break;
|
|
@@ -518,7 +521,7 @@ export function emitReceiverBoundCalls(graph, scopes, parsedFiles, nodeLookup, h
|
|
|
518
521
|
* types when multiple overloads share the name. Falls back to the
|
|
519
522
|
* first-seen def (legacy `findOwnedMember` semantics) when there's
|
|
520
523
|
* no narrowing signal or when `argumentTypes` is unavailable. */
|
|
521
|
-
function pickOverload(ownerId, memberName, site, model,
|
|
524
|
+
function pickOverload(ownerId, memberName, site, model, provider) {
|
|
522
525
|
const overloads = model.methods.lookupAllByOwner(ownerId, memberName);
|
|
523
526
|
if (overloads.length === 0) {
|
|
524
527
|
// Non-callable member (field / property / variable) — ACCESSES
|
|
@@ -528,7 +531,10 @@ function pickOverload(ownerId, memberName, site, model, conversionRankFn) {
|
|
|
528
531
|
}
|
|
529
532
|
if (overloads.length === 1)
|
|
530
533
|
return overloads[0];
|
|
531
|
-
const candidates = narrowOverloadCandidates(overloads, site.arity, site.argumentTypes,
|
|
534
|
+
const candidates = narrowOverloadCandidates(overloads, site.arity, site.argumentTypes, {
|
|
535
|
+
conversionRankFn: provider.conversionRankFn,
|
|
536
|
+
constraintCompatibility: provider.constraintCompatibility,
|
|
537
|
+
});
|
|
532
538
|
// When narrowing leaves >1 candidate that share identical normalized
|
|
533
539
|
// parameter-types (e.g., C++ `f(int)` vs `f(long)` both collapsed to
|
|
534
540
|
// `['int']` by `normalizeCppParamType`), suppress the edge entirely.
|
|
@@ -250,6 +250,7 @@ export function runScopeResolution(input, provider) {
|
|
|
250
250
|
isCallableVisibleFromCaller: provider.isCallableVisibleFromCaller,
|
|
251
251
|
resolveAdlCandidates: provider.resolveAdlCandidates,
|
|
252
252
|
conversionRankFn: provider.conversionRankFn,
|
|
253
|
+
constraintCompatibility: provider.constraintCompatibility,
|
|
253
254
|
});
|
|
254
255
|
const { emitted, skipped } = emitReferencesViaLookup(graph, indexes, referenceIndex, nodeLookup, handledSites);
|
|
255
256
|
const importsEmitted = emitImportEdges(graph, indexes.imports, indexes.scopeTree, provider.importEdgeReason);
|
|
@@ -9,3 +9,22 @@
|
|
|
9
9
|
export declare function extractTemplateArguments(text: string): string[] | undefined;
|
|
10
10
|
export declare function stripTemplateArguments(text: string): string;
|
|
11
11
|
export declare function templateArgumentsIdTag(templateArguments?: readonly string[]): string;
|
|
12
|
+
/**
|
|
13
|
+
* Stable short hash for the opaque `SymbolDefinition.templateConstraints`
|
|
14
|
+
* payload (issue #1579). Two function-template overloads with identical
|
|
15
|
+
* `parameterTypes` but mutually-exclusive SFINAE constraints
|
|
16
|
+
* (`enable_if_t<is_integral_v<T>>` vs `enable_if_t<is_floating_point_v<T>>`)
|
|
17
|
+
* must produce distinct graph node IDs so the constraint-filter step
|
|
18
|
+
* has two candidates to narrow between. Without this they collapse to
|
|
19
|
+
* a single Function node and the SFINAE golden case can only emit one
|
|
20
|
+
* edge regardless of resolver fixes.
|
|
21
|
+
*
|
|
22
|
+
* FNV-1a 32-bit, base36 encoded. Deterministic; non-cryptographic — the
|
|
23
|
+
* tag's job is collision-avoidance among same-name overloads in one
|
|
24
|
+
* file, not security.
|
|
25
|
+
*/
|
|
26
|
+
export declare function constraintsHash(jsonText: string): string;
|
|
27
|
+
/** Build the `~c:<hash>` ID suffix from an opaque constraint payload.
|
|
28
|
+
* Returns empty string when the payload is absent so callers can
|
|
29
|
+
* string-concatenate unconditionally. */
|
|
30
|
+
export declare function templateConstraintsIdTag(payload: unknown): string;
|
|
@@ -63,3 +63,33 @@ export function templateArgumentsIdTag(templateArguments) {
|
|
|
63
63
|
return '';
|
|
64
64
|
return `~${templateArguments.join(',')}`;
|
|
65
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Stable short hash for the opaque `SymbolDefinition.templateConstraints`
|
|
68
|
+
* payload (issue #1579). Two function-template overloads with identical
|
|
69
|
+
* `parameterTypes` but mutually-exclusive SFINAE constraints
|
|
70
|
+
* (`enable_if_t<is_integral_v<T>>` vs `enable_if_t<is_floating_point_v<T>>`)
|
|
71
|
+
* must produce distinct graph node IDs so the constraint-filter step
|
|
72
|
+
* has two candidates to narrow between. Without this they collapse to
|
|
73
|
+
* a single Function node and the SFINAE golden case can only emit one
|
|
74
|
+
* edge regardless of resolver fixes.
|
|
75
|
+
*
|
|
76
|
+
* FNV-1a 32-bit, base36 encoded. Deterministic; non-cryptographic — the
|
|
77
|
+
* tag's job is collision-avoidance among same-name overloads in one
|
|
78
|
+
* file, not security.
|
|
79
|
+
*/
|
|
80
|
+
export function constraintsHash(jsonText) {
|
|
81
|
+
let h = 0x811c9dc5;
|
|
82
|
+
for (let i = 0; i < jsonText.length; i++) {
|
|
83
|
+
h ^= jsonText.charCodeAt(i);
|
|
84
|
+
h = Math.imul(h, 0x01000193);
|
|
85
|
+
}
|
|
86
|
+
return (h >>> 0).toString(36);
|
|
87
|
+
}
|
|
88
|
+
/** Build the `~c:<hash>` ID suffix from an opaque constraint payload.
|
|
89
|
+
* Returns empty string when the payload is absent so callers can
|
|
90
|
+
* string-concatenate unconditionally. */
|
|
91
|
+
export function templateConstraintsIdTag(payload) {
|
|
92
|
+
if (payload === undefined || payload === null)
|
|
93
|
+
return '';
|
|
94
|
+
return `~c:${constraintsHash(JSON.stringify(payload))}`;
|
|
95
|
+
}
|
|
@@ -3,7 +3,7 @@ import type { ExtractedHeritage } from '../model/heritage-map.js';
|
|
|
3
3
|
import { type MixedChainStep } from '../utils/call-analysis.js';
|
|
4
4
|
import type { ConstructorBinding } from '../type-env.js';
|
|
5
5
|
import type { NamedBinding } from '../named-bindings/types.js';
|
|
6
|
-
import type { NodeLabel } from '../../../_shared/index.js';
|
|
6
|
+
import type { NodeLabel, ParameterTypeClass } from '../../../_shared/index.js';
|
|
7
7
|
import type { ParsedFile } from '../../../_shared/index.js';
|
|
8
8
|
interface ParsedNode {
|
|
9
9
|
id: string;
|
|
@@ -38,6 +38,7 @@ interface ParsedSymbol {
|
|
|
38
38
|
parameterCount?: number;
|
|
39
39
|
requiredParameterCount?: number;
|
|
40
40
|
parameterTypes?: string[];
|
|
41
|
+
parameterTypeClasses?: ParameterTypeClass[];
|
|
41
42
|
returnType?: string;
|
|
42
43
|
declaredType?: string;
|
|
43
44
|
templateArguments?: string[];
|
|
@@ -1801,6 +1801,7 @@ const processFileGroup = (files, language, queryString, result, onFileProcessed)
|
|
|
1801
1801
|
parameterCount: methodProps.parameterCount,
|
|
1802
1802
|
requiredParameterCount: methodProps.requiredParameterCount,
|
|
1803
1803
|
parameterTypes: methodProps.parameterTypes,
|
|
1804
|
+
parameterTypeClasses: methodProps.parameterTypeClasses,
|
|
1804
1805
|
returnType: methodProps.returnType,
|
|
1805
1806
|
...(declaredType !== undefined ? { declaredType } : {}),
|
|
1806
1807
|
...(classTemplateArguments !== undefined && classTemplateArguments.length > 0
|
package/package.json
CHANGED