mirror of
https://github.com/morluto/rea
synced 2026-10-27 14:42:18 -04:00
fix(javascript): preserve semantic query identity and source coverage
This commit is contained in:
@@ -34,6 +34,18 @@ export interface JavaScriptArtifactFile {
|
||||
};
|
||||
}
|
||||
|
||||
/** Producer text exclusions shared by full and incremental source projections. */
|
||||
export const javaScriptArtifactTextExclusion = (
|
||||
file: JavaScriptArtifactFile,
|
||||
): string | null => {
|
||||
if (file.text.included || file.text.reason === "not-applicable") return null;
|
||||
if (file.text.reason === "invalid-utf8" && file.kind !== "javascript")
|
||||
return null;
|
||||
return file.text.reason === "outside-analysis-scope"
|
||||
? "Source was not analyzed because it is outside the caller-selected source_paths."
|
||||
: "Source bytes are not valid UTF-8; JavaScript semantics were not analyzed.";
|
||||
};
|
||||
|
||||
/**
|
||||
* One inventoried regular file not backed by analyzed source bytes. Its inventory
|
||||
* occurrence remains available even when content is opaque or unavailable.
|
||||
|
||||
Reference in New Issue
Block a user