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

RSRP-285150: Convert to :? Expression changes meaning of code.

$
0
0
Reporter ptrc (ptrc) ptrc (ptrc)
Created Dec 5, 2011 10:03:14 PM
Updated Oct 8, 2018 4:39:20 PM
Subsystem Code Analysis - C#
Assignee Andrew Karpov (andrew.karpov)
Priority Major
State Open
Type Bug
Fix version Backlog
Affected versions 6.1, 6.1.1, 7.0, 7.0.1
Fixed In Version ReSharper Undefined
VsVersion All Versions
First, I really like your product. Please extend my thanks to your team for making my life so much easier.
I'm using 6.1 EAP, nightly build from December 5.

Consider the following:

Original
        public object Example(string input)
{
object finalValue;
if (input.Contains('.'))
finalValue = Decimal.Parse(input);
else
finalValue = int.Parse(input);
return finalValue;
}

Resharper suggests the code above could be changed to this:

Resharper Suggestion
        private object TestFull(string input)
{
object finalValue;
finalValue = input.Contains('.') ? Decimal.Parse(input) : int.Parse(input);
return finalValue;
}

The suggested code change has more than just a syntactical effect. From the c# specification:

If X and Y are the same type, then this is the type of the conditional expression.

  • Otherwise, if an implicit conversion (Section 6.1) exists from X to Y, but not from Y to X, then Y is the type of the conditional expression.
  • Otherwise, if an implicit conversion (Section 6.1) exists from Y to X, but not from X to Y, then X is the type of the conditional expression.
  • Otherwise, no expression type can be determined, and a compile-time error occurs.


The result is that the resharper code always returns a Decimal type, rendering the int.parse basically pointless.

RSRP-471783: missing tootltips for the icons on the status bar, action bar and error stripe

$
0
0
Reporter Tatyana Lunegova (lunega) Tatyana Lunegova (lunega)
Created Oct 8, 2018 4:43:26 PM
Updated Oct 8, 2018 4:43:26 PM
Subsystem Platform - VS Integration
Assignee Denis Korneev (Denis.Korneev)
Priority Show-stopper
State Submitted
Type Bug
Fix version 2018.3
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions

RSRP-287669: remove trim from string.IsNullOrWhiteSpace() calls

$
0
0
Reporter mark van tilburg (mark.van.tilburg) mark van tilburg (mark.van.tilburg)
Created Jan 10, 2012 6:28:39 PM
Updated Oct 8, 2018 4:50:43 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
$var$ = System.string value

string.IsNullOrWhiteSpace($var$.Trim())

Should become:

string.IsNullOrWhiteSpace($var$)

RSRP-287673: VB.NET - No quickfix for 'base class doesn't contain parameterless constructor'

$
0
0
Reporter Denis Abramov (sparky2708) Denis Abramov (sparky2708)
Created Jan 10, 2012 8:28:42 PM
Updated Oct 8, 2018 4:55:51 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
See screenshot.

If my base class doesn't contain a parameterless constructor give me an option to create the appropriate minimal constructor.

For example if my base class is:
Public Class MyBaseClass
Public Sub New(ByVal i as Integer)
End Sub
End Class

Then if my class is:
Public Class MyClass
Inherits MyBaseClass
End Class

R# should suggest to create the constructor in my class as:
Public Class MyClass
Inherits MyBaseClass

Public Sub New(ByVal i as Integer)
MyBase.New(i)
End Sub
End Class

RSRP-287738: Nullable[] is rewritten as int?

$
0
0
Reporter Ilya Kozhevnikov (kozhevnikov) Ilya Kozhevnikov (kozhevnikov)
Created Jan 12, 2012 9:09:01 PM
Updated Oct 8, 2018 4:59:20 PM
Resolved Oct 8, 2018 4:59:20 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Major
State Fixed
Type Bug
Fix version Unidentified prior version
Affected versions 6.1
Fixed In Version ReSharper Undefined
VsVersion All Versions
After both rewrite suggestions Nullable<Int32>[] foo = new Nullable<Int32>[0] is transformed into int? foo = new int?[0] which, of course, fails.

