Quantcast
Channel: YouTrackReSharper (RSRP) - Bug and Issue Tracker
Viewing all 106942 articles
Browse latest View live

RSRP-471785: Respeller suggestions

$
0
0
Reporter Simon Hewitt (simmotech) Simon Hewitt (simmotech)
Created Oct 8, 2018 5:56:42 PM
Updated Oct 8, 2018 5:56:58 PM
Subsystem No Subsystem
Assignee Unassigned
Priority Normal
State Submitted
Type Improvement
Fix version No Fix versions
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions
1) More granularity in which identifiers are checked. For example, I would prefer not to check lambda variables as they are usually abbreviations. e.g. "risi" in this example
                itemStatusLookup = ResourceItemHelper.GetResourceItemStatusInfos()
                    .ToDictionary(risi => risi.ItemID);


2) Allow me to set the ordering so "This Computer" is the first choice - reduces number of keystrokes when adding to a dictionary.

3) A button on the Respeller settings form (after "User words") to sort the user words list case insensitive. Makes it easier to find whether a word has been included or not.

4) A bit of a long shot but an additional "Group by" type in Inspection Results would be useful. Similar to "Issue Type" but grouping by the text. So for an "Type in identifier Issues in 'XXX', it would show "Typo in identifier" at the top level and then ["Typo in identifier: "trimmable"] at the next level with the occurrence count shown in brackets like some other "Group by"s do. Then the final level is the actual File locations.

PS Is this code the very same Respeller Pro I bought as an add-on some 4/5 years ago?

RSRP-471402: Introduce Field: "protected internal" visibility is selected when dialog opens instead of "private".

$
0
0
Reporter Lilia Shamsutdinova (Lilia.Shamsutdinova) Lilia Shamsutdinova (Lilia.Shamsutdinova)
Created Sep 5, 2018 12:07:59 PM
Updated Oct 8, 2018 5:57:23 PM
Subsystem Refactorings
Assignee Alisa Afonina (alisa.afonina)
Priority Major
State Fixed In Branch
Type Bug
Fix version 2018.3
Affected versions 2018.2
Fixed In Version ReSharper Undefined
VsVersion All Versions

JetBrains.ReSharperUltimate.2018.2.EAP9D.Checked.(182.0.20180905.50240-eap09d).

public string _somethingHasFailed = "Something has failed";
  1. Invoke Introduce Field on "Something has failed".

Actual result:
"protected internal" visibility is selected.

Expected result:
"private" visibility is selected.

RSRP-296290: Use Object Initializer goes wrong

$
0
0
Reporter Alex Berezoutsky (fergard) Alex Berezoutsky (fergard)
Created Apr 19, 2012 4:18:57 PM
Updated Oct 8, 2018 5:57:28 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Submitted
Type Bug
Fix version Backlog
Affected versions 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
Please open a Program.cs in sample solution(attached).

The following only initialize the MajorTic fields:
 var axis = new Y2Axis(title);
axis.MajorTic.IsOpposite = false;
axis.MinorTic.IsOpposite = false;
axis.MajorTic.IsInside = false;
axis.MinorTic.IsInside = false;

RSRP-471780: 'Invert if statement to reduce nesting' inspection isn't shown in CLT results

$
0
0
Reporter Angelina Elycheva (Angelina.Elycheva) Angelina Elycheva (Angelina.Elycheva)
Created Oct 8, 2018 1:19:00 AM
Updated Oct 8, 2018 5:58:34 PM
Resolved Oct 8, 2018 5:49:20 PM
Subsystem ReSharper Automation Tools (Command Line)
Assignee Slava Trenogin (derigel)
Priority Normal
State Duplicate
Type Question
Fix version No Fix versions
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions
0. Try this code:
public void TestMethod()
        {
            if (MyObject.MyBool)
            {
                if (MyObject.MyString != string.Empty)
                {
                    Console.WriteLine(MyObject.MyString);
                }
            }
        }
1. Inspect code issues for solution in ReSharper and by CLT

Result: ReSharper shows '"Invert 'if' statement to reduce nesting" while CLT does not.
'

RSRP-296758: False warning 'Expression is always null' and bad QF 'Replace with null'

