Merge pull request #2640 from github/robertbrignull/fix_alert_547

Fix alert by replacing regex with path.basename
This commit is contained in:
Robert
2023-07-26 11:18:40 +01:00
committed by GitHub

View File

@@ -27,8 +27,7 @@ import {
} from "./result-table-utils";
import { vscode } from "../vscode-api";
import { sendTelemetry } from "../common/telemetry";
const FILE_PATH_REGEX = /^(?:.+[\\/])*(.+)$/;
import { basename } from "../../common/path";
/**
* Properties for the `ResultTables` component.
@@ -302,7 +301,7 @@ export class ResultTables extends React.Component<
openFile(this.props.queryPath);
sendTelemetry("local-results-open-query-file");
};
const fileName = FILE_PATH_REGEX.exec(this.props.queryPath)?.[1] || "query";
const fileName = basename(this.props.queryPath);
return (
<span className="vscode-codeql__table-selection-pagination">