Skip to content

Commit 3f89675

Browse files
Merge pull request #2640 from github/robertbrignull/fix_alert_547
Fix alert by replacing regex with path.basename
2 parents 41f5beb + c5a4c53 commit 3f89675

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

extensions/ql-vscode/src/view/results/result-tables.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ import {
2727
} from "./result-table-utils";
2828
import { vscode } from "../vscode-api";
2929
import { sendTelemetry } from "../common/telemetry";
30-
31-
const FILE_PATH_REGEX = /^(?:.+[\\/])*(.+)$/;
30+
import { basename } from "../../common/path";
3231

3332
/**
3433
* Properties for the `ResultTables` component.
@@ -302,7 +301,7 @@ export class ResultTables extends React.Component<
302301
openFile(this.props.queryPath);
303302
sendTelemetry("local-results-open-query-file");
304303
};
305-
const fileName = FILE_PATH_REGEX.exec(this.props.queryPath)?.[1] || "query";
304+
const fileName = basename(this.props.queryPath);
306305

307306
return (
308307
<span className="vscode-codeql__table-selection-pagination">

0 commit comments

Comments
 (0)