Skip to content

Commit a414213

Browse files
committed
Replace deprecated storagePath by storageUri
This replaces access to the deprecated `storagePath` and `globalStoragePath` to use `storageUri` and `globalStorageUri` instead.
1 parent 3ad006d commit a414213

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

extensions/ql-vscode/src/codeql-cli/distribution.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ class ExtensionSpecificDistributionManager {
505505
0,
506506
) || "";
507507
return join(
508-
this.extensionContext.globalStoragePath,
508+
this.extensionContext.globalStorageUri.fsPath,
509509
ExtensionSpecificDistributionManager._currentDistributionFolderBaseName +
510510
distributionFolderIndex,
511511
);

extensions/ql-vscode/src/databases/local-databases.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,12 +1152,12 @@ export class DatabaseManager extends DisposableObject {
11521152
}
11531153

11541154
private isExtensionControlledLocation(uri: vscode.Uri) {
1155-
const storagePath = this.ctx.storagePath || this.ctx.globalStoragePath;
1155+
const storageUri = this.ctx.storageUri || this.ctx.globalStorageUri;
11561156
// the uri.fsPath function on windows returns a lowercase drive letter,
11571157
// but storagePath will have an uppercase drive letter. Be sure to compare
11581158
// URIs to URIs only
1159-
if (storagePath) {
1160-
return uri.fsPath.startsWith(vscode.Uri.file(storagePath).fsPath);
1159+
if (storageUri) {
1160+
return uri.fsPath.startsWith(storageUri.fsPath);
11611161
}
11621162
return false;
11631163
}

extensions/ql-vscode/test/vscode-tests/minimal-workspace/local-databases.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ describe("local databases", () => {
277277
updateSpy.mockClear();
278278

279279
// pretend that the database location is not controlled by the extension
280-
(databaseManager as any).ctx.storagePath = "hucairz";
280+
(databaseManager as any).ctx.storageUri = Uri.file("hucairz");
281281
extensionContextStoragePath = "hucairz";
282282

283283
await databaseManager.removeDatabaseItem(

0 commit comments

Comments
 (0)