diff --git a/src/modules/cmdpal/src/Microsoft.CmdPal.Common/Helpers/RuntimeHelper.cs b/src/modules/cmdpal/src/Microsoft.CmdPal.Common/Helpers/RuntimeHelper.cs index 0942191e37..46dce07e5e 100644 --- a/src/modules/cmdpal/src/Microsoft.CmdPal.Common/Helpers/RuntimeHelper.cs +++ b/src/modules/cmdpal/src/Microsoft.CmdPal.Common/Helpers/RuntimeHelper.cs @@ -15,16 +15,16 @@ public static class RuntimeHelper { get { - // TODO! for whatever reason, when I ported this into the PT + // TODO: for whatever reason, when I ported this into the PT // codebase, this no longer compiled. We're only ever using it for // the hacked up settings and ignoring it anyways, so I'm leaving - // it commented out for now. - // + // it commented out for now. + // // See also: // * https://github.com/microsoft/win32metadata/commit/6fee67ba73bfe1b126ce524f7de8d367f0317715 // * https://github.com/microsoft/win32metadata/issues/1311 - //uint length = 0; - //return PInvoke.GetCurrentPackageFullName(ref length, null) != WIN32_ERROR.APPMODEL_ERROR_NO_PACKAGE; + // uint length = 0; + // return PInvoke.GetCurrentPackageFullName(ref length, null) != WIN32_ERROR.APPMODEL_ERROR_NO_PACKAGE; #pragma warning disable IDE0025 // Use expression body for property return true; #pragma warning restore IDE0025 // Use expression body for property diff --git a/src/modules/cmdpal/src/Microsoft.CmdPal.Common/Microsoft.CmdPal.Common.csproj b/src/modules/cmdpal/src/Microsoft.CmdPal.Common/Microsoft.CmdPal.Common.csproj index 23467a0603..d3e712a48b 100644 --- a/src/modules/cmdpal/src/Microsoft.CmdPal.Common/Microsoft.CmdPal.Common.csproj +++ b/src/modules/cmdpal/src/Microsoft.CmdPal.Common/Microsoft.CmdPal.Common.csproj @@ -4,7 +4,6 @@ Microsoft.CmdPal.Common enable true - False diff --git a/src/modules/cmdpal/src/Microsoft.CmdPal.Common/Services/FileService.cs b/src/modules/cmdpal/src/Microsoft.CmdPal.Common/Services/FileService.cs index ba54009a5e..cc6ef96098 100644 --- a/src/modules/cmdpal/src/Microsoft.CmdPal.Common/Services/FileService.cs +++ b/src/modules/cmdpal/src/Microsoft.CmdPal.Common/Services/FileService.cs @@ -11,8 +11,7 @@ namespace Microsoft.CmdPal.Common.Services; public class FileService : IFileService { - static readonly Encoding encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false); - + private static readonly Encoding _encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false); #pragma warning disable CS8603 // Possible null reference return. public T Read(string folderPath, string fileName) @@ -36,7 +35,7 @@ public class FileService : IFileService } var fileContent = JsonSerializer.Serialize(content); - File.WriteAllText(Path.Combine(folderPath, fileName), fileContent, encoding); + File.WriteAllText(Path.Combine(folderPath, fileName), fileContent, _encoding); } public void Delete(string folderPath, string fileName) diff --git a/src/modules/cmdpal/src/Microsoft.CmdPal.Common/Services/IExtensionService.cs b/src/modules/cmdpal/src/Microsoft.CmdPal.Common/Services/IExtensionService.cs index 12f55f3b36..0cd3aeccda 100644 --- a/src/modules/cmdpal/src/Microsoft.CmdPal.Common/Services/IExtensionService.cs +++ b/src/modules/cmdpal/src/Microsoft.CmdPal.Common/Services/IExtensionService.cs @@ -13,7 +13,6 @@ public interface IExtensionService Task> GetInstalledExtensionsAsync(bool includeDisabledExtensions = false); // Task> GetInstalledHomeWidgetPackageFamilyNamesAsync(bool includeDisabledExtensions = false); - Task> GetInstalledExtensionsAsync(Microsoft.Windows.CommandPalette.Extensions.ProviderType providerType, bool includeDisabledExtensions = false); IExtensionWrapper? GetInstalledExtension(string extensionUniqueId); @@ -32,5 +31,5 @@ public interface IExtensionService ///// ///// The out of proc extension object ///// True only if the extension was disabled. False otherwise. - //public Task DisableExtensionIfWindowsFeatureNotAvailable(IExtensionWrapper extension); + // public Task DisableExtensionIfWindowsFeatureNotAvailable(IExtensionWrapper extension); } diff --git a/src/modules/cmdpal/src/Microsoft.CmdPal.Common/Services/LocalSettingsService.cs b/src/modules/cmdpal/src/Microsoft.CmdPal.Common/Services/LocalSettingsService.cs index 66bc4f67aa..e4cd2a174b 100644 --- a/src/modules/cmdpal/src/Microsoft.CmdPal.Common/Services/LocalSettingsService.cs +++ b/src/modules/cmdpal/src/Microsoft.CmdPal.Common/Services/LocalSettingsService.cs @@ -28,15 +28,14 @@ public class LocalSettingsService : ILocalSettingsService private readonly string _applicationDataFolder; private readonly string _localSettingsFile; - private Dictionary _settings; - - private bool _isInitialized; - private readonly bool _isMsix; + private Dictionary _settings; + private bool _isInitialized; + public LocalSettingsService(IFileService fileService, IOptions options) { - _isMsix = false; // RuntimeHelper.IsMSIX; + _isMsix = false; // RuntimeHelper.IsMSIX; _fileService = fileService; _options = options.Value;