mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-12 03:51:37 -04:00
Add scripted object name to query editor tab display (#4403)
* Add scripted object name to query editor tab display * Update src/sql/parts/query/common/queryInput.ts Co-Authored-By: shueybubbles <shueybubbles@hotmail.com>
This commit is contained in:
@@ -223,7 +223,8 @@ export function script(connectionProfile: IConnectionProfile, metadata: azdata.O
|
||||
let script: string = result.script;
|
||||
|
||||
if (script) {
|
||||
queryEditorService.newSqlEditor(script, connectionProfile.providerName).then((owner) => {
|
||||
let description = (metadata.schema && metadata.schema !== '') ? `${metadata.schema}.${metadata.name}` : metadata.name;
|
||||
queryEditorService.newSqlEditor(script, connectionProfile.providerName, undefined, description).then((owner) => {
|
||||
// Connect our editor to the input connection
|
||||
let options: IConnectionCompletionOptions = {
|
||||
params: { connectionType: ConnectionType.editor, runQueryOnCompletion: RunQueryOnConnectionMode.none, input: owner },
|
||||
|
||||
@@ -74,7 +74,7 @@ export class QueryEditorService implements IQueryEditorService {
|
||||
/**
|
||||
* Creates new untitled document for SQL query and opens in new editor tab
|
||||
*/
|
||||
public newSqlEditor(sqlContent?: string, connectionProviderName?: string, isDirty?: boolean): Promise<IConnectableInput> {
|
||||
public newSqlEditor(sqlContent?: string, connectionProviderName?: string, isDirty?: boolean, objectName?: string): Promise<IConnectableInput> {
|
||||
return new Promise<IConnectableInput>(async (resolve, reject) => {
|
||||
try {
|
||||
// Create file path and file URI
|
||||
@@ -92,7 +92,7 @@ export class QueryEditorService implements IQueryEditorService {
|
||||
}
|
||||
|
||||
const queryResultsInput: QueryResultsInput = this._instantiationService.createInstance(QueryResultsInput, docUri.toString());
|
||||
let queryInput: QueryInput = this._instantiationService.createInstance(QueryInput, '', fileInput, queryResultsInput, connectionProviderName);
|
||||
let queryInput: QueryInput = this._instantiationService.createInstance(QueryInput, objectName, fileInput, queryResultsInput, connectionProviderName);
|
||||
|
||||
this._editorService.openEditor(queryInput, { pinned: true })
|
||||
.then((editor) => {
|
||||
|
||||
@@ -23,7 +23,7 @@ export interface IQueryEditorService {
|
||||
_serviceBrand: any;
|
||||
|
||||
// Creates new untitled document for SQL queries and opens it in a new editor tab
|
||||
newSqlEditor(sqlContent?: string, connectionProviderName?: string, isDirty?: boolean): Promise<IConnectableInput>;
|
||||
newSqlEditor(sqlContent?: string, connectionProviderName?: string, isDirty?: boolean, objectName?:string ): Promise<IConnectableInput>;
|
||||
|
||||
// Creates a new query plan document
|
||||
newQueryPlanEditor(xmlShowPlan: string): Promise<any>;
|
||||
|
||||
Reference in New Issue
Block a user