Fix intellisense for .NET Interactive SQL kernel (#19254)

This commit is contained in:
Cory Rivera
2022-05-02 13:44:33 -07:00
committed by GitHub
parent bfd878bff7
commit 8cc66dade3
11 changed files with 52 additions and 6 deletions

View File

@@ -35,6 +35,7 @@ import { CellOutputEdit, CellOutputDataEdit } from 'sql/workbench/services/noteb
import { ILogService } from 'vs/platform/log/common/log';
import { IModeService } from 'vs/editor/common/services/modeService';
import { ICellMetadata } from 'sql/workbench/api/common/sqlExtHostTypes';
import { CELL_URI_PATH_PREFIX } from 'sql/workbench/common/constants';
let modelId = 0;
const ads_execute_command = 'ads_execute_command';
@@ -1121,7 +1122,7 @@ export class CellModel extends Disposable implements ICellModel {
}
private createUri(): void {
let uri = URI.from({ scheme: Schemas.untitled, path: `notebook-editor-${this.id}` });
let uri = URI.from({ scheme: Schemas.untitled, path: `${CELL_URI_PATH_PREFIX}${this.id}` });
// Use this to set the internal (immutable) and public (shared with extension) uri properties
this.cellUri = uri;
}

View File

@@ -144,6 +144,8 @@ export interface INotebookService {
openNotebook(resource: UriComponents, options: INotebookShowOptions): Promise<IEditorPane | undefined>;
getUntitledUriPath(originalTitle: string): string;
getNotebookURIForCell(cellUri: URI): URI | undefined;
}
export interface IExecuteProvider {

View File

@@ -371,6 +371,19 @@ export class NotebookService extends Disposable implements INotebookService {
return title;
}
public getNotebookURIForCell(cellUri: URI): URI | undefined {
for (let editor of this.listNotebookEditors()) {
if (editor.cells) {
for (let cell of editor.cells) {
if (cell.cellUri === cellUri) {
return editor.notebookParams.notebookUri;
}
}
}
}
return undefined;
}
private updateSQLRegistrationWithConnectionProviders() {
// Update the SQL extension
let sqlNotebookKernels = this._providerToStandardKernels.get(notebookConstants.SQL);