Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ permissions:
contents: read

env:
version: '10.13.${{ github.run_number }}'
version: '10.14.${{ github.run_number }}'
dotnetVersion: '8'
repoUrl: ${{ github.server_url }}/${{ github.repository }}
vsixPath: src/CodeNav/bin/Release/net472/CodeNav.vsix
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Visual Studio extension to show the code structure of your current document
- Option to hide the tool window for unsupported files and files without code items
- Compact mode with less spacing optimizing screen real estate
- Pin an active document to keep the CodeNav window open for that document even when switching to other documents
- Open a second, independent CodeNav window

# 💻 Supported Visual Studio versions

Expand All @@ -44,7 +45,7 @@ Visual Studio extension to show the code structure of your current document
[Open VSIX Gallery](https://www.vsixgallery.com/extension/CodeNav.dcdbcca4-3a88-432f-ba04-eb4a4cb64437)

# 🤲 Usage
The CodeNav tool window can be opened via the entry in the `Extensions` menu.
The CodeNav tool window can be opened via the entries in the `Extensions` menu.

# 🖼️ Screenshots
![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)
Expand Down
5 changes: 4 additions & 1 deletion src/CodeNav.OutOfProc/ExtensionEntrypoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ internal class ExtensionEntrypoint : Extension
version: ExtensionAssemblyVersion,
publisherName: "Samir Boulema",
displayName: "CodeNav",
description: "Show the code structure of your current document."),
description: "Show the code structure of your current document.")
{
DotnetTargetVersions = [DotnetTarget.Net8, DotnetTarget.Custom("10.0")],
},
LoadedWhen = ActivationConstraint.ClientContext(ClientContextKey.Shell.ActiveEditorContentType, "CSharp|Basic|TypeScript"),
};

Expand Down
14 changes: 7 additions & 7 deletions src/CodeNav.OutOfProc/Helpers/SortHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,21 @@ public static class SortHelper
/// <remarks>Used in the main toolbar sort buttons</remarks>
/// <param name="clientContext">ClientContext</param>
/// <param name="codeDocumentService">CodeDocumentService</param>
/// <param name="codeDocumentViewModel">The view model of the tool window the sort was changed on</param>
/// <param name="cancellationToken">CancellationToken</param>
/// <returns>Awaitable Task</returns>
public static async Task ChangeSort(
IClientContext clientContext,
CodeDocumentService? codeDocumentService,
CodeDocumentViewModel? codeDocumentViewModel,
SortOrderEnum sortOrder,
CancellationToken cancellationToken)
{
var textViewSnapshot = await clientContext.GetActiveTextViewAsync(cancellationToken);

if (textViewSnapshot == null)
{
return;
}

if (codeDocumentService == null)
if (textViewSnapshot == null ||
codeDocumentService == null ||
codeDocumentViewModel == null)
{
return;
}
Expand All @@ -40,12 +39,13 @@ public static async Task ChangeSort(
codeDocumentService.GlobalSettings!.SortOrder = sortOrder;
await SettingsHelper.SaveGlobalSettings(codeDocumentService);

ApplySort(codeDocumentService.CodeDocumentViewModel, sortOrder);
ApplySort(codeDocumentViewModel, sortOrder);

await codeDocumentService.UpdateCodeDocumentViewModel(
clientContext.Extensibility,
textViewSnapshot.FilePath,
textViewSnapshot.Document.Text.CopyToString(),
codeDocumentViewModel,
cancellationToken);
}

Expand Down
Loading