Skip to content

Commit 46bddcd

Browse files
committed
Remove dead code and associated test.
1 parent df5dccc commit 46bddcd

2 files changed

Lines changed: 0 additions & 18 deletions

File tree

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,6 @@ export function fileUriToWebviewUri(
5050
return panel.webview.asWebviewUri(fileUriOnDisk).toString();
5151
}
5252

53-
/** Converts a URI string received from a webview into a local filesystem URI for the same resource. */
54-
export function webviewUriToFileUri(webviewUri: string): Uri {
55-
// Webview URIs used the vscode-resource scheme. The filesystem path of the resource can be obtained from the path component of the webview URI.
56-
const path = Uri.parse(webviewUri).path;
57-
// For this path to be interpreted on the filesystem, we need to parse it as a filesystem URI for the current platform.
58-
return Uri.file(path);
59-
}
60-
6153
/**
6254
* Resolves the specified CodeQL location to a URI into the source archive.
6355
* @param loc CodeQL location to resolve. Must have a non-empty value for `loc.file`.

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import * as tmp from 'tmp';
66
import { window, ViewColumn, Uri } from 'vscode';
77
import {
88
fileUriToWebviewUri,
9-
webviewUriToFileUri,
109
tryResolveLocation,
1110
} from '../../interface-utils';
1211
import { getDefaultResultSetName } from '../../interface-types';
@@ -47,15 +46,6 @@ describe('interface-utils', () => {
4746
};
4847
}
4948

50-
it('should correctly round trip from filesystem to webview and back', function() {
51-
const { fileUriOnDisk, panel } = setupWebview('');
52-
const webviewUri = fileUriToWebviewUri(panel, fileUriOnDisk);
53-
const reconstructedFileUri = webviewUriToFileUri(webviewUri);
54-
expect(reconstructedFileUri.toString(true)).to.equal(
55-
fileUriOnDisk.toString(true)
56-
);
57-
});
58-
5949
it('does not double-encode # in URIs', function() {
6050
const { fileUriOnDisk, panel } = setupWebview('#');
6151
const webviewUri = fileUriToWebviewUri(panel, fileUriOnDisk);

0 commit comments

Comments
 (0)