File tree Expand file tree Collapse file tree 5 files changed +8
-18
lines changed Expand file tree Collapse file tree 5 files changed +8
-18
lines changed Original file line number Diff line number Diff line change @@ -168,7 +168,7 @@ export class ExternalApiFeature extends LanguageClientConsumer implements IPower
168168 }
169169
170170 public getStorageUri ( ) : vscode . Uri {
171- return this . extensionContext . storageUri ;
171+ return this . extensionContext . globalStorageUri ;
172172 }
173173
174174 public dispose ( ) {
Original file line number Diff line number Diff line change @@ -39,13 +39,7 @@ export class Logger implements ILogger {
3939
4040 constructor ( logBasePath : vscode . Uri ) {
4141 this . logChannel = vscode . window . createOutputChannel ( "PowerShell Extension Logs" ) ;
42-
43- if ( logBasePath === undefined ) {
44- // No workspace, we have to use another folder.
45- this . logBasePath = vscode . Uri . file ( path . resolve ( __dirname , "../logs" ) ) ;
46- } else {
47- this . logBasePath = vscode . Uri . joinPath ( logBasePath , "logs" ) ;
48- }
42+ this . logBasePath = vscode . Uri . joinPath ( logBasePath , "logs" ) ;
4943
5044 this . commands = [
5145 vscode . commands . registerCommand (
Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<IPower
125125 } ) ;
126126
127127 // Setup the logger.
128- logger = new Logger ( context . storageUri ) ;
128+ logger = new Logger ( context . globalStorageUri ) ;
129129 logger . MinimumLogLevel = LogLevel [ extensionSettings . developer . editorServicesLogLevel ] ;
130130
131131 sessionManager =
Original file line number Diff line number Diff line change @@ -88,11 +88,7 @@ export class SessionManager implements Middleware {
8888 private telemetryReporter : TelemetryReporter ) {
8989
9090 // Create a folder for the session files.
91- if ( extensionContext . storageUri !== undefined ) {
92- this . sessionsFolder = vscode . Uri . joinPath ( extensionContext . storageUri , "sessions" ) ;
93- } else {
94- this . sessionsFolder = vscode . Uri . file ( path . resolve ( __dirname , "../sessions" ) ) ;
95- }
91+ this . sessionsFolder = vscode . Uri . joinPath ( extensionContext . globalStorageUri , "sessions" ) ;
9692 vscode . workspace . fs . createDirectory ( this . sessionsFolder ) ;
9793
9894 this . platformDetails = getPlatformDetails ( ) ;
Original file line number Diff line number Diff line change @@ -9,10 +9,10 @@ import { IPowerShellExtensionClient } from "../../src/features/ExternalApi";
99import utils = require( "../utils" ) ;
1010
1111describe ( "Path assumptions" , function ( ) {
12- let storageUri : vscode . Uri ;
12+ let globalStorageUri : vscode . Uri ;
1313 before ( async ( ) => {
1414 const extension : IPowerShellExtensionClient = await utils . ensureEditorServicesIsConnected ( ) ;
15- storageUri = extension . getStorageUri ( ) ;
15+ globalStorageUri = extension . getStorageUri ( ) ;
1616 } ) ;
1717
1818 // TODO: This is skipped because it interferes with other tests. Either
@@ -23,10 +23,10 @@ describe("Path assumptions", function () {
2323 } ) ;
2424
2525 it ( "Creates the session folder at the correct path" , function ( ) {
26- assert ( fs . existsSync ( vscode . Uri . joinPath ( storageUri , "sessions" ) . fsPath ) ) ;
26+ assert ( fs . existsSync ( vscode . Uri . joinPath ( globalStorageUri , "sessions" ) . fsPath ) ) ;
2727 } ) ;
2828
2929 it ( "Creates the log folder at the correct path" , function ( ) {
30- assert ( fs . existsSync ( vscode . Uri . joinPath ( storageUri , "logs" ) . fsPath ) ) ;
30+ assert ( fs . existsSync ( vscode . Uri . joinPath ( globalStorageUri , "logs" ) . fsPath ) ) ;
3131 } ) ;
3232} ) ;
You can’t perform that action at this time.
0 commit comments