Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'master' into strict-null-checks-auto-1
# Conflicts:
#	src/tsconfig.strictNullChecks.json
#	src/vs/base/parts/quickopen/test/common/quickOpenScorer.test.ts
#	src/vs/base/test/browser/ui/grid/gridview.test.ts
#	src/vs/base/test/browser/ui/splitview/splitview.test.ts
#	src/vs/base/test/browser/ui/tree/asyncDataTree.test.ts
#	src/vs/base/test/common/async.test.ts
#	src/vs/base/test/common/diff/diff.test.ts
#	src/vs/base/test/common/strings.test.ts
#	src/vs/base/test/node/config.test.ts
#	src/vs/code/test/node/windowsFinder.test.ts
#	src/vs/editor/contrib/codeAction/test/codeAction.test.ts
#	src/vs/editor/contrib/codeAction/test/codeActionModel.test.ts
#	src/vs/editor/contrib/comment/test/lineCommentCommand.test.ts
#	src/vs/workbench/services/keybinding/test/windowsKeyboardMapper.test.ts
  • Loading branch information
Josh Goldberg
Josh Goldberg committed Dec 21, 2018
commit 4ff84e9585c49ac7fd09c1c522f1fb32458e8b0c
8 changes: 5 additions & 3 deletions src/tsconfig.strictNullChecks.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
"./vs/base/test/common/json.test.ts",
"./vs/base/test/common/jsonEdit.test.ts",
"./vs/base/test/common/jsonFormatter.test.ts",

