Skip to content

Commit

Permalink
add language id, restrict to python (#15168)
Browse files Browse the repository at this point in the history
  • Loading branch information
amunger authored Feb 9, 2024
1 parent 27a498b commit 5fea034
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def _VSCODE_getVariableDescriptions(varNames):
**getVariableDescription(globals()[varName]),
"root": varName,
"propertyChain": [],
"language": "python",
}
for varName in varNames
if varName in globals()
Expand Down Expand Up @@ -103,6 +104,7 @@ def _VSCODE_getAllChildrenDescriptions(rootVarName, propertyChain, startIndex):
"name": str(i),
"root": rootVarName,
"propertyChain": propertyChain + [i],
"language": "python",
}
for i in range
]
Expand Down
4 changes: 3 additions & 1 deletion src/notebooks/controllers/vscodeNotebookController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,9 @@ export class VSCodeNotebookController implements Disposable, IVSCodeNotebookCont
this.controller.interruptHandler = this.handleInterrupt.bind(this);
this.controller.supportsExecutionOrder = true;
this.controller.supportedLanguages = this.languageService.getSupportedLanguages(kernelConnection);
this.controller.variableProvider = new JupyterVariablesProvider(jupyterVariables, this.kernelProvider);
if (this.controller.supportedLanguages.includes('python')) {
this.controller.variableProvider = new JupyterVariablesProvider(jupyterVariables, this.kernelProvider);
}
// Hook up to see when this NotebookController is selected by the UI
this.controller.onDidChangeSelectedNotebooks(this.onDidChangeSelectedNotebooks, this, this.disposables);
workspace.onDidCloseNotebookDocument(
Expand Down

0 comments on commit 5fea034

Please sign in to comment.