Skip to content

Commit

Permalink
Upgrade R# SDK to 2021.2.0. Closes #35
Browse files Browse the repository at this point in the history
* Removed highlighting
* Updated golden test files
* Updated readme and plugin description
  • Loading branch information
olsh committed Aug 18, 2021
1 parent f7ac19c commit 5c14a3c
Show file tree
Hide file tree
Showing 64 changed files with 62 additions and 835 deletions.
9 changes: 8 additions & 1 deletion .nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,13 @@
"GitHubActions",
"GitLab",
"Jenkins",
"Rider",
"SpaceAutomation",
"TeamCity",
"Terminal",
"TravisCI"
"TravisCI",
"VisualStudio",
"VSCode"
]
},
"IsRiderHost": {
Expand All @@ -41,6 +44,10 @@
"type": "boolean",
"description": "Disables displaying the NUKE logo"
},
"Partition": {
"type": "string",
"description": "Partition to use on CI"
},
"Plan": {
"type": "boolean",
"description": "Shows the execution plan (HTML)"
Expand Down
6 changes: 5 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SdkVersion>2021.1.2</SdkVersion>
<SdkVersion>2021.2.0</SdkVersion>
</PropertyGroup>
<!-- https://jetbrains.slack.com/archives/CBZ36NH7C/p1628090127002200 -->
<PropertyGroup>
<MSBuildWarningsAsMessages>$(MSBuildWarningsAsMessages);MSB3277</MSBuildWarningsAsMessages>
</PropertyGroup>
</Project>
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

An extension for ReSharper and Rider IDE that highlights structured logging templates and contains some useful analyzers

> [The highlighting is a built-in feature starting from R#/Rider 2021.2](https://github.com/olsh/resharper-structured-logging/issues/35#issuecomment-900883583),
> but the extension still contains some useful analyzers that are not (yet) implemented by JetBrains team
At the moment it supports Serilog, NLog, and Microsoft.Extensions.Logging

## Installation ReSharper
Expand Down
6 changes: 5 additions & 1 deletion build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@ protected override void OnBuildInitialized()
.Requires(() => IsRiderHost)
.Executes(() =>
{
Gradle($"buildPlugin -PPluginVersion={ExtensionVersion} -PProductVersion={SdkVersion} -PDotNetOutputDirectory={OutputDirectory} -PDotNetProjectName={Project.Name}", customLogger:
// JetBrains is not very consistent in versioning
// https://github.com/olsh/resharper-structured-logging/issues/35#issuecomment-892764206
var productVersion = SdkVersion == "2021.2.0" ? "2021.2" : SdkVersion;
Gradle($"buildPlugin -PPluginVersion={ExtensionVersion} -PProductVersion={productVersion} -PDotNetOutputDirectory={OutputDirectory} -PDotNetProjectName={Project.Name}", customLogger:
(_, s) =>
{
// Gradle writes warnings to stderr
Expand Down
1 change: 1 addition & 0 deletions build/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<NoWarn>CS0649;CS0169</NoWarn>
<NukeRootDirectory>..</NukeRootDirectory>
<NukeScriptDirectory>..</NukeScriptDirectory>
<NukeTelemetryVersion>1</NukeTelemetryVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
134 changes: 0 additions & 134 deletions src/ReSharper.Structured.Logging/Analyzer/TemplateFormatAnalyzer.cs

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net461</TargetFramework>
<TargetFramework>net472</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>
<PropertyGroup>
Expand All @@ -10,9 +10,6 @@
<RootNamespace>ReSharper.Structured.Logging</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="JetBrains.Rider.SDK" Version="$(SdkVersion)" />
<PackageReference Include="JetBrains.Rider.SDK" Version="$(SdkVersion)" PrivateAssets="all" />
</ItemGroup>
<PropertyGroup>
<OutputPath>bin\$(MSBuildProjectName)\$(Configuration)\</OutputPath>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net461</TargetFramework>
<TargetFramework>net472</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>
<PropertyGroup>
<SonarQubeTestProject>false</SonarQubeTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="JetBrains.ReSharper.SDK" Version="$(SdkVersion)" />
<PackageReference Include="JetBrains.ReSharper.SDK" Version="$(SdkVersion)" PrivateAssets="all" />
</ItemGroup>
<PropertyGroup>
<OutputPath>bin\$(MSBuildProjectName)\$(Configuration)\</OutputPath>
Expand Down
2 changes: 1 addition & 1 deletion src/rider/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<idea-plugin require-restart="true">
<id>com.intellij.resharper.StructuredLogging</id>
<name>Structured Logging</name>
<description>Provides highlighting for structured logging message templates and contains some useful analyzers. Supports Serilog, NLog, and Microsoft.Extensions.Logging.</description>
<description>Contains some useful analyzers for structured logging. Supports Serilog, NLog, and Microsoft.Extensions.Logging.</description>
<change-notes>https://github.com/olsh/resharper-structured-logging/releases</change-notes>
<version></version>
<vendor url="https://github.com/olsh/resharper-structured-logging">Oleg Shevchenko</vendor>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ namespace ConsoleApp
{
public static void Main()
{
Log.Logger.Information("||{MyProperty}|(0)|(1)", new { Test = 1, Complex = new Random() });
Log.Logger.Information("|{MyProperty}|(0)", new { Test = 1, Complex = new Random() });
}
}
}

---------------------------------------------------------
(0): ReSharper Format String Item:
(1): ReSharper Warning: Anonymous objects must be destructured
(0): ReSharper Warning: Anonymous objects must be destructured
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ namespace ConsoleApp
{
public static void Main()
{
Log.Logger.Information("||{MyProperty}|(0)|(1)", new { Test = 1 });
Log.Logger.Information("|{MyProperty}|(0)", new { Test = 1 });
}
}
}

---------------------------------------------------------
(0): ReSharper Format String Item:
(1): ReSharper Warning: Anonymous objects must be destructured
(0): ReSharper Warning: Anonymous objects must be destructured
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ namespace ConsoleApp
{
public static void Main()
{
Log.Logger.Information("|{$MyProperty}|(0)", new Dictionary<int, string>());
Log.Logger.Information("{$MyProperty}", new Dictionary<int, string>());
}
}
}

---------------------------------------------------------
(0): ReSharper Format String Item:
Loading

0 comments on commit 5c14a3c

Please sign in to comment.