mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-19 17:22:48 -05:00
Moved items around to handle new untitledQueryEditorInput location (#16914)
* moved items around to handle new untitledQueryEditorInput location * added editor inputs to constants. * added interface for untitledQueryEditorInput * added IUntitledQueryEditorInput * Revert "added IUntitledQueryEditorInput" This reverts commit 67955eb289458e7ac4e7e5ce0ee077f38ed82a2c. * Revert "added interface for untitledQueryEditorInput" This reverts commit 88552dbd811b643fd51d5d21f4571b677d7bfc73. * Revert "Revert "added interface for untitledQueryEditorInput"" This reverts commit 13a89c40e4cb0a3fa495f5b150c066892387e509. * Revert "Revert "added IUntitledQueryEditorInput"" This reverts commit 8b2258ab49275a271a39036ea1734feca98ee753. * added extends for IUntitledQueryEditorInput * added casting in editorGroupView * Revert "added casting in editorGroupView" This reverts commit 61500ea43690b08ba2393808a8d118abc60da4ac.
This commit is contained in:
71
src/sql/base/query/browser/untitledQueryEditorInput.ts
Normal file
71
src/sql/base/query/browser/untitledQueryEditorInput.ts
Normal file
@@ -0,0 +1,71 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { QueryEditorInput } from 'sql/workbench/common/editor/query/queryEditorInput';
|
||||
import { QueryResultsInput } from 'sql/workbench/common/editor/query/queryResultsInput';
|
||||
import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement';
|
||||
import { IQueryModelService } from 'sql/workbench/services/query/common/queryModel';
|
||||
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IResolvedTextEditorModel } from 'vs/editor/common/services/resolverService';
|
||||
import { UntitledTextEditorInput } from 'vs/workbench/services/untitled/common/untitledTextEditorInput';
|
||||
import { IUntitledTextEditorModel } from 'vs/workbench/services/untitled/common/untitledTextEditorModel';
|
||||
import { EncodingMode } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { EditorInputCapabilities } from 'vs/workbench/common/editor';
|
||||
import { UNTITLED_QUERY_EDITOR_TYPEID } from 'sql/workbench/common/constants';
|
||||
import { IUntitledQueryEditorInput } from 'sql/base/query/common/untitledQueryEditorInput';
|
||||
|
||||
export class UntitledQueryEditorInput extends QueryEditorInput implements IUntitledQueryEditorInput {
|
||||
|
||||
public static readonly ID = UNTITLED_QUERY_EDITOR_TYPEID;
|
||||
|
||||
constructor(
|
||||
description: string | undefined,
|
||||
text: UntitledTextEditorInput,
|
||||
results: QueryResultsInput,
|
||||
@IConnectionManagementService connectionManagementService: IConnectionManagementService,
|
||||
@IQueryModelService queryModelService: IQueryModelService,
|
||||
@IConfigurationService configurationService: IConfigurationService
|
||||
) {
|
||||
super(description, text, results, connectionManagementService, queryModelService, configurationService);
|
||||
}
|
||||
|
||||
public override resolve(): Promise<IUntitledTextEditorModel & IResolvedTextEditorModel> {
|
||||
return this.text.resolve();
|
||||
}
|
||||
|
||||
public override get text(): UntitledTextEditorInput {
|
||||
return this._text as UntitledTextEditorInput;
|
||||
}
|
||||
|
||||
public get hasAssociatedFilePath(): boolean {
|
||||
return this.text.model.hasAssociatedFilePath;
|
||||
}
|
||||
|
||||
public setMode(mode: string): void {
|
||||
this.text.setMode(mode);
|
||||
}
|
||||
|
||||
public getMode(): string | undefined {
|
||||
return this.text.getMode();
|
||||
}
|
||||
|
||||
override get typeId(): string {
|
||||
return UntitledQueryEditorInput.ID;
|
||||
}
|
||||
|
||||
public getEncoding(): string | undefined {
|
||||
return this.text.getEncoding();
|
||||
}
|
||||
|
||||
public setEncoding(encoding: string, mode: EncodingMode): Promise<void> {
|
||||
return this.text.setEncoding(encoding, mode);
|
||||
}
|
||||
|
||||
override get capabilities(): EditorInputCapabilities {
|
||||
// Subclasses need to explicitly opt-in to being untitled.
|
||||
return EditorInputCapabilities.Untitled;
|
||||
}
|
||||
}
|
||||
33
src/sql/base/query/common/untitledQueryEditorInput.ts
Normal file
33
src/sql/base/query/common/untitledQueryEditorInput.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { IConnectableInput } from 'sql/platform/connection/common/connectionManagement';
|
||||
import { IResolvedTextEditorModel } from 'vs/editor/common/services/resolverService';
|
||||
import { EditorInputCapabilities } from 'vs/workbench/common/editor';
|
||||
import { EditorInput } from 'vs/workbench/common/editor/editorInput';
|
||||
import { EncodingMode } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { UntitledTextEditorInput } from 'vs/workbench/services/untitled/common/untitledTextEditorInput';
|
||||
import { IUntitledTextEditorModel } from 'vs/workbench/services/untitled/common/untitledTextEditorModel';
|
||||
|
||||
export interface IUntitledQueryEditorInput extends EditorInput, IConnectableInput {
|
||||
|
||||
resolve(): Promise<IUntitledTextEditorModel & IResolvedTextEditorModel>;
|
||||
|
||||
text: UntitledTextEditorInput;
|
||||
|
||||
hasAssociatedFilePath: boolean;
|
||||
|
||||
setMode(mode: string): void
|
||||
|
||||
getMode(): string | undefined;
|
||||
|
||||
typeId: string;
|
||||
|
||||
getEncoding(): string | undefined;
|
||||
|
||||
setEncoding(encoding: string, mode: EncodingMode): Promise<void>
|
||||
|
||||
capabilities: EditorInputCapabilities
|
||||
}
|
||||
Reference in New Issue
Block a user