Integrate Contextualization API into Azure Data Studio to get better query recommendations from Copilot (#24044)

* Boilerplate for new metadata API endpoint

* Register all server metadata provider

* Fully registers data provider

* Registers metadata provider

* Instantiate metadata service

* Generates server metadata when connection is established

* Allow queryEditorInput to get server metadata

* Minor clean up

* Renames metadata provider and request endpoint

* Corrects documentation block

* Integrates get server metadata request endpoint

* Adjusts GetServerMetadataResult scripts type

* Add back Cargo.toml file

* Fix SQL hygiene error

* reflect changes made in in STS for table metadata

* Adds feature toggle to serverMetadataService

* Places toggle before request to get create scripts

* Fix build check issues

* Minor review changes

* Improves contextualization setting label

* Generalize contextualization service names

* Additional code review changes

* Update extensions/mssql/src/contracts.ts

Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>

* Update src/sql/azdata.proposed.d.ts

Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>

* Code reivew changes

* Capitalize c in contextualization

* Additional review changes

* Update provider type

* Simplify type and method names

* Unregister MSSQL ServerContextualization provider

---------

Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>
This commit is contained in:
Lewis Sanchez
2023-08-21 19:54:44 -07:00
committed by GitHub
parent df5693ffd3
commit d5a9c172d1
19 changed files with 336 additions and 10 deletions

View File

@@ -228,6 +228,8 @@ import { ITableDesignerService } from 'sql/workbench/services/tableDesigner/comm
import { TableDesignerService } from 'sql/workbench/services/tableDesigner/browser/tableDesignerService';
import { IExecutionPlanService } from 'sql/workbench/services/executionPlan/common/interfaces';
import { ExecutionPlanService } from 'sql/workbench/services/executionPlan/common/executionPlanService';
import { IServerContextualizationService } from 'sql/workbench/services/contextualization/common/interfaces';
import { ServerContextualizationService } from 'sql/workbench/services/contextualization/common/serverContextualizationService';
import { IErrorDiagnosticsService } from 'sql/workbench/services/diagnostics/common/errorDiagnosticsService';
import { ErrorDiagnosticsService } from 'sql/workbench/services/diagnostics/browser/errorDiagnosticsService';
import { IComponentContextService, ComponentContextService } from 'sql/workbench/services/componentContext/browser/componentContextService';
@@ -275,6 +277,7 @@ registerSingleton(IAssessmentService, AssessmentService, InstantiationType.Eager
registerSingleton(IDataGridProviderService, DataGridProviderService, InstantiationType.Eager);
registerSingleton(ITableDesignerService, TableDesignerService, InstantiationType.Eager);
registerSingleton(IExecutionPlanService, ExecutionPlanService, InstantiationType.Eager);
registerSingleton(IServerContextualizationService, ServerContextualizationService, InstantiationType.Eager);
registerSingleton(IErrorDiagnosticsService, ErrorDiagnosticsService, InstantiationType.Eager);
registerSingleton(IComponentContextService, ComponentContextService, InstantiationType.Eager);
//#endregion