Remove typings and replace missing methods with vscodes (#8217)

* remove typings and replace missing methods with vscodes

* fix strict-null-checks

* fix tests
This commit is contained in:
Anthony Dresser
2019-11-05 13:03:20 -08:00
committed by GitHub
parent 4645a8ba6b
commit 22a427f934
184 changed files with 634 additions and 43388 deletions

View File

@@ -20,6 +20,7 @@ import { attachSelectBoxStyler } from 'vs/platform/theme/common/styler';
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { find } from 'vs/base/common/arrays';
@Component({
selector: 'modelview-dropdown',
@@ -155,7 +156,7 @@ export default class DropDownComponent extends ComponentBase implements ICompone
private getSelectedValue(): string {
if (this.values && this.values.length > 0 && this.valuesHaveDisplayName()) {
let selectedValue = <azdata.CategoryValue>this.value || <azdata.CategoryValue>this.values[0];
let valueCategory = (<azdata.CategoryValue[]>this.values).find(v => v.name === selectedValue.name);
let valueCategory = find(<azdata.CategoryValue[]>this.values, v => v.name === selectedValue.name);
return valueCategory && valueCategory.displayName;
} else {
if (!this.value && this.values && this.values.length > 0) {
@@ -167,7 +168,7 @@ export default class DropDownComponent extends ComponentBase implements ICompone
private setSelectedValue(newValue: string): void {
if (this.values && this.valuesHaveDisplayName()) {
let valueCategory = (<azdata.CategoryValue[]>this.values).find(v => v.displayName === newValue);
let valueCategory = find((<azdata.CategoryValue[]>this.values), v => v.displayName === newValue);
this.value = valueCategory;
} else {
this.value = newValue;