Skip to content

Commit 3639dcb

Browse files
committed
Fix tests and reformatting
* Fix command-linting tests. * Fix failing windows test and Use Uri.parse(_, true) * Use Uri.parse(_, true). That is the preferred API. * Reformat comments.
1 parent 4aa7521 commit 3639dcb

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

extensions/ql-vscode/src/interface-utils.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ export enum WebviewReveal {
4242
NotForced,
4343
}
4444

45-
/** Converts a filesystem URI into a webview URI string that the given panel can use to read the file. */
45+
/**
46+
* Converts a filesystem URI into a webview URI string that the given panel
47+
* can use to read the file.
48+
*/
4649
export function fileUriToWebviewUri(
4750
panel: WebviewPanel,
4851
fileUriOnDisk: Uri

extensions/ql-vscode/src/vscode-tests/no-workspace/contextual/fileRangeFromURI.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ describe('fileRangeFromURI', () => {
3636

3737
function createMockDatabaseItem(): DatabaseItem {
3838
return {
39-
resolveSourceFile: (uri: string) => Uri.parse('file://' + uri, true)
39+
resolveSourceFile: (file: string) => Uri.file(file)
4040
} as DatabaseItem;
4141
}
4242
});

extensions/ql-vscode/src/vscode-tests/no-workspace/interface-utils.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ describe('interface-utils', () => {
3232
localResourceRoots: [fileUriOnDisk],
3333
}
3434
);
35+
3536
after(function() {
3637
panel.dispose();
3738
tmpFile.removeCallback();

extensions/ql-vscode/test/pure-tests/command-lint.test.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,20 @@ describe('commands declared in package.json', function() {
2929

3030
commands.forEach((commandDecl: CmdDecl) => {
3131
const { command, title } = commandDecl;
32-
if (command.match(/^codeQL\./)
32+
if (
33+
command.match(/^codeQL\./)
3334
|| command.match(/^codeQLQueryResults\./)
34-
|| command.match(/^codeQLTests\./)) {
35+
|| command.match(/^codeQLTests\./)
36+
) {
3537
paletteCmds.add(command);
3638
expect(title).not.to.be.undefined;
3739
commandTitles[command] = title!;
3840
}
39-
else if (command.match(/^codeQLDatabases\./)
40-
|| command.match(/^codeQLQueryHistory\./)) {
41+
else if (
42+
command.match(/^codeQLDatabases\./)
43+
|| command.match(/^codeQLQueryHistory\./)
44+
|| command.match(/^codeQLAstViewer\./)
45+
) {
4146
scopedCmds.add(command);
4247
expect(title).not.to.be.undefined;
4348
commandTitles[command] = title!;
@@ -97,5 +102,3 @@ describe('commands declared in package.json', function() {
97102

98103

99104
});
100-
101-

0 commit comments

Comments
 (0)