RSRP-471674: [Performance Report] Extension 'JetBrains ReSharper Ultimate 2018.2.3 182.0' likely caused x seconds of unresponsiveness

$
0
0
Reporter Adrian Wright (adrian.3) Adrian Wright (adrian.3)
Created Sep 28, 2018 3:06:59 PM
Updated Oct 8, 2018 5:01:29 PM
Subsystem No Subsystem
Assignee Sergey Kuks (coox)
Priority Show-stopper
State Open
Type Performance Problem
Fix version 2018.3
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions
Evaluator: False
OS Version: Microsoft Windows NT 6.1.7601 Service Pack 1
Product: ReSharper, Version: 2018.2.20180912.160227
Time Zone: GMT Standard Time

Description

In Visual Studio I am getting the following message appear at the top in a yellow bar:

Extension 'JetBrains ReSharper Ultimate 2018.2.3 182.0' likely caused x seconds of unresponsiveness

It even happens when I open Visual Studio without opening a solution or project.

It was happening in previous versions not just the latest version.

RSRP-288020: convert to LINQ - incomplete reduction

$
0
0
Reporter Jakub Jiricek (Jakub.Jiricek) Jakub Jiricek (Jakub.Jiricek)
Created Jan 26, 2012 6:39:44 PM
Updated Oct 8, 2018 5:02:31 PM
Resolved Oct 8, 2018 5:02:31 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Obsolete
Type Bug
Fix version Backlog
Affected versions 6.1.1
Fixed In Version ReSharper Undefined
VsVersion All Versions
in the most recent 6.1.40.6, the code
    private int test1(IEnumerable<int> values)
{
int max = 0;
foreach (int val in values)
{
if (val > max) max = val;
}
return max;
}

private int test2(IEnumerable<int> values)
{
int max = 0;
foreach (int val in values)
{
if (val >= max) max = val;
}
return max;
}

private int test3(IEnumerable<int> values)
{
int max = 0;
foreach (int val in values)
{
max = val > max ? val : max;
}
return max;
}

private int test4(IEnumerable<int> values)
{
int max = 0;
foreach (int val in values)
{
max = val >= max ? val : max;
}
return max;
}

private int test5(IEnumerable<int> values)
{
int max = 0;
foreach (int val in values)
{
max = Math.Max(max, val);
}
return max;
}

would be converted (using "Convert into LINQ-Expression") to

    private int test1(IEnumerable<int> values)
{
return values.Concat(new[] {0}).Max();
}

private int test2(IEnumerable<int> values)
{
int max = 0;
foreach (int val in values.Where(val => val >= max))
{
max = val;
}
return max;
}

private int test3(IEnumerable<int> values)
{
return values.Concat(new[] {0}).Max();
}

private int test4(IEnumerable<int> values)
{
return values.Concat(new[] {0}).Max();
}

private int test5(IEnumerable<int> values)
{
return values.Concat(new[] {0}).Max();
}

If I am not missing anything, the test2 shoud be reducible the same way as the other four methods.

RSRP-471784: Testrunner behaves fishy combining TestFixtureSource and Values

$
0
0
Reporter Roger Kratz (rogerkratz) Roger Kratz (rogerkratz)
Created Oct 8, 2018 5:05:44 PM
Updated Oct 8, 2018 5:05:44 PM
Subsystem No Subsystem
Assignee Unassigned
Priority Normal
State Submitted
Type Unspecified
Fix version No Fix versions
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions

Same problem as in Rider, reported here
https://youtrack.jetbrains.com/issue/RIDER-20422


RSRP-288085: "Implement members" does not work with QuickFix.Application interface

$
0
0
Reporter Oleg Gerovich (oleg.gerovich) Oleg Gerovich (oleg.gerovich)
Created Jan 31, 2012 2:02:05 AM
Updated Oct 8, 2018 5:06:34 PM
Resolved Oct 8, 2018 5:06:34 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Obsolete
Type Bug
Fix version Backlog
Affected versions 6.1, 7.0, 7.1.1
Fixed In Version ReSharper Undefined
VsVersion All Versions
We are using .NET FIX implementation 1.0 from http://www.quickfixengine.org.
If a C# project includes references to quickfix_net.dll and the following class is created, "implement members" does not actually insert any code.

