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

RSRP-446656: Wrong code is produced after applying a convert quickfix for IEnumerable

$
0
0
Reporter Alexander Kurakin (Alexander.Kurakin) Alexander Kurakin (Alexander.Kurakin)
Created Aug 12, 2015 3:08:05 PM
Updated Oct 12, 2018 11:39:42 AM
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
Initial Code:
private static IEnumerable<object> Foo(IEnumerable<IEnumerable> _collection) 
{
foreach (var collection in _collection)
foreach (var item in collection)
yield return item;
}

after applying a suggestion:
private static IEnumerable<object> Foo<IEnumerable> _collection) => 
return _collection.SelectMany(collection => collection); <-- wrong

RSRP-446779: Renaming method parameter incorrectly removes 'Redundant method override'

$
0
0
Reporter Angelina Elycheva (Angelina.Elycheva) Angelina Elycheva (Angelina.Elycheva)
Created Aug 13, 2015 7:31:36 PM
Updated Oct 12, 2018 11:41:23 AM
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
1. Try this one
    class b     : a
    {
        protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
        {
            base.OnMouseLeftButtonDown(e);
        }
    }
     class a
    {
         protected virtual void OnMouseLeftButtonDown(MouseButtonEventArgs e){
         }
    }
ReSharper warns about redundant method override
2. Change parameter e => e1 in the overriding method

Actual Result: warning is no longer suggested

Expected Result: changing parameter name should not remove suggestion

RSRP-447292: "Make properties get-only in file/proj/solution" not working

$
0
0
Reporter Alexander Kurakin (Alexander.Kurakin) Alexander Kurakin (Alexander.Kurakin)
Created Aug 20, 2015 7:06:54 PM
Updated Oct 12, 2018 11:44:43 AM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Critical
State Submitted
Type Bug
Fix version Backlog
Affected versions 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
Try applying "Make properties get-only in file" -> nothing happens

namespace ClassLibrary1
{
public class Class56
{
public Class56(Projects application,
Projects application1,
Projects application2)
{
this.Application = application;
this.Application1 = application1;
this.Application2 = application2;

}

public string CurrentFilePath => this.Application?.CurrentProject?.Path;

public string CurrentFilePath1 => this.Application1?.CurrentProject?.Path;

public string CurrentFilePath2 => this.Application2?.CurrentProject?.Path;



public Projects Application { get; set; }

public Projects Application1 { get; set; }

public Projects Application2 { get; set; }
}
}

RSRP-447320: v9.2 hides suppression code fixes in VS 2015 RTM

$
0
0
Reporter Hans van Bakel (Hans.van.Bakel) Hans van Bakel (Hans.van.Bakel)
Created Aug 21, 2015 10:22:45 PM
Updated Oct 12, 2018 11:49:02 AM
Subsystem Quick Fixes
Assignee Lilia Shamsutdinova (Lilia.Shamsutdinova)
Priority Normal
State To Reproduce
Type Bug
Fix version No Fix versions
Affected versions 9.2
Fixed In Version ReSharper Undefined
VsVersion VS 2015 RTM
This is a follow up on RSRP-445665, this is not fixed in v9.2

Steps to reproduce:
Open VS2015 RTM
Create new project
Import: https://www.nuget.org/packages/Microsoft.CodeAnalysis.FxCopAnalyzers

Create a class with the following code:
using System;

namespace ClassLibrary1
{
public class Class1
{
public Class1()
{
try
{

}
catch (Exception ex)
{
throw ex;
}
}
}
}

When I load VS2015 RTM with Resharper disabled I get code fixes (Suppress in code with a pragma or attribute, or Suppress in separate file).

When Resharpers is enabled, the only available fix is to Rethrow the exception. But the option of suppressing this warning is gone.

See also the attached images in the previous issue.

To be complete:
JetBrains ReSharper Ultimate 2015.2 Build 103.0.20150818.200216
ReSharper 9.2.20150819.164145

