File tree 5 files changed +8
-18
lines changed
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
168
168
}
169
169
170
170
public getStorageUri ( ) : vscode . Uri {
171
- return this . extensionContext . storageUri ;
171
+ return this . extensionContext . globalStorageUri ;
172
172
}
173
173
174
174
public dispose ( ) {
Original file line number Diff line number Diff line change @@ -39,13 +39,7 @@ export class Logger implements ILogger {
39
39
40
40
constructor ( logBasePath : vscode . Uri ) {
41
41
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" ) ;
49
43
50
44
this . commands = [
51
45
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
125
125
} ) ;
126
126
127
127
// Setup the logger.
128
- logger = new Logger ( context . storageUri ) ;
128
+ logger = new Logger ( context . globalStorageUri ) ;
129
129
logger . MinimumLogLevel = LogLevel [ extensionSettings . developer . editorServicesLogLevel ] ;
130
130
131
131
sessionManager =
Original file line number Diff line number Diff line change @@ -88,11 +88,7 @@ export class SessionManager implements Middleware {
88
88
private telemetryReporter : TelemetryReporter ) {
89
89
90
90
// 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" ) ;
96
92
vscode . workspace . fs . createDirectory ( this . sessionsFolder ) ;
97
93
98
94
this . platformDetails = getPlatformDetails ( ) ;
Original file line number Diff line number Diff line change @@ -9,10 +9,10 @@ import { IPowerShellExtensionClient } from "../../src/features/ExternalApi";
9
9
import utils = require( "../utils" ) ;
10
10
11
11
describe ( "Path assumptions" , function ( ) {
12
- let storageUri : vscode . Uri ;
12
+ let globalStorageUri : vscode . Uri ;
13
13
before ( async ( ) => {
14
14
const extension : IPowerShellExtensionClient = await utils . ensureEditorServicesIsConnected ( ) ;
15
- storageUri = extension . getStorageUri ( ) ;
15
+ globalStorageUri = extension . getStorageUri ( ) ;
16
16
} ) ;
17
17
18
18
// TODO: This is skipped because it interferes with other tests. Either
@@ -23,10 +23,10 @@ describe("Path assumptions", function () {
23
23
} ) ;
24
24
25
25
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 ) ) ;
27
27
} ) ;
28
28
29
29
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 ) ) ;
31
31
} ) ;
32
32
} ) ;
You can’t perform that action at this time.
0 commit comments