mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-11-23 19:49:17 +08:00
[Peek]Add support for previewing .ahk files as plaintext (#35538)
This commit is contained in:
parent
863f7aa233
commit
6cece12b85
@ -7,7 +7,7 @@ export async function registerAdditionalLanguages(monaco){
|
|||||||
await languageDefinitions();
|
await languageDefinitions();
|
||||||
registerAdditionalLanguage("cppExt", [".ino", ".pde"], "cpp", monaco)
|
registerAdditionalLanguage("cppExt", [".ino", ".pde"], "cpp", monaco)
|
||||||
registerAdditionalLanguage("xmlExt", [".wsdl", ".csproj", ".vcxproj", ".vbproj", ".fsproj"], "xml", monaco)
|
registerAdditionalLanguage("xmlExt", [".wsdl", ".csproj", ".vcxproj", ".vbproj", ".fsproj"], "xml", monaco)
|
||||||
registerAdditionalLanguage("txtExt", [".sln", ".log", ".vsconfig", ".env", ".srt"], "txt", monaco)
|
registerAdditionalLanguage("txtExt", [".sln", ".log", ".vsconfig", ".env", ".srt", ".ahk"], "txt", monaco)
|
||||||
registerAdditionalLanguage("razorExt", [".razor"], "razor", monaco)
|
registerAdditionalLanguage("razorExt", [".razor"], "razor", monaco)
|
||||||
registerAdditionalLanguage("vbExt", [".vbs"], "vb", monaco)
|
registerAdditionalLanguage("vbExt", [".vbs"], "vb", monaco)
|
||||||
registerAdditionalLanguage("iniExt", [".inf", ".gitconfig", ".gitattributes", ".editorconfig"], "ini", monaco)
|
registerAdditionalLanguage("iniExt", [".inf", ".gitconfig", ".gitattributes", ".editorconfig"], "ini", monaco)
|
||||||
|
File diff suppressed because one or more lines are too long
@ -20,10 +20,11 @@ namespace Peek.FilePreviewer.Previewers
|
|||||||
|
|
||||||
public static HashSet<string> GetExtensions()
|
public static HashSet<string> GetExtensions()
|
||||||
{
|
{
|
||||||
HashSet<string> set = new HashSet<string>();
|
HashSet<string> set = [];
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
JsonDocument languageListDocument = Microsoft.PowerToys.FilePreviewCommon.MonacoHelper.GetLanguages();
|
using JsonDocument languageListDocument = Microsoft.PowerToys.FilePreviewCommon.MonacoHelper.GetLanguages();
|
||||||
JsonElement languageList = languageListDocument.RootElement.GetProperty("list");
|
JsonElement languageList = languageListDocument.RootElement.GetProperty("list");
|
||||||
foreach (JsonElement e in languageList.EnumerateArray())
|
foreach (JsonElement e in languageList.EnumerateArray())
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user