using QuickFix;

namespace Test
{
internal class MyTest : Application // from QuickFix.Application interface
{
}
}
I clicked "implement members" fix, selected all methods in the popup and clicked Finish. No expected code was inserted into the class.

RSRP-288182: Wrong quick-fix for int/enum type conversion error in C#

$
0
0
Reporter Geoff Hart (gghart) Geoff Hart (gghart)
Created Feb 6, 2012 9:01:23 PM
Updated Oct 8, 2018 5:17:21 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Submitted
Type Feature
Fix version Backlog
Affected versions 6.1, 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
The code analysis shows the right error, but the quick-correct action is to change it to a return statement instead of add a type conversion:

namespace RlLogAnalyzer
{
internal class Test
{
private int _state;

private enum testEnum
{
A = 1,
B = 2
}

private int testValue
{
get
{
int value = 0;

if (_state == 0)
value += testEnum.B;

return value;
}
}
}
}

RSRP-288335: 'Convert part of body to Linq' could do better in this case

$
0
0
Reporter Drew Noakes (drewnoakes) Drew Noakes (drewnoakes)
Created Feb 16, 2012 12:22:32 AM
Updated Oct 8, 2018 5:24:36 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Submitted
Type Feature
Fix version Backlog
Affected versions 6.1
Fixed In Version ReSharper Undefined
VsVersion All Versions
foreach (var item in _activeBehaviors)
{
var elements = VisualTreeHelper.FindElementsInHostCoordinates(point.Position, Application.Current.RootVisual);

if (elements.Contains(item.AssociatedObject))
{
_activeBehavior = item;
_activeBehavior.OnCapture();
break;
}
}

...becomes...

foreach (var item in from item in _activeBehaviors
let elements = VisualTreeHelper.FindElementsInHostCoordinates(point.Position, Application.Current.RootVisual)
where elements.Contains(item.AssociatedObject)
select item)
{
_activeBehavior = item;
_activeBehavior.OnCapture();
break;
}

But, given that 'item' is of a reference type, this code could be simplified to:

var first = (from item in _activeBehaviors
let elements = VisualTreeHelper.FindElementsInHostCoordinates(point.Position, Application.Current.RootVisual)
where elements.Contains(item.AssociatedObject)
select item).FirstOrDefault();
if (first != null)
{
_activeBehavior = first;
_activeBehavior.OnCapture();
}

In this case, the code can actually be refactored even further into this:

var elements = VisualTreeHelper.FindElementsInHostCoordinates(point.Position, Application.Current.RootVisual);
var first = _activeBehaviors.FirstOrDefault(item => elements.Contains(item.AssociatedObject));
if (first != null)
{
_activeBehavior = first;
_activeBehavior.OnCapture();
}

But I'm not sure whether there's enough information available about side effects for R# to make this last transformation.

RSRP-471771: "x:Key attribute required" reported as error on XAML resource reference

$
0
0
Reporter Diego Ponce de Leon (xleon) Diego Ponce de Leon (xleon)
Created Sep 14, 2018 4:25:20 PM
Updated Oct 8, 2018 5:24:43 PM
Subsystem XAML
Assignee Kirill Falk (kfalk)
Priority Critical
State To Reproduce
Type Bug
Fix version No Fix versions
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions

This is not an error. It shouldn´t be a warning either. The project compiles fine. Adding a key attribute prevents the project to build correctly.
If I set the same reference without any other style inside <ContentPage.Resources>, then it works fine, as you can see on the second screenshot

Version: RD-182.4231.496
Timezone: Europe/Paris
Evaluation: false
Environment: RD-182.4231.496, JRE 1.8.0_152-release-1248-b8x64 JetBrains s.r.o, OS Windows 10(amd64) v10.0 , screens 1200x1920, 1680x1050, 3440x1440

RSRP-288344: 'Expression is always false' for comparison with certain combinations of enum flags

$
0
0
Reporter Vladimir Reshetnikov (nikov) Vladimir Reshetnikov (nikov)
Created Feb 16, 2012 5:38:08 AM
Updated Oct 8, 2018 5:27:08 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.Threading;

