提交 26d23c63 编写于 作者: M Matt Bierner

Strict null checks

#60565
上级 42a068bb
......@@ -368,6 +368,7 @@
"./vs/platform/contextkey/browser/contextKeyService.ts",
"./vs/platform/contextkey/common/contextkey.ts",
"./vs/platform/dialogs/common/dialogs.ts",
"./vs/platform/dialogs/node/dialogService.ts",
"./vs/platform/download/common/download.ts",
"./vs/platform/editor/common/editor.ts",
"./vs/platform/environment/common/environment.ts",
......@@ -407,6 +408,7 @@
"./vs/platform/label/electron-browser/label.contribution.ts",
"./vs/platform/lifecycle/common/lifecycle.ts",
"./vs/platform/lifecycle/electron-browser/lifecycleService.ts",
"./vs/platform/lifecycle/electron-main/lifecycleMain.ts",
"./vs/platform/localizations/common/localizations.ts",
"./vs/platform/log/common/bufferLog.ts",
"./vs/platform/log/common/log.ts",
......@@ -458,6 +460,7 @@
"./vs/platform/workspaces/node/workspaces.ts",
"./vs/vscode.d.ts",
"./vs/vscode.proposed.d.ts",
"./vs/workbench/api/node/extHostExtensionActivator.ts",
"./vs/workbench/api/shared/tasks.ts",
"./vs/workbench/browser/actions/toggleActivityBarVisibility.ts",
"./vs/workbench/browser/actions/toggleCenteredLayout.ts",
......
......@@ -417,8 +417,8 @@ export class SimpleConfigurationService implements IConfigurationService {
public inspect<C>(key: string, options: IConfigurationOverrides = {}): {
default: C,
user: C,
workspace: C,
workspaceFolder: C
workspace?: C,
workspaceFolder?: C
value: C,
} {
return this.configuration().inspect<C>(key, options, null);
......
......@@ -89,8 +89,8 @@ export interface IConfigurationService {
inspect<T>(key: string, overrides?: IConfigurationOverrides): {
default: T,
user: T,
workspace: T,
workspaceFolder: T,
workspace?: T,
workspaceFolder?: T,
memory?: T,
value: T,
};
......
......@@ -16,7 +16,7 @@ export interface IConfirmation {
type?: 'none' | 'info' | 'error' | 'question' | 'warning';
message: string;
detail?: string;
primaryButton?: string;
primaryButton: string;
secondaryButton?: string;
checkbox?: {
label: string;
......
......@@ -100,8 +100,8 @@ export class LifecycleService extends Disposable implements ILifecycleService {
private static readonly QUIT_FROM_RESTART_MARKER = 'quit.from.restart'; // use a marker to find out if the session was restarted
private windowToCloseRequest: { [windowId: string]: boolean } = Object.create(null);
private pendingQuitPromise: TPromise<boolean>;
private pendingQuitPromiseComplete: TValueCallback<boolean>;
private pendingQuitPromise: TPromise<boolean> | null;
private pendingQuitPromiseComplete: TValueCallback<boolean> | null;
private oneTimeListenerTokenGenerator = 0;
private windowCounter = 0;
......@@ -399,7 +399,10 @@ export class LifecycleService extends Disposable implements ILifecycleService {
// Code starts it will set it back to the installation directory again.
try {
if (isWindows) {
process.chdir(process.env['VSCODE_CWD']);
const vscodeCwd = process.env['VSCODE_CWD'];
if (vscodeCwd) {
process.chdir(vscodeCwd);
}
}
} catch (err) {
this.logService.error(err);
......
......@@ -31,8 +31,8 @@ export interface IExtensionContext {
* Represents the source code (module) of an extension.
*/
export interface IExtensionModule {
activate(ctx: IExtensionContext): Promise<IExtensionAPI>;
deactivate(): void;
activate?(ctx: IExtensionContext): Promise<IExtensionAPI>;
deactivate?(): void;
}
/**
......@@ -123,18 +123,18 @@ export class ExtensionActivationTimesBuilder {
export class ActivatedExtension {
public readonly activationFailed: boolean;
public readonly activationFailedError: Error;
public readonly activationFailedError: Error | null;
public readonly activationTimes: ExtensionActivationTimes;
public readonly module: IExtensionModule;
public readonly exports: IExtensionAPI;
public readonly exports: IExtensionAPI | undefined;
public readonly subscriptions: IDisposable[];
constructor(
activationFailed: boolean,
activationFailedError: Error,
activationFailedError: Error | null,
activationTimes: ExtensionActivationTimes,
module: IExtensionModule,
exports: IExtensionAPI,
exports: IExtensionAPI | undefined,
subscriptions: IDisposable[]
) {
this.activationFailed = activationFailed;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册