remove logDirectory, #43275

This commit is contained in:
Johannes Rieken
2018-08-20 15:42:09 +02:00
parent 66205890dd
commit 27c72d4ea4
4 changed files with 4 additions and 20 deletions
@@ -28,13 +28,13 @@ export default class LogDirectoryProvider {
@memoize
private logDirectory(): string | undefined {
try {
const path = this.context.logDirectory;
const path = this.context.logPath;
if (!fs.existsSync(path)) {
fs.mkdirSync(path);
}
return this.context.logDirectory;
return this.context.logPath;
} catch {
return undefined;
}
}
}
}
-10
View File
@@ -434,16 +434,6 @@ declare module 'vscode' {
Off = 7
}
export interface ExtensionContext {
/**
* Path where an extension can write log files.
*
* Extensions must create this directory before writing to it. The parent directory will always exist.
*/
readonly logDirectory: string;
}
export namespace env {
/**
* Current logging level.
@@ -26,7 +26,6 @@ export interface IExtensionContext {
extensionPath: string;
storagePath: string;
asAbsolutePath(relativePath: string): string;
readonly logDirectory: string;
readonly logPath: string;
}
@@ -12,7 +12,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
import { ExtensionDescriptionRegistry } from 'vs/workbench/services/extensions/node/extensionDescriptionRegistry';
import { IExtensionDescription } from 'vs/workbench/services/extensions/common/extensions';
import { ExtHostStorage } from 'vs/workbench/api/node/extHostStorage';
import { createApiFactory, initializeExtensionApi, checkProposedApiEnabled } from 'vs/workbench/api/node/extHost.api.impl';
import { createApiFactory, initializeExtensionApi } from 'vs/workbench/api/node/extHost.api.impl';
import { MainContext, MainThreadExtensionServiceShape, IWorkspaceData, IEnvironment, IInitData, ExtHostExtensionServiceShape, MainThreadTelemetryShape, IMainContext } from './extHost.protocol';
import { IExtensionMemento, ExtensionsActivator, ActivatedExtension, IExtensionAPI, IExtensionContext, EmptyExtension, IExtensionModule, ExtensionActivationTimesBuilder, ExtensionActivationTimes, ExtensionActivationReason, ExtensionActivatedByEvent } from 'vs/workbench/api/node/extHostExtensionActivator';
import { ExtHostConfiguration } from 'vs/workbench/api/node/extHostConfiguration';
@@ -361,11 +361,6 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape {
get extensionPath() { return extensionDescription.extensionLocation.fsPath; },
storagePath: this._storagePath.value(extensionDescription),
asAbsolutePath: (relativePath: string) => { return join(extensionDescription.extensionLocation.fsPath, relativePath); },
get logDirectory() {
console.warn(`this PROPOSED API has been RENAMED to 'logPath'`);
checkProposedApiEnabled(extensionDescription);
return that._extHostLogService.getLogDirectory(extensionDescription.id);
},
logPath: that._extHostLogService.getLogDirectory(extensionDescription.id)
});
});