Mitigate (but not fully fix) Run Cell from disconnected notebook (#4960)

This is a partial fix that lays groundwork for full "Prompt to connect" if a kernel needs a connection.
I am waiting on Yurong's refactoring of connection handling before doing any of the prompt work.

- Adds kernel metadata about whether a connection is required.
- For Jupyter, only Spark kernels are listed as requiring a connection
- If this is true and there's no active connection, will show notification and not call execute

In the future, this path will still be used if user is prompted to connect and cancels out.
The future change will be to inject a "connect" handler from notebook.component to the cell callback and use to set connection context
This commit is contained in:
Kevin Cunnane
2019-04-09 17:45:05 -07:00
committed by GitHub
parent d9b6ec0654
commit 37f45b10a3
8 changed files with 26 additions and 1 deletions

View File

@@ -352,6 +352,10 @@ class KernelWrapper implements azdata.nb.IKernel {
return this.kernelDetails.supportsIntellisense;
}
get requiresConnection(): boolean {
return this.kernelDetails.requiresConnection;
}
get info(): azdata.nb.IInfoReply {
return this._info;
}