-
-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathCodeNavToolWindow.cs
More file actions
30 lines (24 loc) · 1.16 KB
/
Copy pathCodeNavToolWindow.cs
File metadata and controls
30 lines (24 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using CodeNav.OutOfProc.Services;
using Microsoft.VisualStudio.Extensibility;
using Microsoft.VisualStudio.Extensibility.ToolWindows;
using Microsoft.VisualStudio.RpcContracts.RemoteUI;
namespace CodeNav.OutOfProc.ToolWindows;
[VisualStudioContribution]
internal class CodeNavToolWindow(CodeDocumentService codeDocumentService) : ToolWindow
{
public override ToolWindowConfiguration ToolWindowConfiguration => new()
{
Placement = ToolWindowPlacement.Floating,
// TODO: Bug: This breaks a synchronous loaded hybrid extension and freezes VS during startup
// https://github.com/sboulema/CodeNav/issues/157
//VisibleWhen = ActivationConstraint.ClientContext(ClientContextKey.Shell.ActiveSelectionFileName, @"\.cs$"),
};
public override Task InitializeAsync(CancellationToken cancellationToken)
{
Title = "CodeNav";
codeDocumentService.ToolWindow = this;
return Task.CompletedTask;
}
public override Task<IRemoteUserControl> GetContentAsync(CancellationToken cancellationToken)
=> Task.FromResult<IRemoteUserControl>(new CodeNavToolWindowControl(codeDocumentService.CodeDocumentViewModel));
}