class C
{
static void Foo(Thread thread)
{
if(thread.ThreadState == (ThreadState.Unstarted | ThreadState.Aborted)) // Expression is always false
{
}
}
}

Probable user's intention (which can be suggested by ReSharper as a QF):

class C
{
static void Foo(Thread thread)
{
if(thread.ThreadState == ThreadState.Unstarted | thread.ThreadState == ThreadState.Aborted)
{
}
}
}

RSRP-288410: Suggest QF: Replace null with default(S) for value types

$
0
0
Reporter Vladimir Reshetnikov (nikov) Vladimir Reshetnikov (nikov)
Created Feb 20, 2012 4:55:51 AM
Updated Oct 8, 2018 5:36: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
using System;

class Program
{
static void Main()
{
Foo(null); // Suggest to replace 'null' with 'default(Guid)'
}

static void Foo(Guid x)
{

}
}

RSRP-465508: External Annotations does not work in some cases

$
0
0
Reporter Alexander Kurakin (Alexander.Kurakin) Alexander Kurakin (Alexander.Kurakin)
Created Jul 19, 2017 5:31:57 PM
Updated Oct 8, 2018 5:37:34 PM
Subsystem Code Analysis - Annotations
Assignee Maltseva Ekaterina (Maltseva.Ekaterina)
Priority Major
State Open
Type Task
Fix version 2017.3
Affected versions 2017.1.2
Fixed In Version ReSharper Undefined
VsVersion All Versions
I tried R# 2017.2 EAP and it doesn't work for me here too.
I've rather experimented and think that the problem is that I have DevEx libraries installed in GAC too. I hope that you can reproduce the issue using my previous sample with DevExpress libraries trial installed (https://www.devexpress.com/).

If I uninstall the product the sample works. While installed the problem persists even if non specific bin versions are referenced. The product bins are installed into C:\Program Files (x86)\DevExpress 17.1\Components\Bin\Framework by default where my external annotation xmls resides too.

I've tried previous R# version I used before - in 2016.3.2 the behavior is the same (wrong), but in r# 10.0.2 everything works no matter of DevEx is installed or not. I've verified this using the sample as well as my production projects.

RSRP-288427: Quick fixes "Implement Members" and "Implement Members abstract" generates redundant "unsafe" keyword for each method if class is unsafe

$
0
0
Reporter Dmitry Ivanov (daivanov) Dmitry Ivanov (daivanov)
Created Feb 20, 2012 8:12:16 PM
Updated Oct 8, 2018 5:38:39 PM
Resolved Oct 8, 2018 5:38:39 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Fixed
Type Bug
Fix version Unidentified prior version
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions
Example:
unsafe interface A {
void foo(byte* bar);
}

unsafe abstract class B : A {
}

quick fix will generate redundant "unsafe" keyword before method "foo" in class "B"

RSRP-454208: Inspect code not reporting inspections with severity level hint in inspections report

$
0
0
Reporter Alexander Kurakin (Alexander.Kurakin) Alexander Kurakin (Alexander.Kurakin)
Created Feb 20, 2016 5:58:14 PM
Updated Oct 8, 2018 5:49:20 PM
Resolved Apr 17, 2017 3:18:25 PM
Subsystem ReSharper Automation Tools (Command Line)
Assignee Slava Trenogin (derigel)
Priority Major
State Fixed
Type Bug
Fix version 2017.2
Affected versions 10.0.2
Fixed In Version ReSharper 2017.2 EAP1
VsVersion All Versions

RSRP-468136: There is no live template items in IntelliSense after typing an opening parenthesis

