Merge from vscode c58aaab8a1cc22a7139b761166a0d4f37d41e998 (#7880)

* Merge from vscode c58aaab8a1cc22a7139b761166a0d4f37d41e998

* fix pipelines

* fix strict-null-checks

* add missing files
This commit is contained in:
Anthony Dresser
2019-10-21 22:12:22 -07:00
committed by GitHub
parent 7c9be74970
commit 1e22f47304
913 changed files with 18898 additions and 16536 deletions

View File

@@ -6,13 +6,13 @@
import * as dom from 'vs/base/browser/dom';
import { HighlightedLabel } from 'vs/base/browser/ui/highlightedlabel/highlightedLabel';
import { IIdentityProvider, IKeyboardNavigationLabelProvider, IListVirtualDelegate } from 'vs/base/browser/ui/list/list';
import { IDataSource, ITreeNode, ITreeRenderer, ITreeSorter } from 'vs/base/browser/ui/tree/tree';
import { IDataSource, ITreeNode, ITreeRenderer, ITreeSorter, ITreeFilter } from 'vs/base/browser/ui/tree/tree';
import { values } from 'vs/base/common/collections';
import { createMatches, FuzzyScore } from 'vs/base/common/filters';
import 'vs/css!./media/outlineTree';
import 'vs/css!./media/symbol-icons';
import { Range } from 'vs/editor/common/core/range';
import { SymbolKind, symbolKindToCssClass, SymbolTag } from 'vs/editor/common/modes';
import { SymbolKind, SymbolKinds, SymbolTag } from 'vs/editor/common/modes';
import { OutlineElement, OutlineGroup, OutlineModel } from 'vs/editor/contrib/documentSymbols/outlineModel';
import { localize } from 'vs/nls';
import { IconLabel } from 'vs/base/browser/ui/iconLabel/iconLabel';
@@ -44,7 +44,7 @@ export class OutlineIdentityProvider implements IIdentityProvider<OutlineItem> {
}
export class OutlineGroupTemplate {
static id = 'OutlineGroupTemplate';
static readonly id = 'OutlineGroupTemplate';
constructor(
readonly labelContainer: HTMLElement,
readonly label: HighlightedLabel,
@@ -52,7 +52,7 @@ export class OutlineGroupTemplate {
}
export class OutlineElementTemplate {
static id = 'OutlineElementTemplate';
static readonly id = 'OutlineElementTemplate';
constructor(
readonly container: HTMLElement,
readonly iconLabel: IconLabel,
@@ -125,7 +125,7 @@ export class OutlineElementRenderer implements ITreeRenderer<OutlineElement, Fuz
};
if (this._configurationService.getValue(OutlineConfigKeys.icons)) {
// add styles for the icons
options.extraClasses.push(`outline-element-icon ${symbolKindToCssClass(element.symbol.kind, true)}`);
options.extraClasses.push(`outline-element-icon ${SymbolKinds.toCssClassName(element.symbol.kind, true)}`);
}
if (element.symbol.tags.indexOf(SymbolTag.Deprecated) >= 0) {
options.extraClasses.push(`deprecated`);
@@ -168,7 +168,7 @@ export class OutlineElementRenderer implements ITreeRenderer<OutlineElement, Fuz
} else {
dom.show(template.decoration);
dom.addClass(template.decoration, 'bubble');
template.decoration.innerText = '\uf052';
template.decoration.innerText = '\uea71';
template.decoration.title = localize('deep.problem', "Contains elements with problems");
template.decoration.style.setProperty('--outline-element-color', cssColor);
}
@@ -214,6 +214,31 @@ export const enum OutlineSortOrder {
ByKind
}
export class OutlineFilter implements ITreeFilter<OutlineItem> {
private readonly _filteredTypes = new Set<SymbolKind>();
constructor(
private readonly _prefix: string,
@IConfigurationService private readonly _configService: IConfigurationService,
) {
}
update() {
this._filteredTypes.clear();
for (const name of SymbolKinds.names()) {
if (!this._configService.getValue<boolean>(`${this._prefix}.${name}`)) {
this._filteredTypes.add(SymbolKinds.fromString(name) || -1);
}
}
}
filter(element: OutlineItem): boolean {
return !(element instanceof OutlineElement) || !this._filteredTypes.has(element.symbol.kind);
}
}
export class OutlineItemComparator implements ITreeSorter<OutlineItem> {
private readonly _collator = new IdleValue<Intl.Collator>(() => new Intl.Collator(undefined, { numeric: true }));