[Peek]Add support for previewing .ahk files as plaintext (#35538)

This commit is contained in:
Dave Rayment
2024-11-22 16:25:01 +00:00
committed by GitHub
parent 863f7aa233
commit 6cece12b85
3 changed files with 5 additions and 4 deletions

View File

@@ -20,10 +20,11 @@ namespace Peek.FilePreviewer.Previewers
public static HashSet<string> GetExtensions()
{
HashSet<string> set = new HashSet<string>();
HashSet<string> set = [];
try
{
JsonDocument languageListDocument = Microsoft.PowerToys.FilePreviewCommon.MonacoHelper.GetLanguages();
using JsonDocument languageListDocument = Microsoft.PowerToys.FilePreviewCommon.MonacoHelper.GetLanguages();
JsonElement languageList = languageListDocument.RootElement.GetProperty("list");
foreach (JsonElement e in languageList.EnumerateArray())
{