Skip to content

Commit ffbe67f

Browse files
committed
Annotate a few more null assignments
1 parent 484dcc1 commit ffbe67f

7 files changed

Lines changed: 18 additions & 17 deletions

File tree

src/tsconfig.strictNullChecks.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132
"./vs/editor/common/modes/languageConfigurationRegistry.ts",
133133
"./vs/editor/common/modes/languageFeatureRegistry.ts",
134134
"./vs/editor/common/modes/languageSelector.ts",
135+
"./vs/editor/common/modes/linkComputer.ts",
135136
"./vs/editor/common/modes/nullMode.ts",
136137
"./vs/editor/common/modes/supports.ts",
137138
"./vs/editor/common/modes/supports/characterPair.ts",

src/vs/editor/browser/view/viewOutgoingEvents.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@ export interface EventCallback<T> {
1919

2020
export class ViewOutgoingEvents extends Disposable {
2121

22-
public onDidScroll: EventCallback<IScrollEvent> = null;
23-
public onDidGainFocus: EventCallback<void> = null;
24-
public onDidLoseFocus: EventCallback<void> = null;
25-
public onKeyDown: EventCallback<IKeyboardEvent> = null;
26-
public onKeyUp: EventCallback<IKeyboardEvent> = null;
27-
public onContextMenu: EventCallback<IEditorMouseEvent> = null;
28-
public onMouseMove: EventCallback<IEditorMouseEvent> = null;
29-
public onMouseLeave: EventCallback<IEditorMouseEvent> = null;
30-
public onMouseUp: EventCallback<IEditorMouseEvent> = null;
31-
public onMouseDown: EventCallback<IEditorMouseEvent> = null;
32-
public onMouseDrag: EventCallback<IEditorMouseEvent> = null;
33-
public onMouseDrop: EventCallback<IEditorMouseEvent> = null;
22+
public onDidScroll: EventCallback<IScrollEvent> | null = null;
23+
public onDidGainFocus: EventCallback<void> | null = null;
24+
public onDidLoseFocus: EventCallback<void> | null = null;
25+
public onKeyDown: EventCallback<IKeyboardEvent> | null = null;
26+
public onKeyUp: EventCallback<IKeyboardEvent> | null = null;
27+
public onContextMenu: EventCallback<IEditorMouseEvent> | null = null;
28+
public onMouseMove: EventCallback<IEditorMouseEvent> | null = null;
29+
public onMouseLeave: EventCallback<IEditorMouseEvent> | null = null;
30+
public onMouseUp: EventCallback<IEditorMouseEvent> | null = null;
31+
public onMouseDown: EventCallback<IEditorMouseEvent> | null = null;
32+
public onMouseDrag: EventCallback<IEditorMouseEvent> | null = null;
33+
public onMouseDrop: EventCallback<IEditorMouseEvent> | null = null;
3434

3535
private _viewModel: IViewModel;
3636

src/vs/editor/common/modes/linkComputer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ const enum CharacterClass {
123123
CannotEndIn = 2
124124
}
125125

126-
let _classifier: CharacterClassifier<CharacterClass> = null;
126+
let _classifier: CharacterClassifier<CharacterClass> | null = null;
127127
function getClassifier(): CharacterClassifier<CharacterClass> {
128128
if (_classifier === null) {
129129
_classifier = new CharacterClassifier<CharacterClass>(CharacterClass.None);

src/vs/editor/standalone/test/browser/standaloneLanguages.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ suite('TokenizationSupport2Adapter', () => {
5656
}
5757
};
5858
}
59-
public readonly onThemeChange: Event<ITheme> = null;
59+
public readonly onThemeChange: Event<ITheme> | null = null;
6060
}
6161

6262
class MockState implements IState {

src/vs/workbench/parts/debug/node/terminals.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export function getTerminalLauncher() {
2929
return terminalLauncher;
3030
}
3131

32-
let _DEFAULT_TERMINAL_LINUX_READY: TPromise<string> = null;
32+
let _DEFAULT_TERMINAL_LINUX_READY: TPromise<string> | null = null;
3333
export function getDefaultTerminalLinuxReady(): TPromise<string> {
3434
if (!_DEFAULT_TERMINAL_LINUX_READY) {
3535
_DEFAULT_TERMINAL_LINUX_READY = new Promise<string>(c => {

src/vs/workbench/parts/emmet/electron-browser/emmetActions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export abstract class EmmetEditorAction extends EditorAction {
6565

6666
private static readonly emmetSupportedModes = ['html', 'css', 'xml', 'xsl', 'haml', 'jade', 'jsx', 'slim', 'scss', 'sass', 'less', 'stylus', 'styl', 'svg'];
6767

68-
private _lastGrammarContributions: TPromise<GrammarContributions> = null;
68+
private _lastGrammarContributions: TPromise<GrammarContributions> | null = null;
6969
private _lastExtensionService: IExtensionService | null = null;
7070
private _withGrammarContributions(extensionService: IExtensionService): TPromise<GrammarContributions> {
7171
if (this._lastExtensionService !== extensionService) {

src/vs/workbench/parts/execution/electron-browser/terminal.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import * as env from 'vs/base/common/platform';
77
import * as pfs from 'vs/base/node/pfs';
88

9-
let _DEFAULT_TERMINAL_LINUX_READY: Promise<string> = null;
9+
let _DEFAULT_TERMINAL_LINUX_READY: Promise<string> | null = null;
1010
export function getDefaultTerminalLinuxReady(): Promise<string> {
1111
if (!_DEFAULT_TERMINAL_LINUX_READY) {
1212
_DEFAULT_TERMINAL_LINUX_READY = new Promise<string>(c => {

0 commit comments

Comments
 (0)