Skip to content

Commit

Permalink
Refactored to use fsPath property of selectedQuery
Browse files Browse the repository at this point in the history
  • Loading branch information
mgsium committed Oct 27, 2021
1 parent 0e9559a commit ba8d069
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions extensions/ql-vscode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -498,17 +498,7 @@ async function activateWithInstalledDistribution(
): Promise<void> {
if (qs !== undefined) {
if (await cliServer.cliConstraints.supportsResolveQlref()) {
let resolved;
try {
let queryPath: string = selectedQuery.path;
if (os.type() === 'Windows_NT') {
// replaces leading '/' in the query path if followed by a windows drive letter
queryPath = queryPath.replace(/^\/([a-zA-Z]:)/, '$1');
}
resolved = await cliServer.resolveQlref(queryPath);
} catch {
throw new Error(`Could not find the .ql file referenced by ${selectedQuery.path}.`);
}
const resolved = await cliServer.resolveQlref(selectedQuery.fsPath);
const uri = Uri.file(resolved.resolvedPath);
await window.showTextDocument(uri, { preview: false });
} else {
Expand Down

0 comments on commit ba8d069

Please sign in to comment.