Skip to content

Commit f1aa3fb

Browse files
authored
Merge branch 'main' into revamp-quarto-lang-context-keys
2 parents 35ad78a + 772c650 commit f1aa3fb

File tree

4 files changed

+22
-1
lines changed

4 files changed

+22
-1
lines changed

apps/vscode/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- Provide F1 help at cursor in Positron (<https://github.com/quarto-dev/quarto/pull/599>)
66
- Expose new context keys for the main language of a document (<https://github.com/quarto-dev/quarto/pull/608>)
7+
- No longer send all snippet suggestions to the bottom of the completion list (<https://github.com/quarto-dev/quarto/pull/609>).
78

89
## 1.117.0 (Release on 2024-11-07)
910

apps/vscode/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,6 @@
896896
"strings": "on"
897897
},
898898
"editor.quickSuggestionsDelay": 250,
899-
"editor.snippetSuggestions": "bottom",
900899
"editor.wordBasedSuggestions": "off",
901900
"editor.suggestOnTriggerCharacters": true,
902901
"editor.unicodeHighlight.ambiguousCharacters": false,

apps/vscode/src/host/executors.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
129148
const 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

152172
function findExecutor(

apps/vscode/src/host/hooks.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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> => {

0 commit comments

Comments
 (0)