"./vs/base/test/common/labels.test.ts",
"./vs/base/test/common/lifecycle.test.ts",
"./vs/base/test/common/linkedList.test.ts",
Expand Down Expand Up @@ -835,7 +835,6 @@
"./vs/workbench/services/title/common/titleService.ts",
"./vs/workbench/services/workspace/common/workspaceEditing.ts",
"./vs/workbench/test/common/editor/editorOptions.test.ts",
"./vs/workbench/test/electron-browser/api/mock.ts",
"./vs/base/test/browser/comparers.test.ts",
"./vs/base/test/browser/ui/grid/gridview.test.ts",
"./vs/base/test/browser/ui/splitview/splitview.test.ts",
Expand Down Expand Up @@ -897,7 +896,10 @@
"./vs/workbench/services/keybinding/test/macLinuxKeyboardMapper.test.ts",
"./vs/workbench/services/keybinding/test/windowsKeyboardMapper.test.ts",
"./vs/workbench/test/common/notifications.test.ts",
"./vs/workbench/test/electron-browser/api/extHostTypes.test.ts"
"./vs/workbench/test/common/notifications.test.ts",
"./vs/workbench/test/electron-browser/api/extHostTypes.test.ts",
"./vs/workbench/test/electron-browser/api/mock.ts"
"./vs/workbench/test/electron-browser/api/mock.ts",
],
"exclude": [
"./typings/require-monaco.d.ts"
Expand Down
12 changes: 6 additions & 6 deletions src/vs/base/parts/quickopen/test/common/quickOpenScorer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ const ResourceAccessor = new ResourceAccessorClass();

class NullAccessorClass implements scorer.IItemAccessor<URI> {

getItemLabel(resource: URI): string | undefined {
return void 0;
getItemLabel(resource: URI): string {
return undefined!;
}

getItemDescription(resource: URI): string | undefined {
return void 0;
getItemDescription(resource: URI): string {
return undefined!;
}

getItemPath(resource: URI): string | undefined {
return void 0;
getItemPath(resource: URI): string {
return undefined!;
}
}

Expand Down
4 changes: 0 additions & 4 deletions src/vs/base/test/browser/ui/grid/gridview.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ suite('Gridview', function () {
container.appendChild(gridview.element);
});

teardown(function () {
gridview = null!;
});

test('empty gridview is empty', function () {
assert.deepEqual(nodesToArrays(gridview.getViews()), []);
gridview.dispose();
Expand Down
4 changes: 0 additions & 4 deletions src/vs/base/test/browser/ui/splitview/splitview.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ suite('Splitview', () => {
container.style.height = `${200}px`;
});

teardown(() => {
container = null!;
});

test('empty splitview has empty DOM', () => {
const splitview = new SplitView(container);
assert.equal(container.firstElementChild!.firstElementChild!.childElementCount, 0, 'split view should be empty');
Expand Down
6 changes: 3 additions & 3 deletions src/vs/base/test/browser/ui/tree/asyncDataTree.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ suite('AsyncDataTree', function () {

const dataSource = new class implements IAsyncDataSource<Element, Element> {
hasChildren(element: Element): boolean {
return (element.children && element.children.length > 0)!;
return !!element.children && element.children.length > 0;
}
getChildren(element: Element): Promise<Element[]> {
return Promise.resolve(element.children || []);
Expand Down Expand Up @@ -91,14 +91,14 @@ suite('AsyncDataTree', function () {
{ id: 'ac' }
];

await tree.refresh(null!);
await tree.refresh(root);
assert.equal(container.querySelectorAll('.monaco-list-row').length, 1);

await tree.expand(_('a'));
assert.equal(container.querySelectorAll('.monaco-list-row').length, 4);

_('a').children = [];
await tree.refresh(null!);
await tree.refresh(root);
assert.equal(container.querySelectorAll('.monaco-list-row').length, 1);
});
});
2 changes: 1 addition & 1 deletion src/vs/base/test/common/async.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ suite('Async', () => {
assert.ok(r2Queue);
assert.equal(r1Queue, queue.queueFor(URI.file('/some/path'))); // same queue returned

let syncPromiseFactory = () => Promise.resolve(null!);
let syncPromiseFactory = () => Promise.resolve(undefined);

r1Queue.queue(syncPromiseFactory);

Expand Down
2 changes: 1 addition & 1 deletion src/vs/base/test/common/diff/diff.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class StringDiffSequence implements ISequence {
}

function createArray<T>(length: number, value: T): T[] {
var r: T[] = [];
const r: T[] = [];
for (var i = 0; i < length; i++) {
r[i] = value;
}
Expand Down
2 changes: 1 addition & 1 deletion src/vs/base/test/common/strings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ suite('Strings', () => {
});

test('fuzzyContains', () => {
assert.ok(!strings.fuzzyContains(undefined!, null!));
assert.ok(!strings.fuzzyContains((void 0)!, null!));
assert.ok(strings.fuzzyContains('hello world', 'h'));
assert.ok(!strings.fuzzyContains('hello world', 'q'));
assert.ok(strings.fuzzyContains('hello world', 'hw'));
Expand Down
2 changes: 1 addition & 1 deletion src/vs/base/test/node/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ suite('Config', () => {
testFile('config', 'config.json').then(res => {
fs.writeFileSync(res.testFile, '// my comment\n{ "foo": "bar" }');

let watcher = new ConfigWatcher<{ foo: string; }>(res.testFile, { changeBufferDelay: 100, onError: console.error, defaultConfig: undefined! });
let watcher = new ConfigWatcher<{ foo: string; }>(res.testFile, { changeBufferDelay: 100, onError: console.error, defaultConfig: { foo: 'bar' } });
watcher.getConfig(); // ensure we are in sync

fs.writeFileSync(res.testFile, '// my comment\n{ "foo": "changed" }');
Expand Down
2 changes: 1 addition & 1 deletion src/vs/code/test/node/windowsFinder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function options(custom?: Partial<IBestWindowOrFolderOptions<ISimpleWindow>>): I
}

const vscodeFolderWindow: ISimpleWindow = { lastFocusTime: 1, openedFolderUri: URI.file(path.join(fixturesFolder, 'vscode_folder')) };
const lastActiveWindow: ISimpleWindow = { lastFocusTime: 3, openedFolderUri: null! };
const lastActiveWindow: ISimpleWindow = { lastFocusTime: 3, openedFolderUri: undefined };
const noVscodeFolderWindow: ISimpleWindow = { lastFocusTime: 2, openedFolderUri: URI.file(path.join(fixturesFolder, 'no_vscode_folder')) };
const windows: ISimpleWindow[] = [
vscodeFolderWindow,
Expand Down
2 changes: 1 addition & 1 deletion src/vs/editor/contrib/codeAction/test/codeAction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ suite('CodeAction', () => {
const provider = new class implements CodeActionProvider {
provideCodeActions(_model: any, _range: Range, context: CodeActionContext, _token: any): CodeAction[] {
return [
{ title: context.only!, kind: context.only }
{ title: context.only || '', kind: context.only }
];
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ suite('CodeAction', () => {
assert.deepEqual(e.position, { lineNumber: 3, column: 1 });

oracle.dispose();
resolve(null!);
resolve(void 0);
}, 5);

editor.setSelection({ startLineNumber: 1, startColumn: 1, endLineNumber: 4, endColumn: 1 });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,9 @@ suite('Editor Contrib - Line Comment in mixed modes', () => {

this._register(modes.TokenizationRegistry.register(this.getLanguageIdentifier().language, {
getInitialState: (): modes.IState => NULL_STATE,
tokenize: undefined!,
tokenize: () => {
throw new Error('not implemented');
},
tokenize2: (line: string, state: modes.IState): TokenizationResult2 => {
let languageId = (/^ /.test(line) ? INNER_LANGUAGE_ID : OUTER_LANGUAGE_ID);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ async function createKeyboardMapper(isUSStandard: boolean, file: string): Promis
}

function _assertResolveKeybinding(mapper: WindowsKeyboardMapper, k: number, expected: IResolvedKeybinding[]): void {
assertResolveKeybinding(mapper, createKeybinding(k, OperatingSystem.Windows)!, expected);
const keyBinding = createKeybinding(k, OperatingSystem.Windows);
assertResolveKeybinding(mapper, keyBinding!, expected);
}

suite('keyboardMapper - WINDOWS de_ch', () => {
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.