mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-23 13:20:30 -04:00
Merge from vscode c58aaab8a1cc22a7139b761166a0d4f37d41e998 (#7880)
* Merge from vscode c58aaab8a1cc22a7139b761166a0d4f37d41e998 * fix pipelines * fix strict-null-checks * add missing files
This commit is contained in:
@@ -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 }));
|
||||
|
||||
Reference in New Issue
Block a user