Annotate a few more null assignments

This commit is contained in:
Matt Bierner
2018-10-11 15:10:05 -07:00
parent 484dcc1ff8
commit ffbe67fef4
7 changed files with 18 additions and 17 deletions
+1
View File
@@ -132,6 +132,7 @@
"./vs/editor/common/modes/languageConfigurationRegistry.ts",
"./vs/editor/common/modes/languageFeatureRegistry.ts",
"./vs/editor/common/modes/languageSelector.ts",
"./vs/editor/common/modes/linkComputer.ts",
"./vs/editor/common/modes/nullMode.ts",
"./vs/editor/common/modes/supports.ts",
"./vs/editor/common/modes/supports/characterPair.ts",
@@ -19,18 +19,18 @@ export interface EventCallback<T> {
export class ViewOutgoingEvents extends Disposable {
public onDidScroll: EventCallback<IScrollEvent> = null;
public onDidGainFocus: EventCallback<void> = null;
public onDidLoseFocus: EventCallback<void> = null;
public onKeyDown: EventCallback<IKeyboardEvent> = null;
public onKeyUp: EventCallback<IKeyboardEvent> = null;
public onContextMenu: EventCallback<IEditorMouseEvent> = null;
public onMouseMove: EventCallback<IEditorMouseEvent> = null;
public onMouseLeave: EventCallback<IEditorMouseEvent> = null;
public onMouseUp: EventCallback<IEditorMouseEvent> = null;
public onMouseDown: EventCallback<IEditorMouseEvent> = null;
public onMouseDrag: EventCallback<IEditorMouseEvent> = null;
public onMouseDrop: EventCallback<IEditorMouseEvent> = null;
public onDidScroll: EventCallback<IScrollEvent> | null = null;
public onDidGainFocus: EventCallback<void> | null = null;
public onDidLoseFocus: EventCallback<void> | null = null;
public onKeyDown: EventCallback<IKeyboardEvent> | null = null;
public onKeyUp: EventCallback<IKeyboardEvent> | null = null;
public onContextMenu: EventCallback<IEditorMouseEvent> | null = null;
public onMouseMove: EventCallback<IEditorMouseEvent> | null = null;
public onMouseLeave: EventCallback<IEditorMouseEvent> | null = null;
public onMouseUp: EventCallback<IEditorMouseEvent> | null = null;
public onMouseDown: EventCallback<IEditorMouseEvent> | null = null;
public onMouseDrag: EventCallback<IEditorMouseEvent> | null = null;
public onMouseDrop: EventCallback<IEditorMouseEvent> | null = null;
private _viewModel: IViewModel;
+1 -1
View File
@@ -123,7 +123,7 @@ const enum CharacterClass {
CannotEndIn = 2
}
let _classifier: CharacterClassifier<CharacterClass> = null;
let _classifier: CharacterClassifier<CharacterClass> | null = null;
function getClassifier(): CharacterClassifier<CharacterClass> {
if (_classifier === null) {
_classifier = new CharacterClassifier<CharacterClass>(CharacterClass.None);
@@ -56,7 +56,7 @@ suite('TokenizationSupport2Adapter', () => {
}
};
}
public readonly onThemeChange: Event<ITheme> = null;
public readonly onThemeChange: Event<ITheme> | null = null;
}
class MockState implements IState {
@@ -29,7 +29,7 @@ export function getTerminalLauncher() {
return terminalLauncher;
}
let _DEFAULT_TERMINAL_LINUX_READY: TPromise<string> = null;
let _DEFAULT_TERMINAL_LINUX_READY: TPromise<string> | null = null;
export function getDefaultTerminalLinuxReady(): TPromise<string> {
if (!_DEFAULT_TERMINAL_LINUX_READY) {
_DEFAULT_TERMINAL_LINUX_READY = new Promise<string>(c => {
@@ -65,7 +65,7 @@ export abstract class EmmetEditorAction extends EditorAction {
private static readonly emmetSupportedModes = ['html', 'css', 'xml', 'xsl', 'haml', 'jade', 'jsx', 'slim', 'scss', 'sass', 'less', 'stylus', 'styl', 'svg'];
private _lastGrammarContributions: TPromise<GrammarContributions> = null;
private _lastGrammarContributions: TPromise<GrammarContributions> | null = null;
private _lastExtensionService: IExtensionService | null = null;
private _withGrammarContributions(extensionService: IExtensionService): TPromise<GrammarContributions> {
if (this._lastExtensionService !== extensionService) {
@@ -6,7 +6,7 @@
import * as env from 'vs/base/common/platform';
import * as pfs from 'vs/base/node/pfs';
let _DEFAULT_TERMINAL_LINUX_READY: Promise<string> = null;
let _DEFAULT_TERMINAL_LINUX_READY: Promise<string> | null = null;
export function getDefaultTerminalLinuxReady(): Promise<string> {
if (!_DEFAULT_TERMINAL_LINUX_READY) {
_DEFAULT_TERMINAL_LINUX_READY = new Promise<string>(c => {