From 7946d9c14580ea0de39889f0bc0646de8fc41b51 Mon Sep 17 00:00:00 2001 From: Gerald Versluis Date: Wed, 3 Jul 2024 18:48:29 +0200 Subject: [PATCH] Fix Camera analyzer (#1996) --- .../CodeFixResources.Designer.cs | 8 ++++---- .../CodeFixResources.resx | 2 +- ...tCameraViewInitializationAnalyzerCodeFixProvider.cs | 10 +++++----- .../Resources.Designer.cs | 6 +++--- .../Resources.resx | 2 +- .../UseCommunityToolkitCameraInitializationAnalyzer.cs | 4 ++-- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/CommunityToolkit.Maui.Camera.Analyzers.CodeFixes/CodeFixResources.Designer.cs b/src/CommunityToolkit.Maui.Camera.Analyzers.CodeFixes/CodeFixResources.Designer.cs index 584ea6068..77951f35e 100644 --- a/src/CommunityToolkit.Maui.Camera.Analyzers.CodeFixes/CodeFixResources.Designer.cs +++ b/src/CommunityToolkit.Maui.Camera.Analyzers.CodeFixes/CodeFixResources.Designer.cs @@ -7,7 +7,7 @@ // //------------------------------------------------------------------------------ -namespace CommunityToolkit.Maui.CameraView.Analyzers { +namespace CommunityToolkit.Maui.Camera.Analyzers { using System; @@ -36,7 +36,7 @@ internal CodeFixResources() { internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CommunityToolkit.Maui.CameraView.Analyzers.CodeFixResources", typeof(CodeFixResources).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CommunityToolkit.Maui.Camera.Analyzers.CodeFixResources", typeof(CodeFixResources).Assembly); resourceMan = temp; } return resourceMan; @@ -60,9 +60,9 @@ internal CodeFixResources() { /// /// Looks up a localized string similar to Add `.UseMauiCommunityToolkitCamera()`. /// - internal static string Initialize__NET_MAUI_Community_Toolkit_CameraView_Before_UseMauiApp { + internal static string Initialize__NET_MAUI_Community_Toolkit_Camera_Before_UseMauiApp { get { - return ResourceManager.GetString("Initialize .NET MAUI Community Toolkit CameraView Before UseMauiApp", resourceCulture); + return ResourceManager.GetString("Initialize .NET MAUI Community Toolkit Camera Before UseMauiApp", resourceCulture); } } } diff --git a/src/CommunityToolkit.Maui.Camera.Analyzers.CodeFixes/CodeFixResources.resx b/src/CommunityToolkit.Maui.Camera.Analyzers.CodeFixes/CodeFixResources.resx index 07be80de2..68a5c7c7a 100644 --- a/src/CommunityToolkit.Maui.Camera.Analyzers.CodeFixes/CodeFixResources.resx +++ b/src/CommunityToolkit.Maui.Camera.Analyzers.CodeFixes/CodeFixResources.resx @@ -12,7 +12,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + Add `.UseMauiCommunityToolkitCamera()` Add `.UseMauiCommunityToolkitCamera()` diff --git a/src/CommunityToolkit.Maui.Camera.Analyzers.CodeFixes/UseCommunityToolkitCameraViewInitializationAnalyzerCodeFixProvider.cs b/src/CommunityToolkit.Maui.Camera.Analyzers.CodeFixes/UseCommunityToolkitCameraViewInitializationAnalyzerCodeFixProvider.cs index 7a7dfba4f..b4d600d12 100644 --- a/src/CommunityToolkit.Maui.Camera.Analyzers.CodeFixes/UseCommunityToolkitCameraViewInitializationAnalyzerCodeFixProvider.cs +++ b/src/CommunityToolkit.Maui.Camera.Analyzers.CodeFixes/UseCommunityToolkitCameraViewInitializationAnalyzerCodeFixProvider.cs @@ -1,6 +1,6 @@ using System.Collections.Immutable; using System.Composition; -using CommunityToolkit.Maui.CameraView.Analyzers; +using CommunityToolkit.Maui.Camera.Analyzers; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.CodeFixes; @@ -10,8 +10,8 @@ namespace CommunityToolkit.Maui.Camera.Analyzers; -[ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(UseCommunityToolkitCameraViewInitializationAnalyzerCodeFixProvider)), Shared] -public class UseCommunityToolkitCameraViewInitializationAnalyzerCodeFixProvider : CodeFixProvider +[ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(UseCommunityToolkitCameraInitializationAnalyzerCodeFixProvider)), Shared] +public class UseCommunityToolkitCameraInitializationAnalyzerCodeFixProvider : CodeFixProvider { public sealed override ImmutableArray FixableDiagnosticIds { get; } = ImmutableArray.Create(UseCommunityToolkitCameraInitializationAnalyzer.DiagnosticId); @@ -30,9 +30,9 @@ public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) // Register a code action that will invoke the fix. context.RegisterCodeFix( CodeAction.Create( - title: CodeFixResources.Initialize__NET_MAUI_Community_Toolkit_CameraView_Before_UseMauiApp, + title: CodeFixResources.Initialize__NET_MAUI_Community_Toolkit_Camera_Before_UseMauiApp, createChangedDocument: c => AddUseCommunityToolkit(context.Document, declaration, c), - equivalenceKey: nameof(CodeFixResources.Initialize__NET_MAUI_Community_Toolkit_CameraView_Before_UseMauiApp)), + equivalenceKey: nameof(CodeFixResources.Initialize__NET_MAUI_Community_Toolkit_Camera_Before_UseMauiApp)), diagnostic); } diff --git a/src/CommunityToolkit.Maui.Camera.Analyzers/Resources.Designer.cs b/src/CommunityToolkit.Maui.Camera.Analyzers/Resources.Designer.cs index 2c16e9f77..45e1bc183 100644 --- a/src/CommunityToolkit.Maui.Camera.Analyzers/Resources.Designer.cs +++ b/src/CommunityToolkit.Maui.Camera.Analyzers/Resources.Designer.cs @@ -7,7 +7,7 @@ // //------------------------------------------------------------------------------ -namespace CommunityToolkit.Maui.CameraView.Analyzers { +namespace CommunityToolkit.Maui.Camera.Analyzers { using System; @@ -36,7 +36,7 @@ internal Resources() { internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CommunityToolkit.Maui.CameraView.Analyzers.Resources", typeof(Resources).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CommunityToolkit.Maui.Camera.Analyzers.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; @@ -67,7 +67,7 @@ internal static string InitalizationMessageFormat { } /// - /// Looks up a localized string similar to `.UseMauiCommunityToolkitCamera()` is required to initalize .NET MAUI Community Toolkit CameraView. + /// Looks up a localized string similar to `.UseMauiCommunityToolkitCamera()` is required to initalize .NET MAUI Community Toolkit Camera. /// internal static string InitializationErrorMessage { get { diff --git a/src/CommunityToolkit.Maui.Camera.Analyzers/Resources.resx b/src/CommunityToolkit.Maui.Camera.Analyzers/Resources.resx index b127713ff..8b2df30f5 100644 --- a/src/CommunityToolkit.Maui.Camera.Analyzers/Resources.resx +++ b/src/CommunityToolkit.Maui.Camera.Analyzers/Resources.resx @@ -16,7 +16,7 @@ `.UseMauiCommunityToolkitCamera()` must be chained to `.UseMauiApp<T>()` - `.UseMauiCommunityToolkitCamera()` is required to initalize .NET MAUI Community Toolkit CameraView + `.UseMauiCommunityToolkitCamera()` is required to initalize .NET MAUI Community Toolkit Camera `.UseMauiCommunityToolkitCamera()` Not Found on MauiAppBuilder diff --git a/src/CommunityToolkit.Maui.Camera.Analyzers/UseCommunityToolkitCameraInitializationAnalyzer.cs b/src/CommunityToolkit.Maui.Camera.Analyzers/UseCommunityToolkitCameraInitializationAnalyzer.cs index efdaa9771..4314d7034 100644 --- a/src/CommunityToolkit.Maui.Camera.Analyzers/UseCommunityToolkitCameraInitializationAnalyzer.cs +++ b/src/CommunityToolkit.Maui.Camera.Analyzers/UseCommunityToolkitCameraInitializationAnalyzer.cs @@ -5,12 +5,12 @@ using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Diagnostics; -namespace CommunityToolkit.Maui.CameraView.Analyzers; +namespace CommunityToolkit.Maui.Camera.Analyzers; [DiagnosticAnalyzer(LanguageNames.CSharp)] public class UseCommunityToolkitCameraInitializationAnalyzer : DiagnosticAnalyzer { - public const string DiagnosticId = "MCTME001"; + public const string DiagnosticId = "MCTC001"; const string category = "Initialization"; static readonly LocalizableString title = new LocalizableResourceString(nameof(Resources.InitializationErrorTitle), Resources.ResourceManager, typeof(Resources));