Remove dead code and associated test.

This commit is contained in:
Jason Reed
2020-07-10 08:59:37 -04:00
parent df5dccc3f6
commit 46bddcd8fa
2 changed files with 0 additions and 18 deletions

View File

@@ -50,14 +50,6 @@ export function fileUriToWebviewUri(
return panel.webview.asWebviewUri(fileUriOnDisk).toString();
}
/** Converts a URI string received from a webview into a local filesystem URI for the same resource. */
export function webviewUriToFileUri(webviewUri: string): Uri {
// Webview URIs used the vscode-resource scheme. The filesystem path of the resource can be obtained from the path component of the webview URI.
const path = Uri.parse(webviewUri).path;
// For this path to be interpreted on the filesystem, we need to parse it as a filesystem URI for the current platform.
return Uri.file(path);
}
/**
* Resolves the specified CodeQL location to a URI into the source archive.
* @param loc CodeQL location to resolve. Must have a non-empty value for `loc.file`.

View File

@@ -6,7 +6,6 @@ import * as tmp from 'tmp';
import { window, ViewColumn, Uri } from 'vscode';
import {
fileUriToWebviewUri,
webviewUriToFileUri,
tryResolveLocation,
} from '../../interface-utils';
import { getDefaultResultSetName } from '../../interface-types';
@@ -47,15 +46,6 @@ describe('interface-utils', () => {
};
}
it('should correctly round trip from filesystem to webview and back', function() {
const { fileUriOnDisk, panel } = setupWebview('');
const webviewUri = fileUriToWebviewUri(panel, fileUriOnDisk);
const reconstructedFileUri = webviewUriToFileUri(webviewUri);
expect(reconstructedFileUri.toString(true)).to.equal(
fileUriOnDisk.toString(true)
);
});
it('does not double-encode # in URIs', function() {
const { fileUriOnDisk, panel } = setupWebview('#');
const webviewUri = fileUriToWebviewUri(panel, fileUriOnDisk);