fix notebookinput matches function to work with replacement (#8585)

This commit is contained in:
Anthony Dresser
2019-12-05 16:53:36 -08:00
committed by GitHub
parent 3de95af25c
commit 4787d7ba5c
6 changed files with 27 additions and 52 deletions

View File

@@ -14,7 +14,6 @@ import { EncodingMode } from 'vs/workbench/common/editor';
import { TextFileEditorModel } from 'vs/workbench/services/textfile/common/textFileEditorModel';
import { BinaryEditorModel } from 'vs/workbench/common/editor/binaryEditorModel';
import { IFileService } from 'vs/platform/files/common/files';
import { ITextFileSaveOptions } from 'vs/workbench/services/textfile/common/textfiles';
type PublicPart<T> = { [K in keyof T]: T[K] };
@@ -82,14 +81,6 @@ export class FileQueryEditorInput extends QueryEditorInput implements PublicPart
this.text.setForceOpenAsBinary();
}
save(groupId: number, options?: ITextFileSaveOptions): Promise<boolean> {
return this.text.save(groupId, options);
}
saveAs(group: number, options?: ITextFileSaveOptions): Promise<boolean> {
return this.text.saveAs(group, options);
}
public isResolved(): boolean {
return this.text.isResolved();
}

View File

@@ -17,6 +17,7 @@ import { IQueryModelService } from 'sql/platform/query/common/queryModel';
import { ISelectionData, ExecutionPlanOptions } from 'azdata';
import { startsWith } from 'vs/base/common/strings';
import { ITextFileSaveOptions } from 'vs/workbench/services/textfile/common/textfiles';
const MAX_SIZE = 13;
@@ -219,6 +220,14 @@ export abstract class QueryEditorInput extends EditorInput implements IConnectab
}
}
save(groupId: number, options?: ITextFileSaveOptions): Promise<boolean> {
return this.text.save(groupId, options);
}
saveAs(group: number, options?: ITextFileSaveOptions): Promise<boolean> {
return this.text.saveAs(group, options);
}
// Called to get the tooltip of the tab
public getTitle(): string {
return this.getName(true);

View File

@@ -14,7 +14,6 @@ import { IResolvedTextEditorModel } from 'vs/editor/common/services/resolverServ
import { IFileService } from 'vs/platform/files/common/files';
import { UntitledTextEditorInput } from 'vs/workbench/common/editor/untitledTextEditorInput';
import { UntitledTextEditorModel } from 'vs/workbench/common/editor/untitledTextEditorModel';
import { ITextFileSaveOptions } from 'vs/workbench/services/textfile/common/textfiles';
type PublicPart<T> = { [K in keyof T]: T[K] };
@@ -73,14 +72,6 @@ export class UntitledQueryEditorInput extends QueryEditorInput implements IEncod
this.text.setEncoding(encoding, mode);
}
save(groupId: number, options?: ITextFileSaveOptions): Promise<boolean> {
return this.text.save(groupId, options);
}
saveAs(group: number, options?: ITextFileSaveOptions): Promise<boolean> {
return this.text.saveAs(group, options);
}
isUntitled(): boolean {
// Subclasses need to explicitly opt-in to being untitled.
return true;