$
0
0
Reporter Vladimir Reshetnikov (nikov) Vladimir Reshetnikov (nikov)
Created Apr 22, 2012 4:59:31 AM
Updated Oct 8, 2018 6:01:43 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Submitted
Type Bug
Fix version Backlog
Affected versions 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
class C
{
void Foo(string y, __arglist) { }

void Bar()
{
Foo(null, __arglist(null));
}
}

After QF:

class C
{
void Foo(string y, __arglist) { }

void Bar()
{
Foo(null, null); // error CS1503: Argument 2: cannot convert from '<null>' to '__arglist'
}
}

RSRP-296861: Missing QF: Import namespace System.Linq

$
0
0
Reporter Vladimir Reshetnikov (nikov) Vladimir Reshetnikov (nikov)
Created Apr 23, 2012 2:31:45 AM
Updated Oct 8, 2018 6:03:09 PM
Resolved Oct 8, 2018 6:03:09 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Duplicate
Type Bug
Fix version Backlog
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions
using System.Collections.Generic;

class A
{
static void Foo(LinkedList<int> x)
{
int y = x.First(); // error CS1955: Non-invocable member 'System.Collections.Generic.LinkedList<int>.First' cannot be used like a method.
}
}

Expected result after QF:

using System.Collections.Generic;
using System.Linq; // <-- IMPORTED

class A
{
static void Foo(LinkedList<int> x)
{
int y = x.First(); // OK
}
}

RSRP-89500: Import popup for extension methods

$
0
0
Reporter Olga Lukianova (olka) Olga Lukianova (olka)
Created Dec 25, 2008 3:34:30 PM
Updated Oct 8, 2018 6:03:09 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Open
Type Bug
Fix version Backlog
Affected versions 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
I expect to see import popup here. But it suggests only quickfix. :(
But when I type code I type method name first, then I want to insert using directive and then type arguments using paramter info.

using System.Collections.Generic;

namespace JetBrains.ReSharper.Psi.VB.Impl.Resolve
{
internal static class MoreSpecificSelector
{
public static IList<ApplicableCandidate> SelectMoreExpanded(IList<ApplicableCandidate> candidates)
{
var result = new List<ApplicableCandidate>();
foreach (var candidate in candidates.Skip()) //HERE
{

}
}
}
}

RSRP-296929: Suggest better QF for implicitly typed variable initialized with lambda

$
0
0
Reporter Vladimir Reshetnikov (nikov) Vladimir Reshetnikov (nikov)
Created Apr 23, 2012 5:55:06 AM
Updated Oct 8, 2018 6:05:19 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Submitted
Type Feature
Fix version Backlog
Affected versions 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
class Program
{
static void Main()
{
var func = () => 1; // Apply QF
}
}

Actual result:

var func = new Func<int>(() => 1); // Two extra keywords, two extra parentheses

Expected:

Func<int> func = () => 1;

Or, suggest both QF's if you like

RSRP-296930: Suggest better QF for failed type inference from lambda

$
0
0
Reporter Vladimir Reshetnikov (nikov) Vladimir Reshetnikov (nikov)
Created Apr 23, 2012 6:11:30 AM
Updated Oct 8, 2018 6:08:38 PM
Resolved Oct 8, 2018 6:08:38 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Duplicate
Type Feature
Fix version Backlog
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions
class Program
{
static void Main()
{
Foo(() => 1); // Apply QF
}

static void Foo<T>(T x) { }
}

Actual result:

Foo<>(() => 1); // That wasn't terribly helpful...

Expected:

Foo<Func<int>>(() => 1);

RSRP-41120: Quickfix "Add " should attempt to infer types

$
0
0
Reporter Ilya Ryzhenkov (orangy) Ilya Ryzhenkov (orangy)
Created May 22, 2007 6:57:22 PM
Updated Oct 8, 2018 6:08:38 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Open
Type Feature
Fix version Backlog
Affected versions 2018.2
Fixed In Version ReSharper Undefined
VsVersion All Versions
ICollection<string> collection = new List // apply quick fix here, it should insert <string>

RSRP-296932: Provide QF for mismatched delegate types

$
0
0
Reporter Vladimir Reshetnikov (nikov) Vladimir Reshetnikov (nikov)
Created Apr 23, 2012 6:47:38 AM
Updated Oct 8, 2018 6:09:25 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Submitted
Type Feature
Fix version Backlog
Affected versions 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
static void Foo(IEnumerable<int> list, Predicate<int> predicate)
{
var x = list.Where(predicate); // error CS1503: Argument 2: cannot convert from 'System.Predicate<int>' to 'System.Func<int,bool>'
}
}

