Skip to content

Commit 5d87547

Browse files
authoredJul 17, 2024··
New magic command parser (#3563)
* cleanup * rename lower-level parsing classes for reuse * it builds * wip * wip * cleanup * directive options and arguments * diagnostics for unknown magics and options * basic subcommand support * renames and cleanup * initial parsing of inline JSON * more code reorganization, start on directive serializability * finish removing named vs unnamed parameter distinction * support for serializing directives to JSON * cleanup * inherited and implicit parameters, JSON improvements * limit subcommand nesting to only one level * SubmissionParserTests passing * DirectiveTests passing * InputsWithinMagicCommandsTests passing * VariableSharingWithinMagicCommandsTests passing * refactoring, WIP on #!set and #!share * WIP on submission splitting refactor * #!share using new parser * Custom kernel specifiers, start on #!value * variable sharing improvements * fix #!value --from-file and --from-url * rename lower-level parsing classes for reuse * it builds * wip * wip * cleanup * directive options and arguments * diagnostics for unknown magics and options * basic subcommand support * renames and cleanup * initial parsing of inline JSON * more code reorganization, start on directive serializability * finish removing named vs unnamed parameter distinction * support for serializing directives to JSON * cleanup * inherited and implicit parameters, JSON improvements * limit subcommand nesting to only one level * SubmissionParserTests passing * DirectiveTests passing * InputsWithinMagicCommandsTests passing * VariableSharingWithinMagicCommandsTests passing * refactoring, WIP on #!set and #!share * WIP on submission splitting refactor * #!share using new parser * Custom kernel specifiers, start on #!value * variable sharing improvements * #!value --from-file and --from-url * fix more KeyValueStoreKernel tests * merge cleanup * fix a few tests accounting for empty DiagnosticsProduced event * more test fixes * fix some warnings * fix warnings, move PackageManagement and Journey to net8.0 * fix warnings and IVT * wire up #r nuget to new parser * wire up #i nuget to new parser * package loading fixes * explicitly set split command's SchedulingScope to parent's * update #!import to use new parser * get #!connect scenarios building using new API * Update #!mermaid to new parser * rename incorrectly named local function * allow directive subcommands to contain "-" and "_" * named pipe connections working, stio refactored but failing * add support for arrays in inline JSON in directives * fix stdio kernel connector * fix SQLite directive parsing * remove ChooseKernelDirective and derived types * update #!who and #!whos to use the new parser * SQL and KQL connector fixes * remove System.CommandLine reference from several projects * improve subcommand parameter parsing * basic completion support for magic commands * completion improvements * improve magic command completions to accommodate more kernel test cases * magic command completion fixes * update contract tests * a few more completion fixes * update Polyglot Notebooks for contract changes * fill missing magic command description * make SubmitCode.parameters optional in TypeScript contract * more contract test updates * fix ambiguous call error * more stdio and jupyter fixes * make a few more tests pass * fix ExtensionLab magic commands * fix another test using #!connect stdio * fix Journey magic commands * support custom validations without (internal-only) custom parsing * contract updates * fix occasional accidental reparenting; some code cleanup * allow events to be accessed after KernelInvocationContext is disposed * pass defaultKernelName per parse * combinatorial testing and bug fixes This includes some refactoring to reuse the combinatorial test utilities from the HTTP parser * update API baseline * more completion fixes * a little completion code cleanup * fix magic command completions in Polyglot Notebooks
1 parent 99446ae commit 5d87547

File tree

356 files changed

+10824
-7490
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

356 files changed

+10824
-7490
lines changed
 

‎NotebookTestScript.dib

+4-6
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ console.log(jsKernel.name);
100100
# Execute the next cell. After execution, the output immediately below should be:
101101

102102
```
103-
[".NET","csharp","fsharp","html","http","javascript","kql","mermaid","pwsh","sql","value","vscode","webview"]
103+
[".NET","csharp","fsharp","html","http","javascript","kql","mermaid","pwsh","sql","value","webview"]
104104
```
105105

106106
#!javascript
@@ -140,11 +140,9 @@ await kernel.root.send(command);
140140

141141
# Execute the next cell, the output should be displayed as HTML like so:
142142

143-
| Name | Salary |
144-
:---|---: |
145-
| Developer | 42 |
143+
<details class="dni-treeview" open=""><summary><span class="dni-code-hint"><code>{ Name = Developer, Salary = 42 }</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>Name</td><td><div class="dni-plaintext"><pre>Developer</pre></div></td></tr><tr><td>Salary</td><td><div class="dni-plaintext"><pre>42</pre></div></td></tr></tbody></table></div></details>
146144

147-
change the renderer using the `...` element, choose the json and the output should look like so:
145+
Next, change the renderer using the `...` element, choose the json and the output should look like so:
148146

149147
``` json
150148
{"Name":"Developer","Salary":42}
@@ -153,7 +151,7 @@ change the renderer using the `...` element, choose the json and the output shou
153151
#!csharp
154152

155153
var value = new { Name = "Developer", Salary = 42 };
156-
value.Display("application/json", "text/html");
154+
value.Display("text/html", "application/json");
157155

158156
#!markdown
159157

‎dotnet-interactive.sln

+15
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Interactiv
121121
EndProject
122122
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Interactive.NamedPipeConnector.Tests", "src\Microsoft.DotNet.Interactive.NamedPipeConnector.Tests\Microsoft.DotNet.Interactive.NamedPipeConnector.Tests.csproj", "{B12834B8-373E-4932-852B-90E332A4BCED}"
123123
EndProject
124+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Interactive.Parsing.Tests", "src\Microsoft.DotNet.Interactive.Parsing.Tests\Microsoft.DotNet.Interactive.Parsing.Tests.csproj", "{55138BD7-111A-43A5-BFBB-326606C4C1B5}"
125+
EndProject
124126
Global
125127
GlobalSection(SolutionConfigurationPlatforms) = preSolution
126128
Debug|Any CPU = Debug|Any CPU
@@ -695,6 +697,18 @@ Global
695697
{B12834B8-373E-4932-852B-90E332A4BCED}.Release|x64.Build.0 = Release|Any CPU
696698
{B12834B8-373E-4932-852B-90E332A4BCED}.Release|x86.ActiveCfg = Release|Any CPU
697699
{B12834B8-373E-4932-852B-90E332A4BCED}.Release|x86.Build.0 = Release|Any CPU
700+
{55138BD7-111A-43A5-BFBB-326606C4C1B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
701+
{55138BD7-111A-43A5-BFBB-326606C4C1B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
702+
{55138BD7-111A-43A5-BFBB-326606C4C1B5}.Debug|x64.ActiveCfg = Debug|Any CPU
703+
{55138BD7-111A-43A5-BFBB-326606C4C1B5}.Debug|x64.Build.0 = Debug|Any CPU
704+
{55138BD7-111A-43A5-BFBB-326606C4C1B5}.Debug|x86.ActiveCfg = Debug|Any CPU
705+
{55138BD7-111A-43A5-BFBB-326606C4C1B5}.Debug|x86.Build.0 = Debug|Any CPU
706+
{55138BD7-111A-43A5-BFBB-326606C4C1B5}.Release|Any CPU.ActiveCfg = Release|Any CPU
707+
{55138BD7-111A-43A5-BFBB-326606C4C1B5}.Release|Any CPU.Build.0 = Release|Any CPU
708+
{55138BD7-111A-43A5-BFBB-326606C4C1B5}.Release|x64.ActiveCfg = Release|Any CPU
709+
{55138BD7-111A-43A5-BFBB-326606C4C1B5}.Release|x64.Build.0 = Release|Any CPU
710+
{55138BD7-111A-43A5-BFBB-326606C4C1B5}.Release|x86.ActiveCfg = Release|Any CPU
711+
{55138BD7-111A-43A5-BFBB-326606C4C1B5}.Release|x86.Build.0 = Release|Any CPU
698712
EndGlobalSection
699713
GlobalSection(SolutionProperties) = preSolution
700714
HideSolutionNode = FALSE
@@ -747,6 +761,7 @@ Global
747761
{DA0B3BFC-ED19-4754-A9A0-0F831DBCC9C4} = {B95A8485-8C53-4F56-B0CE-19C0726B5805}
748762
{BF68D266-500C-49AB-80EB-1B673E37E13A} = {B95A8485-8C53-4F56-B0CE-19C0726B5805}
749763
{B12834B8-373E-4932-852B-90E332A4BCED} = {11BA3480-4584-435C-BA9A-8C554DB60E9F}
764+
{55138BD7-111A-43A5-BFBB-326606C4C1B5} = {11BA3480-4584-435C-BA9A-8C554DB60E9F}
750765
EndGlobalSection
751766
GlobalSection(ExtensibilityGlobals) = postSolution
752767
SolutionGuid = {6D05A9AF-CFFB-4187-8599-574387B76727}

0 commit comments

Comments
 (0)
Please sign in to comment.