mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from vscode 099a7622e6e90dbcc226e428d4e35a72cb19ecbc (#9646)
* Merge from vscode 099a7622e6e90dbcc226e428d4e35a72cb19ecbc * fix strict
This commit is contained in:
@@ -1319,7 +1319,8 @@ export interface IEditorPartOptionsChangeEvent {
|
||||
|
||||
export enum SideBySideEditor {
|
||||
MASTER = 1,
|
||||
DETAILS = 2
|
||||
DETAILS = 2,
|
||||
BOTH = 3
|
||||
}
|
||||
|
||||
export interface IResourceOptions {
|
||||
@@ -1327,12 +1328,22 @@ export interface IResourceOptions {
|
||||
filterByScheme?: string | string[];
|
||||
}
|
||||
|
||||
export function toResource(editor: IEditorInput | undefined, options?: IResourceOptions): URI | undefined {
|
||||
export function toResource(editor: IEditorInput | undefined): URI | undefined;
|
||||
export function toResource(editor: IEditorInput | undefined, options: IResourceOptions & { supportSideBySide?: SideBySideEditor.MASTER | SideBySideEditor.DETAILS }): URI | undefined;
|
||||
export function toResource(editor: IEditorInput | undefined, options: IResourceOptions & { supportSideBySide: SideBySideEditor.BOTH }): URI | { master?: URI, detail?: URI } | undefined;
|
||||
export function toResource(editor: IEditorInput | undefined, options?: IResourceOptions): URI | { master?: URI, detail?: URI } | undefined {
|
||||
if (!editor) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (options?.supportSideBySide && editor instanceof SideBySideEditorInput) {
|
||||
if (options?.supportSideBySide === SideBySideEditor.BOTH) {
|
||||
return {
|
||||
master: toResource(editor.master, { filterByScheme: options.filterByScheme }),
|
||||
detail: toResource(editor.details, { filterByScheme: options.filterByScheme })
|
||||
};
|
||||
}
|
||||
|
||||
editor = options.supportSideBySide === SideBySideEditor.MASTER ? editor.master : editor.details;
|
||||
}
|
||||
|
||||
@@ -1341,12 +1352,14 @@ export function toResource(editor: IEditorInput | undefined, options?: IResource
|
||||
return resource;
|
||||
}
|
||||
|
||||
if (Array.isArray(options.filterByScheme) && options.filterByScheme.some(scheme => resource.scheme === scheme)) {
|
||||
return resource;
|
||||
}
|
||||
|
||||
if (options.filterByScheme === resource.scheme) {
|
||||
return resource;
|
||||
if (Array.isArray(options.filterByScheme)) {
|
||||
if (options.filterByScheme.some(scheme => resource.scheme === scheme)) {
|
||||
return resource;
|
||||
}
|
||||
} else {
|
||||
if (options.filterByScheme === resource.scheme) {
|
||||
return resource;
|
||||
}
|
||||
}
|
||||
|
||||
return undefined;
|
||||
|
||||
@@ -113,8 +113,8 @@ export class ResourceGlobMatcher extends Disposable {
|
||||
private readonly _onExpressionChange = this._register(new Emitter<void>());
|
||||
readonly onExpressionChange = this._onExpressionChange.event;
|
||||
|
||||
private readonly mapRootToParsedExpression: Map<string | null, ParsedExpression> = new Map<string, ParsedExpression>();
|
||||
private readonly mapRootToExpressionConfig: Map<string | null, IExpression> = new Map<string, IExpression>();
|
||||
private readonly mapRootToParsedExpression = new Map<string | null, ParsedExpression>();
|
||||
private readonly mapRootToExpressionConfig = new Map<string | null, IExpression>();
|
||||
|
||||
constructor(
|
||||
private globFn: (root?: URI) => IExpression,
|
||||
|
||||
Reference in New Issue
Block a user