mirror of
https://github.com/morluto/rea
synced 2026-10-26 22:28:27 -04:00
fix(javascript): preserve import-equals declaration and export evidence (#2062)
* fix(javascript): retain TypeScript import-equals dependencies * test(mcp): align completion checks with warm provider state * fix(javascript): propagate require origins through exported aliases * fix(javascript): normalize equivalent CTS binding origins --------- Co-authored-by: hhang <169027046+xu91102@users.noreply.github.com>
This commit is contained in:
@@ -471,7 +471,16 @@ const semanticValue: z.ZodType<JavaScriptSemanticValue> = z.lazy(() =>
|
||||
};
|
||||
}),
|
||||
);
|
||||
const origin = z.strictObject({ specifier: z.string(), importedPath: strings });
|
||||
const origin = z
|
||||
.strictObject({
|
||||
specifier: z.string(),
|
||||
importedPath: strings,
|
||||
resolutionMode: z.enum(["import", "require"]).optional(),
|
||||
})
|
||||
.transform(({ resolutionMode, ...rest }) => ({
|
||||
...rest,
|
||||
...(resolutionMode === undefined ? {} : { resolutionMode }),
|
||||
}));
|
||||
const provenance = z.discriminatedUnion("status", [
|
||||
z.strictObject({
|
||||
status: z.literal("module"),
|
||||
@@ -519,15 +528,28 @@ const coverage = z
|
||||
...(resourceLimits === undefined ? {} : { resourceLimits }),
|
||||
};
|
||||
});
|
||||
const moduleLink = z.strictObject({
|
||||
kind: z.enum(["import", "require", "export", "re-export", "commonjs-export"]),
|
||||
specifier: z.string().nullable(),
|
||||
importedName: z.string().nullable(),
|
||||
localName: z.string().nullable(),
|
||||
exportedName: z.string().nullable(),
|
||||
callableId: z.string().nullable(),
|
||||
location: range,
|
||||
});
|
||||
const moduleLink = z
|
||||
.strictObject({
|
||||
resolutionMode: z.enum(["import", "require"]).optional(),
|
||||
kind: z.enum([
|
||||
"import",
|
||||
"type-import",
|
||||
"require",
|
||||
"export",
|
||||
"re-export",
|
||||
"commonjs-export",
|
||||
]),
|
||||
specifier: z.string().nullable(),
|
||||
importedName: z.string().nullable(),
|
||||
localName: z.string().nullable(),
|
||||
exportedName: z.string().nullable(),
|
||||
callableId: z.string().nullable(),
|
||||
location: range,
|
||||
})
|
||||
.transform(({ resolutionMode, ...rest }) => ({
|
||||
...rest,
|
||||
...(resolutionMode === undefined ? {} : { resolutionMode }),
|
||||
}));
|
||||
const definitionKind = z.enum([
|
||||
"import",
|
||||
"variable",
|
||||
|
||||
Reference in New Issue
Block a user