diff --git a/README.md b/README.md index 5b721eb..38b8209 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ #Configuration Sense for ReSharper +[![Build status](https://ci.appveyor.com/api/projects/status/d2u5scm7t3d373qj?svg=true)](https://ci.appveyor.com/project/olsh/resharper-configuration-sense) + This extension provides autocomplete and validation for `App settings` and `Connection strings`. ![Demo](https://github.com/olsh/resharper-configuration-sense/raw/master/images/demo.gif) diff --git a/build.cmd b/build.cmd index 70d4217..f057c92 100644 --- a/build.cmd +++ b/build.cmd @@ -4,7 +4,7 @@ if "%config%" == "" ( set config=Release ) -set version=2016.2.3 +set version=2016.3.0 if not "%PackageVersion%" == "" ( set version=%PackageVersion% ) @@ -13,4 +13,4 @@ nuget restore src\Resharper.ConfigurationSense.sln "%ProgramFiles(x86)%\MSBuild\14.0\Bin\msbuild" src\Resharper.ConfigurationSense.sln /t:Rebuild /p:Configuration="%config%" /m /v:M /fl /flp:LogFile=msbuild.log;Verbosity=Normal /nr:false -nuget pack resharper.nuspec -NoPackageAnalysis -Version %version% -Properties "Configuration=%config%;ReSharperDep=Wave;ReSharperVer=[6.0]" +nuget pack resharper.nuspec -NoPackageAnalysis -Version %version% -Properties "Configuration=%config%;ReSharperDep=Wave;ReSharperVer=[7.0]" diff --git a/src/Resharper.ConfigurationSense/Analyzers/AccessorSettingsAnalyzer.cs b/src/Resharper.ConfigurationSense/Analyzers/AccessorSettingsAnalyzer.cs index 5a1fbe2..54493b4 100644 --- a/src/Resharper.ConfigurationSense/Analyzers/AccessorSettingsAnalyzer.cs +++ b/src/Resharper.ConfigurationSense/Analyzers/AccessorSettingsAnalyzer.cs @@ -43,7 +43,10 @@ protected override void Run( } var accessorPath = element.GetAccessorPath(); - if (string.IsNullOrEmpty(accessorPath)) + var accessorSuperTypes = element.GetAccessorSuperTypes(); + + // ReSharper disable once PossibleMultipleEnumeration + if (string.IsNullOrEmpty(accessorPath) && !accessorSuperTypes.Any()) { return; } @@ -73,10 +76,10 @@ protected override void Run( type = "Connection string"; } - var accessorSuperTypes = element.GetAccessorSuperTypes(); + // ReSharper disable once PossibleMultipleEnumeration if (accessorSuperTypes.Any(t => t.ToString().Equals(ClrTypeConstants.NetCoreConfiguration, StringComparison.OrdinalIgnoreCase))) { - keyValueSettings = project.GetJsonProjectSettings(FileNames.NetCoreAppSettingsJson); + keyValueSettings = project.GetJsonProjectSettings(); type = "Setting"; } diff --git a/src/Resharper.ConfigurationSense/Analyzers/InvocationExpressionSettingsAnalyzer.cs b/src/Resharper.ConfigurationSense/Analyzers/InvocationExpressionSettingsAnalyzer.cs index 17b442c..82a3984 100644 --- a/src/Resharper.ConfigurationSense/Analyzers/InvocationExpressionSettingsAnalyzer.cs +++ b/src/Resharper.ConfigurationSense/Analyzers/InvocationExpressionSettingsAnalyzer.cs @@ -55,9 +55,7 @@ protected override void Run( IEnumerable keyValueSettings; if (methodPath == ClrTypeConstants.NetCoreGetConnectionString) { - keyValueSettings = project.GetJsonProjectSettings( - FileNames.NetCoreAppSettingsJson, - SettingsConstants.NetCoreConnectionStringsJsonPath); + keyValueSettings = project.GetJsonProjectSettings(SettingsConstants.NetCoreConnectionStringsJsonPath); } else { diff --git a/src/Resharper.ConfigurationSense/Components/GenericSettingsSuggestionProvider.cs b/src/Resharper.ConfigurationSense/Components/GenericSettingsSuggestionProvider.cs index 96e04ad..880b445 100644 --- a/src/Resharper.ConfigurationSense/Components/GenericSettingsSuggestionProvider.cs +++ b/src/Resharper.ConfigurationSense/Components/GenericSettingsSuggestionProvider.cs @@ -36,7 +36,7 @@ public LinkedList GetJsonSettingsLookupItems( } var rangeMarker = CreateRangeMarker(context); - var settings = project.GetJsonProjectSettings(fileName, jsonPath); + var settings = project.GetJsonProjectSettings(jsonPath); return CreateLookupItems(context, settings, project, rangeMarker, lookupItems); } diff --git a/src/Resharper.ConfigurationSense/Extensions/ProjectExtensions.cs b/src/Resharper.ConfigurationSense/Extensions/ProjectExtensions.cs index 2289fb3..3f5153c 100644 --- a/src/Resharper.ConfigurationSense/Extensions/ProjectExtensions.cs +++ b/src/Resharper.ConfigurationSense/Extensions/ProjectExtensions.cs @@ -22,7 +22,6 @@ public static class ProjectExtensions { public static IEnumerable GetJsonProjectSettings( this IProject project, - string fileName, string searchPath = null) { var configFiles = GetNetCoreJsonConfigFiles(project); diff --git a/src/Resharper.ConfigurationSense/Highlights/SettingsNotFoundHighlighting.cs b/src/Resharper.ConfigurationSense/Highlights/SettingsNotFoundHighlighting.cs index b0740d5..c4b5233 100644 --- a/src/Resharper.ConfigurationSense/Highlights/SettingsNotFoundHighlighting.cs +++ b/src/Resharper.ConfigurationSense/Highlights/SettingsNotFoundHighlighting.cs @@ -8,7 +8,7 @@ [assembly: RegisterConfigurableSeverity(SettingsNotFoundHighlighting.SeverityId, null, HighlightingGroupIds.CompilerWarnings, "The setting wasn't found in configuration files", "The setting wasn't found in configuration files", - Severity.WARNING, false)] + Severity.WARNING)] namespace Resharper.ConfigurationSense.Highlights { diff --git a/src/Resharper.ConfigurationSense/Resharper.ConfigurationSense.csproj b/src/Resharper.ConfigurationSense/Resharper.ConfigurationSense.csproj index dde7821..1462726 100644 --- a/src/Resharper.ConfigurationSense/Resharper.ConfigurationSense.csproj +++ b/src/Resharper.ConfigurationSense/Resharper.ConfigurationSense.csproj @@ -9,10 +9,11 @@ Properties Resharper.ConfigurationSense Resharper.ConfigurationSense - v4.0 + v4.5 512 + true @@ -22,6 +23,7 @@ DEBUG;TRACE prompt 4 + false pdbonly @@ -30,6 +32,7 @@ TRACE prompt 4 + false ReSharperPlatformVs14Resharper @@ -39,16 +42,16 @@ ..\packages\Antlr2.Runtime.2.7.7.02\lib\antlr.runtime.dll True - - ..\packages\AsyncBridge.JetBrains.0.1.1.0\lib\net40-Client\AsyncBridge.dll + + ..\packages\xmlrpcnet.2.5.0\lib\net20\CookComputing.XmlRpcV2.dll True - - ..\packages\AsyncIO.0.1.18.0\lib\net40\AsyncIO.dll + + ..\packages\Mono.Debugging.Win32.1.0.20161020.46\lib\net40\CorApi.dll True - - ..\packages\xmlrpcnet.2.5.0\lib\net20\CookComputing.XmlRpcV2.dll + + ..\packages\Mono.Debugging.Win32.1.0.20161020.46\lib\net40\CorApi2.dll True @@ -67,16 +70,44 @@ ..\packages\JetBrains.Platform.Lib.DevExpress.2.0.20150224.0\lib\Net\DevExpress.XtraTreeList.v7.1.dll True - - ..\packages\SharpZipLib.JetBrains.Stripped.0.86.20150204.1\lib\20\ICSharpCode.SharpZipLib.dll + + ..\packages\ICSharpCode.NRefactory.5.5.1\lib\Net40\ICSharpCode.NRefactory.dll + True + + + ..\packages\ICSharpCode.NRefactory.5.5.1\lib\Net40\ICSharpCode.NRefactory.Cecil.dll + True + + + ..\packages\ICSharpCode.NRefactory.5.5.1\lib\Net40\ICSharpCode.NRefactory.CSharp.dll + True + + + ..\packages\ICSharpCode.NRefactory.5.5.1\lib\Net40\ICSharpCode.NRefactory.Xml.dll + True + + + ..\packages\SharpZipLib.JetBrains.Stripped.0.87.20160802.0\lib\net40\ICSharpCode.SharpZipLib.dll True ..\packages\DotNetZip.Reduced.1.9.1.8\lib\net20\Ionic.Zip.Reduced.dll True - - ..\packages\JetBrains.Annotations.10.1.5\lib\net\JetBrains.Annotations.dll + + ..\packages\JetBrains.Annotations.10.2.1\lib\net\JetBrains.Annotations.dll + True + + + ..\packages\JetBrains.MSBuild.Xplat.Engine.20161013.1.0\lib\net45\Microsoft.Build.dll + True + + + ..\packages\JetBrains.MSBuild.Xplat.Engine.20161013.1.0\lib\net45\Microsoft.Build.Framework.dll + True + + + ..\packages\JetBrains.MSBuild.Xplat.Engine.20161013.1.0\lib\net45\Microsoft.Build.Utilities.Core.dll True @@ -87,6 +118,26 @@ ..\packages\JetBrains.Platform.Lib.Microsoft.Deployment.Compression.Cab.2.0.20140304.0\lib\Microsoft.Deployment.Compression.Cab.dll True + + ..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll + True + + + ..\packages\Microsoft.Owin.FileSystems.3.0.1\lib\net45\Microsoft.Owin.FileSystems.dll + True + + + ..\packages\Microsoft.Owin.Host.HttpListener.3.0.1\lib\net45\Microsoft.Owin.Host.HttpListener.dll + True + + + ..\packages\Microsoft.Owin.Hosting.3.0.1\lib\net45\Microsoft.Owin.Hosting.dll + True + + + ..\packages\Microsoft.Owin.StaticFiles.3.0.1\lib\net45\Microsoft.Owin.StaticFiles.dll + True + ..\packages\Microsoft.Web.Xdt.2.1.1\lib\net40\Microsoft.Web.XmlTransform.dll True @@ -99,20 +150,136 @@ ..\packages\Windows7APICodePack.JetBrains.Stripped.1.1.20150225.0\lib\Net\Microsoft.WindowsAPICodePack.Shell.dll True - - ..\packages\JetBrains.Mono.Posix.0.1\lib\net40\Mono.Posix.dll + + ..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.dll + True + + + ..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Mdb.dll + True + + + ..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Pdb.dll + True + + + ..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Rocks.dll + True + + + ..\packages\Mono.Debugger.Soft.1.0.20161020.46\lib\net40\Mono.Debugger.Soft.dll True - - ..\packages\NetMQ.3.3.3.1\lib\net40\NetMQ.dll + + ..\packages\Mono.Debugging.1.0.20161020.46\lib\net40\Mono.Debugging.dll + True + + + ..\packages\Mono.Debugging.Soft.1.0.20161020.46\lib\net40\Mono.Debugging.Soft.dll + True + + + ..\packages\Mono.Debugging.Win32.1.0.20161020.46\lib\net40\Mono.Debugging.Win32.dll True - ..\packages\Newtonsoft35.Json.7.0.1\lib\net35\Newtonsoft.Json.dll + ..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll + True + + + ..\packages\JetBrains.NuGet.Ultimate.3.5.0.1\lib\net45\NuGet.Client.dll + True + + + ..\packages\JetBrains.NuGet.Ultimate.3.5.0.1\lib\net45\NuGet.Commands.dll + True + + + ..\packages\JetBrains.NuGet.Ultimate.3.5.0.1\lib\net45\NuGet.Common.dll + True + + + ..\packages\JetBrains.NuGet.Ultimate.3.5.0.1\lib\net45\NuGet.Configuration.dll + True + + + ..\packages\JetBrains.NuGet.Ultimate.3.5.0.1\lib\net45\NuGet.ContentModel.dll + True + + + ..\packages\JetBrains.NuGet.Core.2.13.0\lib\net40-Client\NuGet.Core.dll + True + + + ..\packages\JetBrains.NuGet.Ultimate.3.5.0.1\lib\net45\NuGet.DependencyResolver.dll + True + + + ..\packages\JetBrains.NuGet.Ultimate.3.5.0.1\lib\net45\NuGet.DependencyResolver.Core.dll + True + + + ..\packages\JetBrains.NuGet.Ultimate.3.5.0.1\lib\net45\NuGet.Frameworks.dll + True + + + ..\packages\JetBrains.NuGet.Ultimate.3.5.0.1\lib\net45\NuGet.LibraryModel.dll + True + + + ..\packages\JetBrains.NuGet.Ultimate.3.5.0.1\lib\net45\NuGet.PackageManagement.dll + True + + + ..\packages\JetBrains.NuGet.Ultimate.3.5.0.1\lib\net45\NuGet.Packaging.dll + True + + + ..\packages\JetBrains.NuGet.Ultimate.3.5.0.1\lib\net45\NuGet.Packaging.Core.dll + True + + + ..\packages\JetBrains.NuGet.Ultimate.3.5.0.1\lib\net45\NuGet.Packaging.Core.Types.dll True - - ..\packages\NuGet.Core.2.12.0\lib\net40-Client\NuGet.Core.dll + + ..\packages\JetBrains.NuGet.Ultimate.3.5.0.1\lib\net45\NuGet.ProjectManagement.dll + True + + + ..\packages\JetBrains.NuGet.Ultimate.3.5.0.1\lib\net45\NuGet.ProjectModel.dll + True + + + ..\packages\JetBrains.NuGet.Ultimate.3.5.0.1\lib\net45\NuGet.Protocol.Core.Types.dll + True + + + ..\packages\JetBrains.NuGet.Ultimate.3.5.0.1\lib\net45\NuGet.Protocol.Core.v2.dll + True + + + ..\packages\JetBrains.NuGet.Ultimate.3.5.0.1\lib\net45\NuGet.Protocol.Core.v3.dll + True + + + ..\packages\JetBrains.NuGet.Ultimate.3.5.0.1\lib\net45\NuGet.Protocol.VisualStudio.dll + True + + + ..\packages\JetBrains.NuGet.Ultimate.3.5.0.1\lib\net45\NuGet.Repositories.dll + True + + + ..\packages\JetBrains.NuGet.Ultimate.3.5.0.1\lib\net45\NuGet.Resolver.dll + True + + + ..\packages\JetBrains.NuGet.Ultimate.3.5.0.1\lib\net45\NuGet.RuntimeModel.dll + True + + + ..\packages\JetBrains.NuGet.Ultimate.3.5.0.1\lib\net45\NuGet.Versioning.dll True @@ -123,12 +290,34 @@ ..\packages\NVelocity.1.0.3\lib\NVelocity.dll True + + ..\packages\Owin.1.0\lib\net40\Owin.dll + True + + + ..\packages\sharpcompress.0.11.6\lib\net40\SharpCompress.dll + True + ..\packages\Sprache.JetBrains.2.0.0.44\lib\portable-net4+netcore45+win8+wp8+sl5+MonoAndroid1+MonoTouch1\Sprache.dll True + + + + + + + + + + + + ..\packages\JetBrains.MSBuild.Xplat.Engine.20161013.1.0\lib\net45\System.Threading.Tasks.Dataflow.dll + True + ..\packages\JetBrains.Platform.Lib.System.Windows.Interactivity.2.0.20140318.0\lib\System.Windows.Interactivity.dll True @@ -142,6 +331,11 @@ ..\packages\Vestris.ResourceLib.JetBrains.1.4.20150303.0\lib\Net\Vestris.ResourceLib.dll True + + ..\packages\Mono.VSCodeDebugging.1.0.20161019.44\lib\net45\VSCodeDebugging.dll + True + + ..\packages\JetBrains.Platform.Lib.WpfContrib.2.0.20150225.0\lib\Net\WpfContrib.dll True @@ -184,6 +378,7 @@ + @@ -194,36 +389,38 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + +