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

@@ -17,6 +17,10 @@ const DotnetInteractiveLanguagePrefix = 'dotnet-interactive.';
export const DotnetInteractiveDisplayName = '.NET Interactive';
export function convertToVSCodeNotebookCell(cellKind: azdata.nb.CellType, cellIndex: number, cellUri: URI, docUri: URI, cellLanguage: string, cellSource?: string | string[]): vscode.NotebookCell {
// We only use this notebook field for .NET Interactive's intellisense, which only uses the notebook's URI
let notebook = <vscode.NotebookDocument>{
uri: docUri
};
return <vscode.NotebookCell>{
kind: cellKind === CellTypes.Code ? NotebookCellKind.Code : NotebookCellKind.Markup,
index: cellIndex,
@@ -24,10 +28,9 @@ export function convertToVSCodeNotebookCell(cellKind: azdata.nb.CellType, cellIn
uri: cellUri,
languageId: cellLanguage,
getText: () => Array.isArray(cellSource) ? cellSource.join('') : (cellSource ?? ''),
notebook: notebook
},
notebook: <vscode.NotebookDocument>{
uri: docUri
},
notebook: notebook,
outputs: [],
metadata: {},
mime: undefined