Expected after QF:

var x = list.Where(new Func<int, bool>(predicate)); // OK

or

var x = list.Where(predicate.Invoke); // IMO, looks nicer

RSRP-297463: QF 'Use array creation expression' does nothing

$
0
0
Reporter Vladimir Reshetnikov (nikov) Vladimir Reshetnikov (nikov)
Created Apr 25, 2012 1:25:35 AM
Updated Oct 8, 2018 6:16:40 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Submitted
Type Bug
Fix version Backlog
Affected versions 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
using System;

class A
{
static void Main()
{
var a = Array.CreateInstance(typeof (int[]), 1); // Apply QF 'Use array creation expression'
}
}

Nothing happens.

Expected:

class A
{
static void Main()
{
var a = new int[1][];
}
}

RSRP-297914: QF 'Cast qualifier' forgets to substitute type arguments

$
0
0
Reporter Vladimir Reshetnikov (nikov) Vladimir Reshetnikov (nikov)
Created Apr 27, 2012 8:16:13 AM
Updated Oct 8, 2018 6:24:26 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Submitted
Type Bug
Fix version Backlog
Affected versions 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
using System;

sealed class C<T> : IComparable<T>
{
static void Main()
{
var c = new C<int>();
var x = c.CompareTo(1); // Apply QF
}

int IComparable<T>.CompareTo(T other)
{
return 0;
}
}

Actual:

using System;

sealed class C<T> : IComparable<T>
{
static void Main()
{
var c = new C<int>();
var x = ((IComparable<T>)c).CompareTo(1); // error CS0030: Cannot convert type 'C<int>' to 'System.IComparable<T>'
}

int IComparable<T>.CompareTo(T other)
{
return 0;
}
}

Expected:

using System;

sealed class C<T> : IComparable<T>
{
static void Main()
{
var c = new C<int>();
var x = ((IComparable<int>)c).CompareTo(1); // OK
}


int IComparable<T>.CompareTo(T other)
{
return 0;
}
}

RSRP-298095: Suggest to wrap arguments to filesystem API with Environment.ExpandEnvironmentVariables if they contain possible quoted environment variables

$
0
0
Reporter Vladimir Reshetnikov (nikov) Vladimir Reshetnikov (nikov)
Created Apr 28, 2012 7:20:20 AM
Updated Oct 8, 2018 6:37:53 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Submitted
Type Feature
Fix version Backlog
Affected versions 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
using System.IO;

class C
{
static void Main()
{
File.WriteAllText(@"%USERPROFILE%\data.txt", "abc"); // Possible DirectoryNotFoundException
}
}

Expected result after QF:

using System;
using System.IO;

class C
{
static void Main()
{
File.WriteAllText(Environment.ExpandEnvironmentVariables(@"%USERPROFILE%\data.txt"), "abc");
}
}

RSRP-298635: Provide QF: Add 'new' keyword

$
0
0
Reporter Vladimir Reshetnikov (nikov) Vladimir Reshetnikov (nikov)
Created May 1, 2012 1:59:01 AM
Updated Oct 8, 2018 6:38:53 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Submitted
Type Feature
Fix version Backlog
Affected versions 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
using System.Collections.Generic;

class C
{
static void Main()
{
var x = List<string>();
}
}

RSRP-298735: Use collection initializer with extra coma in list

$
0
0
Reporter Alexander Zaytsev (hazzik) Alexander Zaytsev (hazzik)
Created May 1, 2012 1:14:27 PM
Updated Oct 8, 2018 6:39:46 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Submitted
Type Bug
Fix version Backlog
Affected versions 6.1.1, 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
var ints = new List<int>
{
1,
2,
3, // note extra coma
};
ints.Add(4);
When I try to 'Use collection initializer' refactoring I got following incorrect code:
var ints = new List<int>
{
1,
2,
3,, //extra coma still present
4
};

RSRP-300127: Provide QF: Add parentheses

$
0
0
Reporter Vladimir Reshetnikov (nikov) Vladimir Reshetnikov (nikov)
Created May 6, 2012 11:14:10 PM
Updated Oct 8, 2018 6:41:22 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Submitted
Type Feature
Fix version Backlog
Affected versions 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
using System.Collections.Generic;
using System.Linq;


