Skip to content

Commit 919b539

Browse files
committed
Enable Roslynator Analyzers via Nuget Package
1 parent a05cba0 commit 919b539

File tree

4 files changed

+29
-4
lines changed

4 files changed

+29
-4
lines changed

Directory.Packages.props

+13-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,18 @@
1313
<PackageVersion Include="OmniSharp.Extensions.LanguageClient" Version="0.19.9" />
1414
<PackageVersion Include="OmniSharp.Extensions.LanguageServer" Version="0.19.9" />
1515
<PackageVersion Include="PowerShellStandard.Library" Version="5.1.1" />
16+
<PackageVersion Include="Roslynator.Analyzers" Version="4.12.9">
17+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
18+
<PrivateAssets>all</PrivateAssets>
19+
</PackageVersion>
20+
<PackageVersion Include="Roslynator.CodeAnalysis.Analyzers" Version="4.12.9">
21+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
22+
<PrivateAssets>all</PrivateAssets>
23+
</PackageVersion>
24+
<PackageVersion Include="Roslynator.Formatting.Analyzers" Version="4.12.9">
25+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
26+
<PrivateAssets>all</PrivateAssets>
27+
</PackageVersion>
1628
<PackageVersion Include="System.IO.Pipes.AccessControl" Version="5.0.0" />
1729
<PackageVersion Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
1830
<PackageVersion Include="System.Security.Principal" Version="4.3.0" />
@@ -22,4 +34,4 @@
2234
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
2335
<PackageVersion Include="Xunit.SkippableFact" Version="1.4.13" />
2436
</ItemGroup>
25-
</Project>
37+
</Project>

src/PowerShellEditorServices.Hosting/Configuration/HostLogger.cs

-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ public void LogException(
214214
/// <param name="ui">The PowerShell host user interface object to log output to.</param>
215215
internal class PSHostLogger(PSHostUserInterface ui) : IObserver<(PsesLogLevel logLevel, string message)>
216216
{
217-
218217
public void OnCompleted()
219218
{
220219
// No-op since there's nothing to close or dispose,

src/PowerShellEditorServices.Hosting/PowerShellEditorServices.Hosting.csproj

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), PowerShellEditorServices.Common.props))\PowerShellEditorServices.Common.props" />
2+
<Import
3+
Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), PowerShellEditorServices.Common.props))\PowerShellEditorServices.Common.props" />
34

45
<PropertyGroup>
56
<TargetFrameworks>net8.0;net462</TargetFrameworks>
@@ -16,6 +17,12 @@
1617
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" />
1718
</ItemGroup>
1819

20+
<ItemGroup Label="Roslynator">
21+
<PackageReference Include="Roslynator.Analyzers" />
22+
<PackageReference Include="Roslynator.CodeAnalysis.Analyzers" />
23+
<PackageReference Include="Roslynator.Formatting.Analyzers" />
24+
</ItemGroup>
25+
1926
<ItemGroup>
2027
<ProjectReference Include="..\PowerShellEditorServices\PowerShellEditorServices.csproj" PrivateAssets="all" />
2128
</ItemGroup>

src/PowerShellEditorServices/PowerShellEditorServices.csproj

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), PowerShellEditorServices.Common.props))\PowerShellEditorServices.Common.props" />
2+
<Import
3+
Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), PowerShellEditorServices.Common.props))\PowerShellEditorServices.Common.props" />
34

45
<PropertyGroup>
56
<AssemblyTitle>PowerShell Editor Services</AssemblyTitle>
@@ -41,6 +42,12 @@
4142
<PackageReference Include="System.Security.Principal.Windows" />
4243
</ItemGroup>
4344

45+
<ItemGroup Label="Roslynator">
46+
<PackageReference Include="Roslynator.Analyzers" />
47+
<PackageReference Include="Roslynator.CodeAnalysis.Analyzers" />
48+
<PackageReference Include="Roslynator.Formatting.Analyzers" />
49+
</ItemGroup>
50+
4451
<Choose>
4552
<When Condition=" '$(LocalOmniSharp)' == 'true' ">
4653
<ItemGroup>

0 commit comments

Comments
 (0)