Display EntityValue labels in CSV export (#2170)
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
## [UNRELEASED]
|
## [UNRELEASED]
|
||||||
|
|
||||||
- Show data flow paths of a variant analysis in a new tab
|
- Show data flow paths of a variant analysis in a new tab
|
||||||
|
- Show labels of entities in exported CSV results [#2170](https://github.com/github/vscode-codeql/pull/2170)
|
||||||
|
|
||||||
## 1.8.0 - 9 March 2023
|
## 1.8.0 - 9 March 2023
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import { nanoid } from "nanoid";
|
|||||||
import { CodeQLCliServer } from "./cli";
|
import { CodeQLCliServer } from "./cli";
|
||||||
import { SELECT_QUERY_NAME } from "./contextual/locationFinder";
|
import { SELECT_QUERY_NAME } from "./contextual/locationFinder";
|
||||||
import { DatabaseManager } from "./local-databases";
|
import { DatabaseManager } from "./local-databases";
|
||||||
import { DecodedBqrsChunk } from "./pure/bqrs-cli-types";
|
import { DecodedBqrsChunk, EntityValue } from "./pure/bqrs-cli-types";
|
||||||
import { extLogger, Logger } from "./common";
|
import { extLogger, Logger } from "./common";
|
||||||
import { generateSummarySymbolsFile } from "./log-insights/summary-parser";
|
import { generateSummarySymbolsFile } from "./log-insights/summary-parser";
|
||||||
import { getErrorMessage } from "./pure/helpers-pure";
|
import { getErrorMessage } from "./pure/helpers-pure";
|
||||||
@@ -351,11 +351,17 @@ export class QueryEvaluationInfo {
|
|||||||
chunk.tuples.forEach((tuple) => {
|
chunk.tuples.forEach((tuple) => {
|
||||||
out.write(
|
out.write(
|
||||||
`${tuple
|
`${tuple
|
||||||
.map((v, i) =>
|
.map((v, i) => {
|
||||||
chunk.columns[i].kind === "String"
|
if (chunk.columns[i].kind === "String") {
|
||||||
? `"${typeof v === "string" ? v.replaceAll('"', '""') : v}"`
|
return `"${
|
||||||
: v,
|
typeof v === "string" ? v.replaceAll('"', '""') : v
|
||||||
)
|
}"`;
|
||||||
|
} else if (chunk.columns[i].kind === "Entity") {
|
||||||
|
return (v as EntityValue).label;
|
||||||
|
} else {
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
})
|
||||||
.join(",")}\n`,
|
.join(",")}\n`,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user