Skip to content

Commit fe5f45f

Browse files
committed
fix: CodeNav hangs Visual Studio 2026 in the project selection popup. #157
1 parent 55aab55 commit fe5f45f

10 files changed

Lines changed: 67 additions & 85 deletions

File tree

README.md

Lines changed: 10 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ Visual Studio extension to show the code structure of your current document
3030
- Visual studio 2017, 2019 support
3131
- Customizable fonts
3232

33+
## Supported Visual Studio versions
34+
35+
- Visual Studio 2022 (Untested)
36+
- Visual Studio 2026
37+
3338
## Language support
3439
- C#
3540

@@ -45,6 +50,9 @@ Visual Studio extension to show the code structure of your current document
4550

4651
[Open VSIX Gallery](https://www.vsixgallery.com/extension/CodeNav.dcdbcca4-3a88-432f-ba04-eb4a4cb64437)
4752

53+
## Usage
54+
The CodeNav tool window can be opened via the entry in the `Extensions` menu.
55+
4856
## Screenshots
4957
![Preview](https://raw.githubusercontent.com/sboulema/CodeNav/main/art/Screenshot-light.png) ![Preview-Dark](https://raw.githubusercontent.com/sboulema/CodeNav/main/art/Screenshot-dark.png)
5058

@@ -57,48 +65,5 @@ Visual Studio extension to show the code structure of your current document
5765
#### Bookmarks
5866
![Bookmarks](https://raw.githubusercontent.com/sboulema/CodeNav/main/art/Bookmarks.png)
5967

60-
## Links
61-
62-
[DataTriggers in a XAML ItemsControl](https://github.com/microsoft/VSExtensibility/issues/456)
63-
64-
[Splitting up the tool window XAML in resource dictionaries](https://github.com/MicrosoftDocs/visualstudio-docs/blob/main/docs/extensibility/visualstudio.extensibility/inside-the-sdk/advanced-remote-ui.md#user-xaml-resource-dictionaries)
65-
66-
[Getting a clientContext in an AsyncCommand bound to a XAML Command property](https://github.com/microsoft/VSExtensibility/issues/520)
67-
68-
[Settings Sample](https://github.com/microsoft/VSExtensibility/blob/2f74457eb241552cd725c8ca544fd99797ef546e/New_Extensibility_Model/Samples/SettingsSample/README.md)
69-
70-
[Settings Sample 2](https://github.com/MicrosoftDocs/visualstudio-docs/blob/c70d685e945ff6cea8dd0f7bbb54f780ef67170e/docs/extensibility/visualstudio.extensibility/settings/settings.md?plain=1#L201)
71-
72-
[Fix having multiple projects](https://github.com/microsoft/VSExtensibility/issues/388)
73-
74-
[Making a WPF TextBox binding fire on each new character](https://stackoverflow.com/questions/10619596/making-a-wpf-textbox-binding-fire-on-each-new-character)
75-
76-
[Bind width of a textbox inside VisualBrush](https://stackoverflow.com/questions/30670911/bind-width-of-a-textbox-inside-visualbrush)
77-
78-
[How to add a vertical Separator](https://stackoverflow.com/questions/13584998/how-to-add-a-vertical-separator)
79-
80-
[Change color of Button when Mouse is over](https://stackoverflow.com/questions/20073294/change-color-of-button-when-mouse-is-over)
81-
82-
[Solving class dependencies](https://github.com/dotnet/roslyn/issues/23878)
83-
84-
[How to access the currently active Project](https://github.com/microsoft/VSExtensibility/issues/411)
85-
86-
[ListView with a GridView](https://wpf-tutorial.com/listview-control/listview-with-gridview/)
87-
88-
[Header not showing up in WPF ListView](https://stackoverflow.com/questions/1238249/header-not-showing-up-in-wpf-listview)
89-
90-
[Make WPF ComboBoxes fill a whole column width](https://stackoverflow.com/questions/826985/make-wpf-comboboxes-fill-a-whole-column-width)
91-
92-
[How Do I Set Up Grid Lines for my ListView?](https://matthiasshapiro.com/how-do-i-set-up-grid-lines-for-my-listview/)
93-
94-
[Styling the ListView Column Header](https://matthiasshapiro.com/styling-the-listview-column-header/)
95-
96-
[DataGrid in ToolWindow cannot be set to editmode](https://github.com/microsoft/VSExtensibility/issues/389)
97-
98-
[Setting WPF border visible or not depending on ScrollViewer's VerticalScrollBarVisibility property](https://stackoverflow.com/questions/73199311/setting-wpf-border-visible-or-not-depending-on-scrollviewers-verticalscrollbarv/73199480#73199480)
99-
100-
[CommentRemover Sample](https://github.com/microsoft/VSExtensibility/tree/main/New_Extensibility_Model/Samples/CommentRemover)
101-
102-
[CompositeExtension Sample](https://github.com/microsoft/VSExtensibility/tree/main/New_Extensibility_Model/Samples/CompositeExtension)
103-
104-
[VSExtensibility - #554 - Feature request: Text Editor: Scroll to line](https://github.com/microsoft/VSExtensibility/issues/554)
68+
## Documentation
69+
Looking for more info? Read the full [Documentation](https://github.com/sboulema/CodeNav/blob/main/docs/index.md) with links, guides, troubleshooting, and tips.

docs/index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# CodeNav Documentation
2+
3+
Welcome to the CodeNav documentation. Browse the sections below to learn more about the extension and its development.
4+
5+
## Links
6+

docs/links.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Links
2+
3+
Here is a list of links to helpful pages I needed when developing this extension.
4+
5+
- [DataTriggers in a XAML ItemsControl](https://github.com/microsoft/VSExtensibility/issues/456)
6+
- [Splitting up the tool window XAML in resource dictionaries](https://github.com/MicrosoftDocs/visualstudio-docs/blob/main/docs/extensibility/visualstudio.extensibility/inside-the-sdk/advanced-remote-ui.md#user-xaml-resource-dictionaries)
7+
- [Getting a clientContext in an AsyncCommand bound to a XAML Command property](https://github.com/microsoft/VSExtensibility/issues/520)
8+
- [Settings Sample](https://github.com/microsoft/VSExtensibility/blob/2f74457eb241552cd725c8ca544fd99797ef546e/New_Extensibility_Model/Samples/SettingsSample/README.md)
9+
- [Settings Sample 2](https://github.com/MicrosoftDocs/visualstudio-docs/blob/c70d685e945ff6cea8dd0f7bbb54f780ef67170e/docs/extensibility/visualstudio.extensibility/settings/settings.md?plain=1#L201)
10+
- [Fix having multiple projects](https://github.com/microsoft/VSExtensibility/issues/388)
11+
- [Making a WPF TextBox binding fire on each new character](https://stackoverflow.com/questions/10619596/making-a-wpf-textbox-binding-fire-on-each-new-character)
12+
- [Bind width of a textbox inside VisualBrush](https://stackoverflow.com/questions/30670911/bind-width-of-a-textbox-inside-visualbrush)
13+
- [How to add a vertical Separator](https://stackoverflow.com/questions/13584998/how-to-add-a-vertical-separator)
14+
- [Change color of Button when Mouse is over](https://stackoverflow.com/questions/20073294/change-color-of-button-when-mouse-is-over)
15+
- [Solving class dependencies](https://github.com/dotnet/roslyn/issues/23878)
16+
- [How to access the currently active Project](https://github.com/microsoft/VSExtensibility/issues/411)
17+
- [ListView with a GridView](https://wpf-tutorial.com/listview-control/listview-with-gridview/)
18+
- [Header not showing up in WPF ListView](https://stackoverflow.com/questions/1238249/header-not-showing-up-in-wpf-listview)
19+
- [Make WPF ComboBoxes fill a whole column width](https://stackoverflow.com/questions/826985/make-wpf-comboboxes-fill-a-whole-column-width)
20+
- [How Do I Set Up Grid Lines for my ListView?](https://matthiasshapiro.com/how-do-i-set-up-grid-lines-for-my-listview/)
21+
- [Styling the ListView Column Header](https://matthiasshapiro.com/styling-the-listview-column-header/)
22+
- [DataGrid in ToolWindow cannot be set to editmode](https://github.com/microsoft/VSExtensibility/issues/389)
23+
- [Setting WPF border visible or not depending on ScrollViewer's VerticalScrollBarVisibility property](https://stackoverflow.com/questions/73199311/setting-wpf-border-visible-or-not-depending-on-scrollviewers-verticalscrollbarv/73199480#73199480)
24+
- [CommentRemover Sample](https://github.com/microsoft/VSExtensibility/tree/main/New_Extensibility_Model/Samples/CommentRemover)
25+
- [CompositeExtension Sample](https://github.com/microsoft/VSExtensibility/tree/main/New_Extensibility_Model/Samples/CompositeExtension)
26+
- [VSExtensibility - #554 - Feature request: Text Editor: Scroll to line](https://github.com/microsoft/VSExtensibility/issues/554)

src/CodeNav.OutOfProc/CodeNav.OutOfProc.csproj

Lines changed: 16 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,6 @@
1616
the composite extension. -->
1717
<CreateVsixContainer>false</CreateVsixContainer>
1818
</PropertyGroup>
19-
<ItemGroup>
20-
<None Remove="Dialogs\FilterDialog\FilterDialogControl.xaml" />
21-
<None Remove="Dialogs\SettingsDialog\SettingsDialogControl.xaml" />
22-
<None Remove="ToolWindows\CodeNavToolWindowControl.xaml" />
23-
<None Remove="ToolWindows\Templates\CodeItemStyles.xaml" />
24-
<None Remove="ToolWindows\Templates\ExpanderStyles.xaml" />
25-
<None Remove="ToolWindows\Templates\HighlightNameStyle.xaml" />
26-
<None Remove="ToolWindows\Templates\ItemContextMenu.xaml" />
27-
<None Remove="ToolWindows\Templates\ToolbarStyles.xaml" />
28-
</ItemGroup>
2919

3020
<ItemGroup>
3121
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="5.0.0" />
@@ -40,29 +30,21 @@
4030
</ItemGroup>
4131

4232
<ItemGroup>
43-
<EmbeddedResource Include="Dialogs\FilterDialog\FilterDialogControl.xaml">
44-
<Generator>MSBuild:Compile</Generator>
45-
</EmbeddedResource>
46-
<EmbeddedResource Include="Dialogs\SettingsDialog\SettingsDialogControl.xaml">
47-
<Generator>MSBuild:Compile</Generator>
48-
</EmbeddedResource>
49-
<EmbeddedResource Include="ToolWindows\CodeNavToolWindowControl.xaml">
50-
<Generator>MSBuild:Compile</Generator>
51-
</EmbeddedResource>
52-
<EmbeddedResource Include="ToolWindows\Templates\CodeItemStyles.xaml">
53-
<Generator>MSBuild:Compile</Generator>
54-
</EmbeddedResource>
55-
<EmbeddedResource Include="ToolWindows\Templates\ExpanderStyles.xaml">
56-
<Generator>MSBuild:Compile</Generator>
57-
</EmbeddedResource>
58-
<EmbeddedResource Include="ToolWindows\Templates\HighlightNameStyle.xaml">
59-
<Generator>MSBuild:Compile</Generator>
60-
</EmbeddedResource>
61-
<EmbeddedResource Include="ToolWindows\Templates\ItemContextMenu.xaml">
62-
<Generator>MSBuild:Compile</Generator>
63-
</EmbeddedResource>
64-
<EmbeddedResource Include="ToolWindows\Templates\ToolbarStyles.xaml">
65-
<Generator>MSBuild:Compile</Generator>
66-
</EmbeddedResource>
33+
<None Remove="Dialogs\FilterDialog\FilterDialogControl.xaml" />
34+
<None Remove="Dialogs\SettingsDialog\SettingsDialogControl.xaml" />
35+
<None Remove="ToolWindows\CodeNavToolWindowControl.xaml" />
36+
<None Remove="ToolWindows\Templates\CodeItemStyles.xaml" />
37+
<None Remove="ToolWindows\Templates\ExpanderStyles.xaml" />
38+
<None Remove="ToolWindows\Templates\HighlightNameStyle.xaml" />
39+
<None Remove="ToolWindows\Templates\ItemContextMenu.xaml" />
40+
<None Remove="ToolWindows\Templates\ToolbarStyles.xaml" />
41+
<EmbeddedResource Include="Dialogs\FilterDialog\FilterDialogControl.xaml" />
42+
<EmbeddedResource Include="Dialogs\SettingsDialog\SettingsDialogControl.xaml" />
43+
<EmbeddedResource Include="ToolWindows\CodeNavToolWindowControl.xaml" />
44+
<EmbeddedResource Include="ToolWindows\Templates\CodeItemStyles.xaml" />
45+
<EmbeddedResource Include="ToolWindows\Templates\ExpanderStyles.xaml" />
46+
<EmbeddedResource Include="ToolWindows\Templates\HighlightNameStyle.xaml" />
47+
<EmbeddedResource Include="ToolWindows\Templates\ItemContextMenu.xaml" />
48+
<EmbeddedResource Include="ToolWindows\Templates\ToolbarStyles.xaml" />
6749
</ItemGroup>
6850
</Project>

src/CodeNav.OutOfProc/ExtensionEntrypoint.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ internal class ExtensionEntrypoint : Extension
1919
publisherName: "Samir Boulema",
2020
displayName: "CodeNav",
2121
description: "Show the code structure of your current document."),
22+
LoadedWhen = ActivationConstraint.ClientContext(ClientContextKey.Shell.ActiveEditorContentType, "csharp"),
2223
};
2324

2425
/// <inheritdoc />

src/CodeNav.OutOfProc/ToolWindows/CodeNavToolWindow.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ internal class CodeNavToolWindow(CodeDocumentService documentService) : ToolWind
1111
public override ToolWindowConfiguration ToolWindowConfiguration => new()
1212
{
1313
Placement = ToolWindowPlacement.Floating,
14-
VisibleWhen = ActivationConstraint.ClientContext(ClientContextKey.Shell.ActiveSelectionFileName, @"\.cs$"),
14+
// TODO: Bug: This breaks a synchronous loaded hybrid extension and freezes VS during startup
15+
// https://github.com/sboulema/CodeNav/issues/157
16+
//VisibleWhen = ActivationConstraint.ClientContext(ClientContextKey.Shell.ActiveSelectionFileName, @"\.cs$"),
1517
};
1618

1719
public override Task InitializeAsync(CancellationToken cancellationToken)

src/CodeNav.OutOfProc/ToolWindows/CodeNavToolWindowCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public class CodeNavToolWindowCommand : Command
88
{
99
public override CommandConfiguration CommandConfiguration => new("%CodeNav.CodeNavToolWindowCommand.DisplayName%")
1010
{
11-
Placements = [CommandPlacement.KnownPlacements.ViewOtherWindowsMenu],
11+
Placements = [CommandPlacement.KnownPlacements.ExtensionsMenu],
1212
Icon = new(ImageMoniker.KnownValues.DocumentOutline, IconSettings.IconAndText),
1313
};
1414

src/CodeNav/CodeNav.csproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@
55
<Nullable>enable</Nullable>
66
<LangVersion>12</LangVersion>
77
<UseWPF>true</UseWPF>
8-
<NeutralLanguage>en-US</NeutralLanguage>
9-
8+
<NeutralLanguage>en-US</NeutralLanguage>
109
<VssdkCompatibleExtension>true</VssdkCompatibleExtension>
11-
1210
<RepoRootPath>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\..\'))</RepoRootPath>
1311
</PropertyGroup>
12+
1413
<ItemGroup>
1514
<None Remove="Resources\LICENSE" />
1615
<None Remove="Resources\Logo_90x90.png" />

src/CodeNav/ExtensionEntrypoint.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ internal class ExtensionEntrypoint : Extension
1414
public override ExtensionConfiguration ExtensionConfiguration => new()
1515
{
1616
RequiresInProcessHosting = true,
17+
LoadedWhen = ActivationConstraint.ClientContext(ClientContextKey.Shell.ActiveEditorContentType, "csharp"),
1718
};
1819

1920
/// <inheritdoc />

src/CodeNav/source.extension.vsixmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
33
<Metadata>
4-
<Identity Id="CodeNav.dcdbcca4-3a88-432f-ba04-eb4a4cb64437" Version="1.0" Language="en-US" Publisher="Samir Boulema" />
4+
<Identity Id="CodeNav.dcdbcca4-3a88-432f-ba04-eb4a4cb64437" Version="99.0" Language="en-US" Publisher="Samir Boulema" />
55
<DisplayName>CodeNav</DisplayName>
66
<Description xml:space="preserve">Show the code structure of your current document.</Description>
77
<MoreInfo>https://github.com/sboulema/CodeNav</MoreInfo>

0 commit comments

Comments
 (0)