Application Packages:
JetBrains Fake VisualStudio VsPackageAssembly build 14.0.0.0 on 2015-08-20 17:29:04Z.
JetBrains Platform Core Ide build 103.0.20150818.200216 on 2015-08-18 20:02:16Z.
JetBrains Platform Core Shell build 103.0.20150818.190618 on 2015-08-18 19:06:18Z.
JetBrains Platform Core Text build 103.0.20150818.200216 on 2015-08-18 20:02:16Z.
JetBrains Platform Installer build 103.0.20150818.200216 on 2015-08-18 20:02:16Z.
JetBrains Platform Interop dotMemoryUnit.Interop build 103.0.20150818.200216 on 2015-08-18 20:02:16Z.
JetBrains Platform Symbols build 103.0.20150818.200216 on 2015-08-18 20:02:16Z.
JetBrains Platform VisualStudio build 103.0.20150818.200216 on 2015-08-18 20:02:16Z.
JetBrains Psi.Features Core build 103.0.20150819.145501 on 2015-08-19 14:55:02Z.
JetBrains Psi.Features SolutionBuilder build 103.0.20150819.145501 on 2015-08-19 14:55:02Z.
JetBrains Psi.Features src build 103.0.20150819.145501 on 2015-08-19 14:55:02Z.
JetBrains Psi.Features Tasks build 103.0.20150819.145501 on 2015-08-19 14:55:02Z.
JetBrains Psi.Features UnitTesting build 103.0.20150819.145501 on 2015-08-19 14:55:02Z.
JetBrains Psi.Features VisualStudio build 103.0.20150819.145501 on 2015-08-19 14:55:02Z.
JetBrains ReSharper src build 103.0.20150819.164145 on 2015-08-19 16:41:48Z.

ReSharper 9.2 Licensed to *****.
Visual Studio 14.0.23107.0.

Copyright © 2015 JetBrains. All rights reserved.

RSRP-447866: Feature: add "Initialize with constructor parameter" quickfix window for selecting constructors

$
0
0
Reporter Vlad Taranov (Vlad.Taranov) Vlad Taranov (Vlad.Taranov)
Created Sep 3, 2015 8:34:41 PM
Updated Oct 12, 2018 11:53:28 AM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Submitted
Type Improvement
Fix version Backlog
Affected versions 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
Very often I have a parameterless constructor for serialization and I don't need R# to initialize anything from there. Could you add a window for that quickfix so I can choose what constructors to use? I'm tired of cleaning my serialization constructors.

RSRP-447937: Missing expected inspection Add/remove 'this' qualifier inside anonymous method

$
0
0
Reporter John Pedersen (0x0309) John Pedersen (0x0309)
Created Sep 9, 2015 12:04:53 PM
Updated Oct 12, 2018 11:56:11 AM
Resolved Oct 12, 2018 11:56:11 AM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Fixed
Type Bug
Fix version Unidentified prior version
Affected versions 9.2
Fixed In Version ReSharper Undefined
VsVersion All Versions
Inside an anonymous method the inspection Add/remove 'this' qualifier is not showing. It does work inside lambda expressions though.

RSRP-447972: Import references quick fix rewrites usings ineffectively

$
0
0
Reporter Dark Daskin (DarkDaskin) Dark Daskin (DarkDaskin)
Created Sep 10, 2015 11:46:01 PM
Updated Oct 12, 2018 11:58:27 AM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Submitted
Type Bug
Fix version Backlog
Affected versions 9.2, 8.2, 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
Assume I have the following classes defined somewhere in the project:
namespace A { class A1 {} class C1 {} class C2 {} class C3 {} class C4 {} class C5 {} }
namespace B { class B1 {} class C1 {} class C2 {} class C3 {} class C4 {} class C5 {} }

Now I am working on the class inside this file:
using B;

