Skip to content

Commit

Permalink
Update analyzer and fix some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikEJ committed Oct 24, 2023
1 parent 51630ef commit c343999
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/GUI/Directory.Build.Props
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.9.0.77355">
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.12.0.78982">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand Down
1 change: 0 additions & 1 deletion src/GUI/EFCorePowerTools/EFCorePowerToolsPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,6 @@ private async void OnProjectMenuBeforeQueryStatus(object sender, EventArgs e)
{
menuCommand.Visible = await project.IsNet60OrHigherAsync()
&& await project.IsInstalledAsync(new NuGetPackage { PackageId = "Microsoft.EntityFrameworkCore" });
return;
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/GUI/Shared/Helpers/RoslynExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static async Task<Document> RenamePropertyAsync(
// found it
var model = await document.GetSemanticModelAsync();
var propSymbol = model.GetDeclaredSymbol(propSyntax) ??
throw new Exception("Property symbol not found");
throw new InvalidOperationException("Property symbol not found");

// rename all references to the property
var newSolution = await Renamer.RenameSymbolAsync(
Expand All @@ -73,7 +73,7 @@ public static async Task<int> SaveDocumentsAsync(this IEnumerable<Document> docu
var saveCount = 0;
foreach (var document in documents)
{
var path = document.FilePath ?? throw new Exception("Path unknown for document " + document.Name);
var path = document.FilePath ?? throw new InvalidOperationException("Path unknown for document " + document.Name);
var text = string.Join(
Environment.NewLine,
(await document.GetTextAsync()).Lines.Select(o => o.ToString())).Trim();
Expand Down
2 changes: 1 addition & 1 deletion src/GUI/UnitTests/ViewModels/ObjectTreeViewModelTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ private static void AreObjectsEqual(TableModel a, ITableInformationViewModel b)
Assert.AreEqual(a.ObjectType, b.ObjectType);
for (var i = 0; i < a.Columns.Count(); i++)
{
Assert.AreEqual(a.Columns.ElementAt(i).Name, b.Columns.ElementAt(i).Name);
Assert.AreEqual(a.Columns.ElementAt(i).Name, b.Columns[i].Name);
}
}
}
Expand Down

0 comments on commit c343999

Please sign in to comment.