File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -126,6 +126,25 @@ const juliaCellExecutor: VSCodeCellExecutor = {
126126 } ,
127127} ;
128128
129+ const csharpCellExecutor : VSCodeCellExecutor = {
130+ language : "csharp" ,
131+ requiredExtension : [ "ms-dotnettools.dotnet-interactive-vscode" ] ,
132+ requiredExtensionName : "Polyglot Notebooks" ,
133+ requiredVersion : "1.0.55" , // Adjust minimum version as needed
134+ execute : async ( blocks : string [ ] , editorUri ?: Uri ) => {
135+ const extension = extensions . getExtension ( "ms-dotnettools.dotnet-interactive-vscode" ) ;
136+ if ( extension ) {
137+ if ( ! extension . isActive ) {
138+ await extension . activate ( ) ;
139+ }
140+
141+ await jupyterCellExecutor ( "csharp" ) . execute ( blocks ) ;
142+ } else {
143+ window . showErrorMessage ( "Unable to execute code - Polyglot Notebooks extension not found" ) ;
144+ }
145+ }
146+ } ;
147+
129148const bashCellExecutor : VSCodeCellExecutor = {
130149 language : "bash" ,
131150 execute : async ( blocks : string [ ] ) => {
@@ -147,6 +166,7 @@ const kCellExecutors = [
147166 bashCellExecutor ,
148167 shCellExecutor ,
149168 shellCellExecutor ,
169+ csharpCellExecutor
150170] ;
151171
152172function findExecutor (
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ export function hooksExtensionHost(): ExtensionHost {
5555 switch ( language ) {
5656 // use hooks for known runtimes
5757 case "python" :
58+ case "csharp" :
5859 case "r" :
5960 return {
6061 execute : async ( blocks : string [ ] , _editorUri ?: vscode . Uri ) : Promise < void > => {
You can’t perform that action at this time.
0 commit comments