class P
{
static void Foo(IEnumerable<string> x)
{
var y = x.First.ToLower();
}
}

Expected result:

using System.Collections.Generic;
using System.Linq;


class P
{
static void Foo(IEnumerable<string> x)
{
var y = x.First().ToLower();
}
}

RSRP-303960: Incorrect suggestion 'Replace Equals with equality operator'

$
0
0
Reporter Alexander Zaytsev (hazzik) Alexander Zaytsev (hazzik)
Created May 22, 2012 1:01:48 AM
Updated Oct 8, 2018 6:44:06 PM
Resolved Oct 8, 2018 6:44:06 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Obsolete
Type Bug
Fix version Backlog
Affected versions 7.0
Fixed In Version ReSharper Undefined
VsVersion All Versions
I have following code snippet:

        private static bool X(IEnumerable<System.Type> parameterTypes, System.Type[] types)
{
return !parameterTypes
.Where((parameterType, i) => Equals(parameterType, types[i]))
.Any();
}

private static bool Equals(System.Type parameterType, System.Type type)
{
return parameterType != type &&
(!parameterType.ContainsGenericParameters ||
!type.ContainsGenericParameters ||
parameterType.GetGenericArguments().Length != type.GetGenericArguments().Length);
}

R# is suggesting me to replace Equals(parameterType, types[i]) with parameterType == types[i] which makes my Equals method unused.

R# 7.0 EAP, b44 VS2010

RSRP-471758: Running an xUnit from xUnit.net Test icon (as opposed to xUnit.net Test Class icon) always ends up Inconclusive

$
0
0
Reporter Jacob Mojiwat (jmojiwat) Jacob Mojiwat (jmojiwat)
Created Oct 5, 2018 3:42:34 AM
Updated Oct 8, 2018 6:44:50 PM
Subsystem Unit Testing
Assignee Eugene Strizhok (Eugene.Strizhok)
Priority Normal
State Submitted
Type Bug
Fix version No Fix versions
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions

Clicking the class level icon runner will run the tests, but clicking on the method level icon runner will return inconclusive.

Error returned by Resharper:

2018.10.05 08:34:05.678 ERROR JetBrains.Util.InternalErrorException: Unexpected: Unable to find any matching test cases
at JetBrains.ReSharper.UnitTestRunner.Xunit.TestRunner.Run(XunitTestAssemblyTask assemblyTask)

2018.10.05 08:34:05.698 WARN Element Testing was left pending after its run completion.
2018.10.05 08:34:05.698 WARN Element Test1 was left pending after its run completion.

Source code to reproduce the error:

public class Testing
{
    [Theory, TestAutoData]
    public void Test1(Multiplier sut)
    {
        var x = sut.Execute(1);
        x.Should().Be(2);
    }

    [Theory, TestAutoData]
    public void Test2(Multiplier sut)
    {
        var x = sut.Execute(1);
        x.Should().Be(2);
    }

    public class Multiplier
    {
        public int Execute(int i)
        {
            return i * 2;
        }
    }

    private class TestAutoDataAttribute : AutoDataAttribute
    {
        public TestAutoDataAttribute() : base(() => 
            new Fixture().Customize(new CompositeCustomization(new Customization(), new AutoNSubstituteCustomization())))
        {}
    }

    private class Customization : ICustomization
    {
        public void Customize(IFixture fixture)
        {
            fixture.Register(() => new Multiplier());
        }
    }
}

Using
Resharper 2018.2.3
Visual Studio 15.8.6

Compiling against .Net 4.7.2

RSRP-304469: Use array creation expression causes non compilable code in VB.NET

$
0
0
Reporter Julien Lebosquain (mrjul) Julien Lebosquain (mrjul)
Created May 23, 2012 6:28:37 PM
Updated Oct 8, 2018 6:45:11 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Submitted
Type Bug
Fix version Backlog
Affected versions 6.1, 6.1.1, 7.0, 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
Dim arr = Array.CreateInstance(GetType(Integer), 1)
Array.CreateInstance is highlighted with "use array creation expression". Apply the quick fix.

Actual result, that doesn't compile (incorrect number of arguments for New) and would, if valid, creates a 2-items array instead of one:
Dim arr = New Integer(1)

Expected result:
Dim arr(0) as Integer
Viewing all 106942 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>