class Test
{
    void M()
    {
        var a1 = new A1(); // Just added this line
    {
    
    void M2()
    {
        var c1 = new C1();
        var c2 = new C2();
        var c3 = new C3();
        var c4 = new C4();
        var c5 = new C5();
    }
}

A1 class is not imported, so I execute the import quick fix and get the following:
using A;
using C1 = B.C1;
using C2 = B.C2;
using C3 = B.C3;
using C4 = B.C4;
using C5 = B.C5;
The expected result is:
using A1 = A.A1;
using B;

I see two possible ways to improve this behavior:
  1. Leave existing usings as is when possible
  2. Analyze possible variants and choose one which produces least lines of code

RSRP-447987: Quick fix is suggested if caret is placed only in specific places

$
0
0
Reporter Anton Toritsyn (t_anton) Anton Toritsyn (t_anton)
Created Sep 11, 2015 3:43:25 PM
Updated Oct 12, 2018 12:01:53 PM
Resolved Oct 12, 2018 12:01:53 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Fixed
Type Bug
Fix version Unidentified prior version
Affected versions 9.2
Fixed In Version ReSharper Undefined
VsVersion All Versions
I am trying to introduce a parameter in the existing method.
If I place caret in the middle the text for the new parameter then quick fix is not suggested (screenshot 1).
If I place the caret before or after parameter then quick fix is suggested (screenshot 2).

RSRP-448117: To string.Format invocation + custom methods

$
0
0
Reporter Matt Ellis (citizenmatt) Matt Ellis (citizenmatt)
Created Sep 21, 2015 12:33:38 PM
Updated Oct 12, 2018 12:09:38 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
The "To string.Format invocation" has some known methods - StringBuilder.Append/StringBuilder.AppendFormat and Console.Write, etc. Instead of calling string.Format, an existing method call to Append is rewritten to use the AppendFormat method. If custom code defines e.g. Error and ErrorFormat, and the ErrorFormat method is marked with the StringFormatMethod annotation attribute, the "To string.Format invocation" should use simple heuristics to look for the formatting version. Something simple, such as a method with the same method name prefix, ending in "Format" and marked with StringFormatMethodAttribute would do this.

RSRP-470595: nugetsearch.cloudapp.net suggest to install very old packages

$
0
0
Reporter Alexander Ulitin (alexander.ulitin) Alexander Ulitin (alexander.ulitin)
Created Jul 13, 2018 5:31:57 PM
Updated Oct 12, 2018 12:13:48 PM
Subsystem NuGet Browser (Import From nuget.org)
Assignee Alexander Shvedov (shvedov)
Priority Show-stopper
State Submitted
Type Bug
Fix version No Fix versions
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions
Nuget search service return very old packages.
For example it suggest version JetBrains.Annotation version 10.2.1 (http://nugetsearch.cloudapp.net/?type=NotNullAttribute) which was released two years ago.
This feature seems like broken without indexing new packages.

RSRP-448200: Expand 'to void return' area to 'return'

$
0
0
Reporter Alexandra Kuks (Asia.Rudenko) Alexandra Kuks (Asia.Rudenko)
Created Sep 23, 2015 1:25:53 AM
Updated Oct 12, 2018 12:45:03 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Major
State Submitted
Type Usability Problem
Fix version Backlog
Affected versions 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
In the following snippet if I press alt+Enter somewhere in 'return' ReSharper suggests only 'to expression body'; however if cursor is in 'a+b;', there're 'to void return' and 'change type of method'. Probably they should be offered for return, too.
For example when I try to build it and navigate from build output with double-click - I'm placed right before 'return' and have to press End to get to fixing.

public void Divide(int a, int b)
{
return a + b;
}

RSRP-448759: Add all missing xml-docs at once

$
0
0
Reporter Angelina Elycheva (Angelina.Elycheva) Angelina Elycheva (Angelina.Elycheva)
Created Oct 1, 2015 7:40:06 PM
Updated Oct 12, 2018 12:47:18 PM
Resolved Oct 12, 2018 12:47:18 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
suggest adding all xmldocs instead of making me do one at a time.

/// <summary> 
/// Assume that if leddgerRecs not passed in that we should retrieve them
/// </summary>
/// <param name="codeCampYearId"></param>
/// <returns></returns>
public static bool CheckLedgerCodePaid(int codeCampYearId, int attendeesId, string ledgerCode)

RSRP-448763: Importing reference in VB removes dot

$
0
0
Reporter Angelina Elycheva (Angelina.Elycheva) Angelina Elycheva (Angelina.Elycheva)
Created Oct 2, 2015 12:47:53 PM
Updated Oct 12, 2018 12:50:34 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
1. Try the following code
    Public Function RenderGridColumn(ByRef oCol As C1.Win.C1TrueDBGrid.C1DataColumn, ByRef CellType As PremiumConstants.eCellType, ByRef bVisible As Boolean, ByRef sCaption As String, ByRef bEnabled As Boolean, ByRef bFetchStyle As Boolean, Optional ByRef v_vDefault As Object = Nothing, Optional ByRef lColWidth As Double = 0, Optional ByRef ColIndex As Integer = 0) As Integer
Dim lResult As PMEReturnCode = PMEReturnCode.PMFalse ' Define default return
'Const AC_METHOD As String = "RenderGridColumn"

With oCol

.VisualStyleElement.Window.Caption = sCaption
.DataWidth = Convert.ToInt32(lColWidth)

End With

Return lResult
End Function
2. Put caret on VisualStyleElement.Window.Caption
3. Select to Import missing reference

Result: Quick-fix adds the reference and removes the dot before VisualStyleElement.Window.Caption

RSRP-471821: Disabling formatter with comments doesn't actually disable it

RSRP-448816: Quickfix to convert LINQ method invocation to/from queries

$
0
0
Reporter Angelina Elycheva (Angelina.Elycheva) Angelina Elycheva (Angelina.Elycheva)
Created Oct 5, 2015 1:19:02 PM
Updated Oct 12, 2018 1:04:12 PM
Subsystem Context Actions
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
var foo = bar.OrderBy(b => b.Baz).Select(b => new { b.Baz, b.Zap });
Equiv to:
var foo = from b in bar
orderby b.Baz
select new { b.Baz, b.Zap };

Sometimes one version vs the other is easier to understand at a glance, or easier to make changes without causing issues.

RSRP-449686: Use naming conventions to detect member scope when using quick actions

$
0
0
Reporter Alexander Kurakin (Alexander.Kurakin) Alexander Kurakin (Alexander.Kurakin)
Created Oct 20, 2015 1:34:29 PM
Updated Oct 12, 2018 1:14:52 PM
Subsystem Quick Fixes - Create From Usage
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
When using quick actions to create members/fields/methods:
public Button Enabled(bool value) 
{
enabled = value; // <-- field does not exist in class
return this;
}
The quick actions for "Create a field" should detect the match to protected field naming convention and create a:
protected bool value;
And not
private bool _value; // note the underscore
When the naming concevention for protected members are set to "camelCaseNoUnderscore"

RSRP-450653: Incorrect refactoring for foreach with await

$
0
0
Reporter Alexander Kurakin (Alexander.Kurakin) Alexander Kurakin (Alexander.Kurakin)
Created Nov 11, 2015 4:14:59 PM
Updated Oct 12, 2018 1:17:51 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Major
State Submitted
Type Bug
Fix version Backlog
Affected versions 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
The foreach in the code below gets incorrectly refactored:
var filters = new List<Func<int, Task<int>>>(); 
int seed = 0;
foreach (var filter in filters)
seed = await filter (seed);
One possible solution is to:
1) Use "Task.FromResult(0)" as seed
2) Use "async (current, filter) => await filter(await current)" as aggregating function
3) Await the result of Aggregate

