mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-09 16:24:45 +01:00
Strict null checking suggestMemory and settingsWidget
This commit is contained in:
@@ -401,6 +401,7 @@
|
||||
"./vs/editor/contrib/snippet/snippetVariables.ts",
|
||||
"./vs/editor/contrib/suggest/completionModel.ts",
|
||||
"./vs/editor/contrib/suggest/suggest.ts",
|
||||
"./vs/editor/contrib/suggest/suggestMemory.ts",
|
||||
"./vs/editor/contrib/suggest/test/suggest.test.ts",
|
||||
"./vs/editor/contrib/suggest/wordContextKey.ts",
|
||||
"./vs/editor/contrib/suggest/wordDistance.ts",
|
||||
@@ -717,6 +718,7 @@
|
||||
"./vs/workbench/parts/output/common/outputLinkComputer.ts",
|
||||
"./vs/workbench/parts/output/common/outputLinkProvider.ts",
|
||||
"./vs/workbench/parts/performance/electron-browser/stats.ts",
|
||||
"./vs/workbench/parts/preferences/browser/settingsWidgets.ts",
|
||||
"./vs/workbench/parts/preferences/common/smartSnippetInserter.ts",
|
||||
"./vs/workbench/parts/preferences/test/common/smartSnippetInserter.test.ts",
|
||||
"./vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.ts",
|
||||
|
||||
@@ -39,7 +39,7 @@ export abstract class Memory {
|
||||
|
||||
abstract memorize(model: ITextModel, pos: IPosition, item: CompletionItem): void;
|
||||
|
||||
abstract toJSON(): object;
|
||||
abstract toJSON(): object | undefined;
|
||||
|
||||
abstract fromJSON(data: object): void;
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ export class ExcludeSettingListModel {
|
||||
return items;
|
||||
}
|
||||
|
||||
setEditKey(key: string): void {
|
||||
setEditKey(key: string | null): void {
|
||||
this._editKey = key;
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ export class ExcludeSettingListModel {
|
||||
this._selectedIdx = idx;
|
||||
}
|
||||
|
||||
getSelected(): number {
|
||||
getSelected(): number | null {
|
||||
return this._selectedIdx;
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ export class ExcludeSettingListModel {
|
||||
|
||||
interface IExcludeChangeEvent {
|
||||
originalPattern: string;
|
||||
pattern: string;
|
||||
pattern?: string;
|
||||
sibling?: string;
|
||||
}
|
||||
|
||||
@@ -306,7 +306,7 @@ export class ExcludeSettingWidget extends Disposable {
|
||||
DOM.clearNode(this.listElement);
|
||||
this.listDisposables = dispose(this.listDisposables);
|
||||
|
||||
const newMode = this.model.items.some(item => item.editing && !item.pattern);
|
||||
const newMode = this.model.items.some(item => !!(item.editing && !item.pattern));
|
||||
DOM.toggleClass(this.container, 'setting-exclude-new-mode', newMode);
|
||||
|
||||
this.model.items
|
||||
@@ -362,7 +362,7 @@ export class ExcludeSettingWidget extends Disposable {
|
||||
const patternElement = DOM.append(rowElement, $('.setting-exclude-pattern'));
|
||||
const siblingElement = DOM.append(rowElement, $('.setting-exclude-sibling'));
|
||||
patternElement.textContent = item.pattern;
|
||||
siblingElement.textContent = item.sibling && ('when: ' + item.sibling);
|
||||
siblingElement.textContent = item.sibling ? ('when: ' + item.sibling) : null;
|
||||
|
||||
actionBar.push([
|
||||
this.createEditAction(item.pattern),
|
||||
|
||||
Reference in New Issue
Block a user