$
0
0
Reporter Alexander Kurakin (Alexander.Kurakin) Alexander Kurakin (Alexander.Kurakin)
Created Jan 29, 2018 7:59:21 PM
Updated Oct 8, 2018 5:51:37 PM
Subsystem Live Templates
Assignee Slava Tutushkin (slava.tutushkin)
Priority Show-stopper
State Fixed In Branch
Type Bug
Fix version 2018.3
Affected versions 2017.3.1
Fixed In Version ReSharper Undefined
VsVersion All Versions
e.g.
start typing
if(
and then any template like "hal" -> thers is nothing related to the template in autopopup.
Hit Ctrl+Space -> it appears there. Or you might hit space after an opening parenthesis and then type the name -> everything will be fine.

RSRP-469298: Component descriptor JetBrains.ReSharper.Psi.Modules.PsiModules [Singleton, Disposed] is disposed and cannot be accessed

$
0
0
Reporter Alexander Petrovsky (apetrov2) Alexander Petrovsky (apetrov2)
Created Apr 17, 2018 6:35:25 PM
Updated Oct 8, 2018 5:51:44 PM
Subsystem Live Templates
Assignee Slava Tutushkin (slava.tutushkin)
Priority Critical
State Fixed In Branch
Type Bug
Fix version No Fix versions
Affected versions 2018.1
Fixed In Version ReSharper Undefined
VsVersion All Versions
Message = “Component descriptor JetBrains.ReSharper.Psi.Modules.PsiModules [Singleton, Disposed] is disposed and cannot be accessed”
ExceptionPath = Root.Exceptions.#0.InnerException
ClassName = System.InvalidOperationException
HResult = COR_E_INVALIDOPERATION=80131509
Source = JetBrains.Platform.ComponentModel
StackTraceString = “
at JetBrains.Application.Components.SingletonDescriptor.GetValue() in C:\Build Agent\work\364305ea1b444484\Platform\Core\Shell\ComponentModel\Src\Components\Descriptors\SingletonDescriptor.cs:line 41
at JetBrains.Application.Components.ComponentContainerEx.GetComponent[TInterface](IComponentContainer container) in C:\Build Agent\work\364305ea1b444484\Platform\Core\Shell\ComponentModel\Src\Components\ComponentContainerEx.cs:line 49
at JetBrains.ReSharper.Psi.PsiSourceFileExtensions.GetPsiSourceFiles(IDocument document, ISolution solution) in C:\Build Agent\work\4d54332a870bf3eb\Psi.Features\Core\Psi\_Core\Src\PsiSourceFileExtensions.cs:line 199
at JetBrains.ReSharper.Psi.PsiSourceFileExtensions.GetPsiSourceFile(IDocument document, ISolution solution) in C:\Build Agent\work\4d54332a870bf3eb\Psi.Features\Core\Psi\_Core\Src\PsiSourceFileExtensions.cs:line 162
at JetBrains.ReSharper.Psi.Extensions.GetContext(ITextControl textControl, ISolution solution) in C:\Build Agent\work\4d54332a870bf3eb\Psi.Features\Core\Psi\_Core\Src\CompilationContextCookie.cs:line 357
at JetBrains.ReSharper.Feature.Services.LiveTemplates.Hotspots.HotspotSessionUi.<>c__DisplayClass29_0.<UpdateLookup>b__5() in C:\Build Agent\work\4d54332a870bf3eb\Psi.Features\Core\Services\_Core\Src\LiveTemplates\Hotspots\HotspotSessionUI.cs:line 294
at JetBrains.DataFlow.Lifetime.Terminate() in C:\Build Agent\work\364305ea1b444484\Platform\Core\Shell\RdCore\Src\Lifetime\Lifetime.cs:line 401

RSRP-296056: 'Copy default value from base' inserts NaN instead of double.NaN

$
0
0
Reporter Vladimir Reshetnikov (nikov) Vladimir Reshetnikov (nikov)
Created Apr 19, 2012 2:01:21 AM
Updated Oct 8, 2018 5:52:58 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 A
{
public virtual void Foo(double x = double.NaN)
{
}
}

class B : A
{
public override void Foo(double x) // Copy default value from base
{
}
}

Actual result:

class A
{
public virtual void Foo(double x = double.NaN)
{
}
}

class B : A
{
public override void Foo(double x = NaN) // error CS0103: The name 'NaN' does not exist in the current context
{
}
}

Expected:

class A
{
public virtual void Foo(double x = double.NaN)
{
}
}

class B : A
{
public override void Foo(double x = double.NaN) // OK
{
}
}
Viewing all 106942 articles
Browse latest View live


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