RSRP-451051: Suggest adding parameter name to new ArgumentNullException()

$
0
0
Reporter Drew Noakes (drewnoakes) Drew Noakes (drewnoakes)
Created Nov 18, 2015 2:33:20 AM
Updated Oct 12, 2018 1:19:41 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Submitted
Type Feature
Fix version Backlog
Affected versions 10.0, 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
public void Foo([NotNull] byte[] buffer)
{
    if (buffer == null)
        throw new ArgumentNullException(); // should suggest to add nameof(buffer)

In this case, the argument is plain to see. R# should suggest adding the argument's name to the exception.

RSRP-471822: "result" to be recognised as a 'special' or 'preferred' name

$
0
0
Reporter Simon Hewitt (simmotech) Simon Hewitt (simmotech)
Created Oct 12, 2018 1:17:37 PM
Updated Oct 12, 2018 1:19:51 PM
Subsystem Code Analysis - C#
Assignee Ivan Serduk (IvanSerduk)
Priority Normal
State Submitted
Type Improvement
Fix version No Fix versions
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions
I recently came across "dummy", "ignore" and "_" as special names recognised by Resharper to prevent "unused local variable" warning. Nice!

I am aware that you would want the list of "special names" to be kept to an absolute minimum but can I suggest another 'special name' to be recognised by Resharper, albeit in a different manner: "result".

I use "result" very often in functions to denote the value that will be ultimately returned.
I do this rather than use, say, one of the names normally suggested by IntroduceVariable not least so that its value is always shown in a Watch Window no matter which method I am in.

But having an option available that indicates 'result' is to be treated as a special or preferred name would allow a number of refactorings to include it as a possible value at the top of the list when in a function (ie not a method).

RSRP-451070: Make 'x' static is not suggested when using nameof(y) operator

$
0
0
Reporter Martin (IAmMartin) Martin (IAmMartin)
Created Nov 18, 2015 3:59:30 PM
Updated Oct 12, 2018 1:22: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
In the first snippet "Make 'test' static" is suggested, in the second it's not. Note: log is a static field.

private void test()
{
log.Error(new ArgumentOutOfRangeException("Test"));
}

private void test()
{
log.Error(new ArgumentOutOfRangeException(nameof(DateTime)));
}
Viewing all 106942 articles
Browse latest View live