Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kernel connection list #3810

Merged
merged 17 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion repack.ps1
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@

Push-Location $PSScriptRoot
$ErrorActionPreference = "Stop"

try
{
# clean up the previously-cached NuGet packages
Remove-Item -Recurse ~\.nuget\packages\microsoft.dotnet.interactive* -Force
$nugetCachePath = $env:NUGET_HTTP_CACHE_PATH
if (-not $nugetCachePath) {
$nugetCachePath = "~\.nuget\packages"
}
Remove-Item -Recurse "$nugetCachePath\microsoft.dotnet.interactive*" -Force

# build and pack dotnet-interactive
dotnet clean -c debug
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,8 @@ Microsoft.DotNet.Interactive.Events
public Microsoft.DotNet.Interactive.IKernelExtension KernelExtension { get;}
public class KernelInfoProduced : KernelEvent
.ctor(Microsoft.DotNet.Interactive.KernelInfo kernelInfo, Microsoft.DotNet.Interactive.Commands.KernelCommand command)
public System.String ConnectionShortcutCode { get;}
public System.Reflection.Assembly ConnectionSourceAssembly { get;}
public Microsoft.DotNet.Interactive.KernelInfo KernelInfo { get;}
public class KernelReady : KernelEvent
.ctor(Microsoft.DotNet.Interactive.KernelInfo[] kernelInfos)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ Microsoft.DotNet.Interactive.Jupyter
.ctor(Microsoft.DotNet.Interactive.Kernel kernel, System.Reactive.Concurrency.IScheduler scheduler = null)
public System.Threading.Tasks.Task Handle(JupyterRequestContext context)
protected System.Void OnKernelEventReceived(Microsoft.DotNet.Interactive.Events.KernelEvent event, JupyterRequestContext context)
public class CondaEnvironment, IJupyterEnvironment
public static System.String CondaPath { get;}
public static System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<System.String>> GetEnvironmentNamesAsync()
public System.String Name { get; set;}
public System.Threading.Tasks.Task<Microsoft.DotNet.Interactive.Utility.CommandLineResult> ExecuteAsync(System.String command, System.String args, System.IO.DirectoryInfo workingDir = null, System.Nullable<System.TimeSpan> timeout = null)
public System.Diagnostics.Process StartProcess(System.String command, System.String args, System.IO.DirectoryInfo workingDir, System.Action<System.String> output = null, System.Action<System.String> error = null)
public class ConnectionInformation
public static ConnectionInformation Load(System.IO.FileInfo file)
.ctor()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Microsoft.DotNet.Interactive.PowerShell
public class SecretManager
.ctor(PowerShellKernel kernel)
public System.String VaultName { get;}
public System.Void SetSecret(System.String name, System.String value, System.String command = null, System.String source = null)
public System.Boolean TryGetSecret(System.String secretName, ref System.String& value)
public System.Void SetValue(System.String name, System.String value)
public System.Boolean TryGetValue(System.String name, ref System.String& value)
Microsoft.DotNet.Interactive.PowerShell.Commands
public class EnterAzShellCommand : System.Management.Automation.PSCmdlet
.ctor()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ public class CSharpProjectKernelTests

public CSharpProjectKernelTests(ITestOutputHelper output)
{
CSharpProjectKernel.RegisterEventsAndCommands();

_output = output;
_disposables.Add(_output.SubscribeToPocketLogger());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</ItemGroup>

<ItemGroup>
<Compile Include="..\dotnet-interactive\Pocket\Format.CustomizeLogString.cs" Link="Pocket\Format.CustomizeLogString.cs" />
<Compile Include="..\dotnet-interactive\(Pocket)\Logger\Format.CustomizeLogString.cs" Link="Pocket\Format.CustomizeLogString.cs" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brackets in the path are interesting, did something prompt us to make that change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This colocates this PocketLogger customization file with the actual (virtual) location PocketLogger files in the solution explorer.

<Compile Include="..\Microsoft.DotNet.Interactive.CSharpProject\%28Recipes%29\AsyncLazy{T}.cs" Link="Utility\AsyncLazy{T}.cs" />
<Compile Include="..\Microsoft.DotNet.Interactive.CSharpProject\(Recipes)\JsonSerializationExtensions.cs" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,21 @@ public class CSharpProjectKernel :
IKernelCommandHandler<RequestSignatureHelp>,
IKernelCommandHandler<SubmitCode>
{
private readonly IPrebuildFinder _prebuildFinder;
private WorkspaceServer _workspaceServer;
private Workspace _workspace;
private Buffer _buffer;

public static void RegisterEventsAndCommands()
static CSharpProjectKernel()
{
// register commands and event with serialization

var commandTypes = typeof(CSharpProjectKernel).Assembly.ExportedTypes
.Where(t => t is { IsAbstract: false, IsInterface: false })
.Where(t => typeof(KernelCommand).IsAssignableFrom(t))
.OrderBy(t => t.Name)
.ToList();
var eventTypes = typeof(CSharpProjectKernel).Assembly.ExportedTypes
.Where(t => t is { IsAbstract: false, IsInterface: false })
.Where(t => typeof(KernelEvent).IsAssignableFrom(t))
.OrderBy(t => t.Name)
.ToList();
var commandTypes = typeof(CSharpProjectKernel)
.Assembly.ExportedTypes
.Where(t => t is { IsAbstract: false, IsInterface: false })
.Where(t => typeof(KernelCommand).IsAssignableFrom(t))
.OrderBy(t => t.Name)
.ToList();
var eventTypes = typeof(CSharpProjectKernel)
.Assembly.ExportedTypes
.Where(t => t is { IsAbstract: false, IsInterface: false })
.Where(t => typeof(KernelEvent).IsAssignableFrom(t))
.OrderBy(t => t.Name)
.ToList();

foreach (var commandType in commandTypes)
{
Expand All @@ -57,6 +53,14 @@ public static void RegisterEventsAndCommands()
}
}

private readonly IPrebuildFinder _prebuildFinder;

private WorkspaceServer _workspaceServer;

private Workspace _workspace;

private Buffer _buffer;

public CSharpProjectKernel(string name = "csharp", IPrebuildFinder prebuildFinder = null) : base(name)
{
_prebuildFinder = prebuildFinder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ internal class InteractiveDocumentConverter : JsonConverter<InteractiveDocument>
break;

default:

reader.Skip();
break;
}
Expand Down
1 change: 0 additions & 1 deletion src/Microsoft.DotNet.Interactive.Formatting/Formatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ public static void ResetToDefault()
// In the lists of default formatters, the highest priority ones come first,
// so register those last.

// TODO: (ResetToDefault) remove the need to reverse these
_defaultTypeFormatters.PushRange(((IEnumerable<ITypeFormatter>)TabularDataResourceFormatter.DefaultFormatters).Reverse().ToArray());
_defaultTypeFormatters.PushRange(((IEnumerable<ITypeFormatter>)CsvFormatter.DefaultFormatters).Reverse().ToArray());
_defaultTypeFormatters.PushRange(((IEnumerable<ITypeFormatter>)HtmlFormatter.DefaultFormatters).Reverse().ToArray());
Expand Down
Loading