提交 7b1f444f 编写于 作者: M Matt Bierner

Fix a few more simple strict null errors

上级 dcd37445
......@@ -18,10 +18,12 @@
"./vs/base/browser/ui/scrollbar/scrollableElementOptions.ts",
"./vs/base/browser/ui/scrollbar/scrollbarState.ts",
"./vs/base/browser/ui/tree/tree.ts",
"./vs/base/common/actions.ts",
"./vs/base/common/amd.ts",
"./vs/base/common/arrays.ts",
"./vs/base/common/assert.ts",
"./vs/base/common/async.ts",
"./vs/base/common/cache.ts",
"./vs/base/common/cancellation.ts",
"./vs/base/common/charCode.ts",
"./vs/base/common/collections.ts",
......@@ -32,6 +34,7 @@
"./vs/base/common/diff/diff.ts",
"./vs/base/common/diff/diffChange.ts",
"./vs/base/common/errors.ts",
"./vs/base/common/errorsWithActions.ts",
"./vs/base/common/event.ts",
"./vs/base/common/functional.ts",
"./vs/base/common/glob.ts",
......@@ -72,6 +75,7 @@
"./vs/base/common/winjs.polyfill.promise.ts",
"./vs/base/common/worker/simpleWorker.ts",
"./vs/base/node/decoder.ts",
"./vs/base/node/id.ts",
"./vs/base/node/paths.ts",
"./vs/base/node/ports.ts",
"./vs/base/parts/contextmenu/common/contextmenu.ts",
......@@ -138,6 +142,8 @@
"./vs/platform/node/minimalTranslations.ts",
"./vs/platform/node/package.ts",
"./vs/platform/node/product.ts",
"./vs/platform/notification/common/notification.ts",
"./vs/platform/notification/test/common/testNotificationService.ts",
"./vs/platform/opener/common/opener.ts",
"./vs/platform/output/node/outputAppender.ts",
"./vs/platform/progress/common/progress.ts",
......@@ -156,8 +162,12 @@
"./vs/platform/workbench/common/contextkeys.ts",
"./vs/workbench/api/shared/tasks.ts",
"./vs/workbench/browser/parts/statusbar/statusbar.ts",
"./vs/workbench/common/activity.ts",
"./vs/workbench/common/composite.ts",
"./vs/workbench/common/contributions.ts",
"./vs/workbench/common/extensionHostProtocol.ts",
"./vs/workbench/common/panel.ts",
"./vs/workbench/common/viewlet.ts",
"./vs/workbench/parts/execution/common/execution.ts",
"./vs/workbench/parts/extensions/common/extensionQuery.ts",
"./vs/workbench/parts/logs/common/logConstants.ts",
......@@ -166,6 +176,7 @@
"./vs/workbench/parts/output/common/output.ts",
"./vs/workbench/parts/search/common/constants.ts",
"./vs/workbench/parts/terminal/browser/terminalWidgetManager.ts",
"./vs/workbench/parts/terminal/common/terminal.ts",
"./vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.ts",
"./vs/workbench/services/activity/common/activity.ts",
"./vs/workbench/services/configuration/common/jsonEditing.ts",
......@@ -177,8 +188,11 @@
"./vs/workbench/services/files/node/watcher/unix/watcher.ts",
"./vs/workbench/services/hash/common/hashService.ts",
"./vs/workbench/services/hash/node/hashService.ts",
"./vs/workbench/services/panel/common/panelService.ts",
"./vs/workbench/services/search/node/search.ts",
"./vs/workbench/services/title/common/titleService.ts",
"./vs/workbench/test/electron-browser/api/mock.ts"
"./vs/workbench/test/electron-browser/api/mock.ts",
"vs/platform/search/common/search.ts"
],
"exclude": [
"./typings/require-monaco.d.ts"
......
......@@ -60,7 +60,7 @@ export class Action implements IAction {
protected _enabled: boolean;
protected _checked: boolean;
protected _radio: boolean;
protected _actionCallback: (event?: any) => Thenable<any>;
protected _actionCallback?: (event?: any) => Thenable<any>;
constructor(id: string, label: string = '', cssClass: string = '', enabled: boolean = true, actionCallback?: (event?: any) => Thenable<any>) {
this._id = id;
......@@ -165,7 +165,7 @@ export class Action implements IAction {
}
run(event?: any, _data?: ITelemetryData): Thenable<any> {
if (this._actionCallback !== void 0) {
if (this._actionCallback) {
return this._actionCallback(event);
}
......
......@@ -13,7 +13,7 @@ export interface CacheResult<T> {
export class Cache<T> {
private result: CacheResult<T> = null;
private result: CacheResult<T> | null = null;
constructor(private task: (ct: CancellationToken) => Promise<T>) { }
get(): CacheResult<T> {
......
......@@ -45,7 +45,7 @@ export const virtualMachineHint: { value(): number } = new class {
this._virtualMachineOUIs.set('00:16:3E', true);
this._virtualMachineOUIs.set('08:00:27', true);
}
return this._virtualMachineOUIs.findSubstr(mac);
return !!this._virtualMachineOUIs.findSubstr(mac);
}
value(): number {
......
......@@ -306,7 +306,7 @@ export interface ISearchConfiguration extends IFilesConfiguration {
};
}
export function getExcludes(configuration: ISearchConfiguration): glob.IExpression {
export function getExcludes(configuration: ISearchConfiguration): glob.IExpression | undefined {
const fileExcludes = configuration && configuration.files && configuration.files.exclude;
const searchExcludes = configuration && configuration.search && configuration.search.exclude;
......@@ -337,7 +337,7 @@ export function pathIncludedInQuery(query: ISearchQuery, fsPath: string): boolea
// If searchPaths are being used, the extra file must be in a subfolder and match the pattern, if present
if (query.usingSearchPaths) {
return query.folderQueries.every(fq => {
return !!query.folderQueries && query.folderQueries.every(fq => {
const searchPath = fq.folder.fsPath;
if (paths.isEqualOrParent(fsPath, searchPath)) {
return !fq.includePattern || !!glob.match(fq.includePattern, fsPath);
......
......@@ -17,17 +17,17 @@ export const TERMINAL_SERVICE_ID = 'terminalService';
/** A context key that is set when there is at least one opened integrated terminal. */
export const KEYBINDING_CONTEXT_TERMINAL_IS_OPEN = new RawContextKey<boolean>('terminalIsOpen', false);
/** A context key that is set when the integrated terminal has focus. */
export const KEYBINDING_CONTEXT_TERMINAL_FOCUS = new RawContextKey<boolean>('terminalFocus', undefined);
export const KEYBINDING_CONTEXT_TERMINAL_FOCUS = new RawContextKey<boolean>('terminalFocus', false);
/** A context key that is set when the integrated terminal does not have focus. */
export const KEYBINDING_CONTEXT_TERMINAL_NOT_FOCUSED: ContextKeyExpr = KEYBINDING_CONTEXT_TERMINAL_FOCUS.toNegated();
/** A keybinding context key that is set when the integrated terminal has text selected. */
export const KEYBINDING_CONTEXT_TERMINAL_TEXT_SELECTED = new RawContextKey<boolean>('terminalTextSelected', undefined);
export const KEYBINDING_CONTEXT_TERMINAL_TEXT_SELECTED = new RawContextKey<boolean>('terminalTextSelected', false);
/** A keybinding context key that is set when the integrated terminal does not have text selected. */
export const KEYBINDING_CONTEXT_TERMINAL_TEXT_NOT_SELECTED: ContextKeyExpr = KEYBINDING_CONTEXT_TERMINAL_TEXT_SELECTED.toNegated();
/** A context key that is set when the find widget in integrated terminal is visible. */
export const KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_VISIBLE = new RawContextKey<boolean>('terminalFindWidgetVisible', undefined);
export const KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_VISIBLE = new RawContextKey<boolean>('terminalFindWidgetVisible', false);
/** A context key that is set when the find widget in integrated terminal is not visible. */
export const KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_NOT_VISIBLE: ContextKeyExpr = KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_VISIBLE.toNegated();
/** A context key that is set when the find widget find input in integrated terminal is focused. */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册