File tree Expand file tree Collapse file tree 5 files changed +15
-3
lines changed
datascience/interactive-common Expand file tree Collapse file tree 5 files changed +15
-3
lines changed Original file line number Diff line number Diff line change
1
+ Have sys info show that we have connected to an existing server.
Original file line number Diff line number Diff line change 178
178
"DataScience.pythonVersionHeader" : " Python version:" ,
179
179
"DataScience.pythonRestartHeader" : " Restarted kernel:" ,
180
180
"DataScience.pythonNewHeader" : " Started new kernel:" ,
181
+ "DataScience.pythonConnectHeader" : " Connected to kernel:" ,
181
182
"DataScience.executingCodeFailure" : " Executing code failed : {0}" ,
182
183
"DataScience.inputWatermark" : " Type code here and press shift-enter to run" ,
183
184
"DataScience.deleteButtonTooltip" : " Remove cell" ,
Original file line number Diff line number Diff line change @@ -409,6 +409,7 @@ export namespace DataScience {
409
409
export const pythonVersionHeader = localize ( 'DataScience.pythonVersionHeader' , 'Python Version:' ) ;
410
410
export const pythonRestartHeader = localize ( 'DataScience.pythonRestartHeader' , 'Restarted Kernel:' ) ;
411
411
export const pythonNewHeader = localize ( 'DataScience.pythonNewHeader' , 'Started new kernel:' ) ;
412
+ export const pythonConnectHeader = localize ( 'DataScience.pythonConnectHeader' , 'Connected to kernel:' ) ;
412
413
413
414
export const jupyterSelectURIPrompt = localize (
414
415
'DataScience.jupyterSelectURIPrompt' ,
Original file line number Diff line number Diff line change @@ -1361,6 +1361,9 @@ export abstract class InteractiveBase extends WebViewHost<IInteractiveWindowMapp
1361
1361
case SysInfoReason . New :
1362
1362
return localize . DataScience . pythonNewHeader ( ) ;
1363
1363
break ;
1364
+ case SysInfoReason . Connect :
1365
+ return localize . DataScience . pythonConnectHeader ( ) ;
1366
+ break ;
1364
1367
default :
1365
1368
traceError ( 'Invalid SysInfoReason' ) ;
1366
1369
return '' ;
@@ -1479,8 +1482,13 @@ export abstract class InteractiveBase extends WebViewHost<IInteractiveWindowMapp
1479
1482
}
1480
1483
await this . commandManager . executeCommand ( Commands . SwitchJupyterKernel , this . _notebook ) ;
1481
1484
}
1482
- private async kernelChangeHandler ( _kernel : IJupyterKernelSpec | LiveKernelModel ) {
1483
- await this . addSysInfo ( SysInfoReason . New ) ;
1485
+ private async kernelChangeHandler ( kernel : IJupyterKernelSpec | LiveKernelModel ) {
1486
+ // Check if we are changing to LiveKernelModel
1487
+ if ( kernel . hasOwnProperty ( 'numberOfConnections' ) ) {
1488
+ await this . addSysInfo ( SysInfoReason . Connect ) ;
1489
+ } else {
1490
+ await this . addSysInfo ( SysInfoReason . New ) ;
1491
+ }
1484
1492
}
1485
1493
1486
1494
private openSettings ( setting : string | undefined ) {
Original file line number Diff line number Diff line change @@ -147,7 +147,8 @@ export enum SysInfoReason {
147
147
Start ,
148
148
Restart ,
149
149
Interrupt ,
150
- New
150
+ New ,
151
+ Connect
151
152
}
152
153
153
154
export interface IAddedSysInfo {
You can’t perform that action at this time.
0 commit comments