Skip to content

Commit

Permalink
Fix code issues
Browse files Browse the repository at this point in the history
  • Loading branch information
olsh committed Aug 5, 2017
1 parent f32e55a commit 6ba0baf
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 15 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +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)
[![Quality Gate](https://sonarqube.com/api/badges/gate?key=resharper-configuration-sense)](https://sonarqube.com/dashboard/index/resharper-configuration-sense)

This extension provides autocomplete and validation for `App settings` and `Connection strings`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using JetBrains.Application;
using JetBrains.DocumentModel;
using JetBrains.ProjectModel;
using JetBrains.ReSharper.Feature.Services.CodeCompletion.Infrastructure;
using JetBrains.ReSharper.Feature.Services.CSharp.CodeCompletion.Infrastructure;
using JetBrains.ReSharper.Psi.Tree;
using JetBrains.Util;
Expand Down Expand Up @@ -65,7 +66,7 @@ public LinkedList<KeyValueSettingLookupItem> GetXmlSettingsLookupItems(
private LinkedList<KeyValueSettingLookupItem> CreateLookupItems(
CSharpCodeCompletionContext context,
IEnumerable<KeyValueSetting> settings,
IProject project,
IProjectModelElement project,
IRangeMarker rangeMarker,
LinkedList<KeyValueSettingLookupItem> lookupItems)
{
Expand All @@ -81,7 +82,7 @@ private LinkedList<KeyValueSettingLookupItem> CreateLookupItems(
return lookupItems;
}

private IRangeMarker CreateRangeMarker(CSharpCodeCompletionContext context)
private IRangeMarker CreateRangeMarker(ISpecificCodeCompletionContext context)
{
var rangeMarker =
new TextRange(context.BasicContext.CaretDocumentRange.TextRange.StartOffset).CreateRangeMarker(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

using JetBrains.Annotations;
using JetBrains.Application.Settings;
using JetBrains.UI.Options;

using Newtonsoft.Json;

Expand Down Expand Up @@ -44,7 +43,7 @@ public static IEnumerable<string> GetAdditionalConfigurationFiles(
}

public static void SaveCustomConfigurationFiles(
this OptionsSettingsSmartContext optionsContext,
this IContextBoundSettingsStore optionsContext,
string solutionId,
IEnumerable<string> customConfigurationFiles)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public static IEnumerable<KeyValueSetting> GetJsonProjectSettings(
}

public static IEnumerable<KeyValueSetting> GetXmlProjectSettings(
this IProject project,
this IProjectFolder project,
string settingsTagName,
string settingsKeyAttribute,
string settingsValueAttributes)
Expand Down Expand Up @@ -132,7 +132,7 @@ public static IEnumerable<KeyValueSetting> GetXmlProjectSettings(
return result;
}

private static string FormatJsonPath(JProperty property)
private static string FormatJsonPath(JToken property)
{
var formattedPath = property.Path.Replace(".", ":");
return formattedPath;
Expand All @@ -150,7 +150,7 @@ private static IEnumerable<IXmlTag> GetSettingTags(string settingsTagName, IProj
return collection;
}

private static IEnumerable<IProjectFile> GetXmlConfigFiles(IProject project)
private static IEnumerable<IProjectFile> GetXmlConfigFiles(IProjectFolder project)
{
var additionalConfigurationFiles = project.GetSolution().GetAdditionalConfigurationFiles();

Expand All @@ -161,7 +161,7 @@ private static IEnumerable<IProjectFile> GetXmlConfigFiles(IProject project)
|| additionalConfigurationFiles.Contains(file.GetPersistentID())));
}

private static IEnumerable<IProjectFile> GetNetCoreJsonConfigFiles(IProject project)
private static IEnumerable<IProjectFile> GetNetCoreJsonConfigFiles(IProjectFolder project)
{
var additionalConfigurationFiles = project.GetSolution().GetAdditionalConfigurationFiles();

Expand Down Expand Up @@ -231,6 +231,7 @@ private static JObject ReadSecretsSafe(IProject project)
// ReSharper disable once CatchAllClause
catch (Exception)
{
// Just swallow the exception
}

return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Resharper.ConfigurationSense.Extensions
{
public static class RangeExtensions
{
public static TextLookupRanges EvaluateRanges(this CSharpCodeCompletionContext context)
public static TextLookupRanges EvaluateRanges(this ISpecificCodeCompletionContext context)
{
var basicContext = context.BasicContext;
var selectedRange = basicContext.SelectedRange.TextRange;
Expand All @@ -31,7 +31,7 @@ public static TextLookupRanges EvaluateRanges(this CSharpCodeCompletionContext c
return new TextLookupRanges(replaceRange, replaceRange);
}

public static bool IsInsideAccessorPath(this CSharpCodeCompletionContext context, string path)
public static bool IsInsideAccessorPath(this ISpecificCodeCompletionContext context, string path)
{
var nodeAt = context.BasicContext.File.FindNodeAt(context.BasicContext.CaretDocumentRange);

Expand All @@ -44,7 +44,7 @@ public static bool IsInsideAccessorPath(this CSharpCodeCompletionContext context
return accessorPath.Equals(path);
}

public static bool IsInsideMethodPath(this CSharpCodeCompletionContext context, string path)
public static bool IsInsideMethodPath(this ISpecificCodeCompletionContext context, string path)
{
var nodeAt = context.BasicContext.File.FindNodeAt(context.BasicContext.CaretDocumentRange);

Expand All @@ -57,7 +57,7 @@ public static bool IsInsideMethodPath(this CSharpCodeCompletionContext context,
return accessorPath.Equals(path);
}

public static bool IsInsideAccessorType(this CSharpCodeCompletionContext context, string accessorType)
public static bool IsInsideAccessorType(this ISpecificCodeCompletionContext context, string accessorType)
{
var nodeAt = context.BasicContext.File.FindNodeAt(context.BasicContext.CaretDocumentRange);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Resharper.ConfigurationSense.Extensions
{
public static class XmlFileExtensions
{
public static IEnumerable<IXmlTag> FindAllByTagName(this IXmlFile xmlFile, string tagName)
public static IEnumerable<IXmlTag> FindAllByTagName(this IXmlTagContainer xmlFile, string tagName)
{
var xmlTags = new Queue<IXmlTag>(xmlFile.InnerTags);
while (xmlTags.Count > 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Resharper.ConfigurationSense.Extensions
public static class XmlTagExtensions
{
public static IEnumerable<KeyValueSetting> GetChildSettings(
this IXmlTag xmlTag,
this IXmlTagContainer xmlTag,
string keyAttribute,
string valueAttribute)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Resharper.ConfigurationSense/Models/KeyValueSetting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Resharper.ConfigurationSense.Models
{
public class KeyValueSetting : IEquatable<KeyValueSetting>
public sealed class KeyValueSetting : IEquatable<KeyValueSetting>
{
public KeyValueSetting([NotNull] string key, [NotNull] string value)
{
Expand Down

0 comments on commit 6ba0baf

Please sign in to comment.