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

RSRP-262165: 'Remove not accessed Local variable' quick-fix produces non-compilable code

$
0
0
Reporter resharper_user1 (resharper_user1) resharper_user1 (resharper_user1)
Created May 6, 2011 1:04:03 PM
Updated Oct 8, 2018 12:03:00 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
Try to remove "sqlghi"...

Public Overrides Function GenerateSQLClause(ByVal abc As String, ByVal def As String, ByVal ghi As String, ByVal jkl As String) As String

Dim sqlabc As String = ""

Dim sqlghi As String = ""

Dim sqljkl As String = ""

If abc.Length > 0 Then sqlabc = " AND ABC='" & abc & "' "

If ghi.Length > 0 Then sqlghi = " AND GHI IN(" & ghi & ") "

If Not String.IsNullOrEmpty(jkl) Then sqljkl = " AND JKL IN (" & jkl & ") " '

Return sqlabc

End Function

RSRP-304167: 'Remove unused variable' goes wrong in terms of removal and highlighting

$
0
0
Reporter Alex Berezoutsky (fergard) Alex Berezoutsky (fergard)
Created May 22, 2012 6:04:41 PM
Updated Oct 8, 2018 12:03:00 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Major
State Submitted
Type Bug
Fix version Backlog
Affected versions 7.0, 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
Steps:
1. Type in:
var variablename = new Bitmap();
2. Press Alt+Enter on 'variablename' name and select 'Remove Unused Variable'.

Result:
1. Shown on screenshot. 'new Bitmap();' is not removed, and blue highlighting stays there whatever actions are done after that.

Expected:
1. Normal work.

RSRP-263598: QFix Order on Unused Ctor Parameter

$
0
0
Reporter Serge Baltic (baltic) Serge Baltic (baltic)
Created May 12, 2011 10:31:10 PM
Updated Oct 8, 2018 12:06:33 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Submitted
Type Usability Problem
Fix version Backlog
Affected versions 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
A freshly-created ctor parameter has QFixes for adding XmlDoc for it (if there were any other documented params) and for creating a field from this param.

XmlDoc QFix has higher priority than create-field QFix. Should be the other way.

RSRP-263661: LoopCanBeConvertedToQuery should not suggest refactoring that creates .Select LINQ query when classes don't contain default constructors

$
0
0
Reporter David Keaveny (ctrlaltdel) David Keaveny (ctrlaltdel)
Created May 13, 2011 11:35:25 AM
Updated Oct 8, 2018 12:15:11 PM
Resolved Oct 8, 2018 12:15:11 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Obsolete
Type Bug
Fix version No Fix versions
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions
I have the following piece of code:

List<Contact> contacts = new List<Contact>();
foreach (Contact contact in contacts)
{
    Pushpin pushpin = new Pushpin(contact.HomeAddress.Latitude, contact.HomeAddress.Longitude, contact.ToString(), contact.HomeAddress.ToString());
    pushpins.Add(pushpin);
}

and Resharper 5.1.3000.12 is suggesting that a LoopCanBeConvertedToQuery refactoring can be applied to give me:

List<Pushpin> pushpins = contacts
.Select(contact => new Pushpin(
contact.HomeAddress.Latitude,
contact.HomeAddress.Longitude,
contact.ToString(),
contact.HomeAddress.ToString()))
.ToList();

which is the sort of refactoring that I quite like. However, there are actually two problems with this refactoring:

  1. the call to .ToString() causes the following exception when the expression is evaluated: System.NotSupportedException: LINQ to Entities does not recognize the method 'System.String ToString()' method, and this method cannot be translated into a store expression;
  2. LINQ requires that any objects being constructed in the .Select() function have default constructors. The Pushpin class that I am working with (from the MvcMaps project on Codeplex) has a default constructor, but one of its properties is a type that does not have a default constructor, and attempting to construct the object using the non-default constructor causes the following exception when the expression is evaluated: System.NotSupportedException: Only parameterless constructors and initializers are supported in LINQ to Entities;

Is it possible to add some extra smarts to the LoopCanBeConvertedToQuery evaluator to check for functions not supported by LINQ (e.g. .ToString()) and objects which do not have default constructors?

RSRP-264366: quickfix: convert int to int?

$
0
0
Reporter Clinton Sheppard (Clinton.Sheppard) Clinton Sheppard (Clinton.Sheppard)
Created May 16, 2011 8:54:41 PM
Updated Oct 8, 2018 12:16:50 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
in the following situation:

private int _maxResults;

private int MaxResults
{
get
{
if (_maxResults == null)

...


ReSharper knows the int can not be compared to null but only suggests replacing the expression with false. It should also suggest a quickfix to convert _maxResults to a nullable int.

RSRP-267121: QF 'Fix constraints' inserts an invalid constraint

$
0
0
Reporter Vladimir Reshetnikov (nikov) Vladimir Reshetnikov (nikov)
Created May 25, 2011 2:39:40 AM
Updated Oct 8, 2018 12:20:05 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.Collections;

interface I<T>
{
void Foo<S>() where S : T, IList;
}

class C : I<object>
{
public void Foo<S>() // Apply QF 'Fix constraints'
{
}
}

Actual result:

using System.Collections;

interface I<T>
{
void Foo<S>() where S : T, IList;
}

class C : I<object>
{
public void Foo<S>() where S : object, IList // error CS0702: Constraint cannot be special class 'object'
{
}
}

Expected:

using System.Collections;

interface I<T>
{
void Foo<S>() where S : T, IList;
}

class C : I<object>
{
public void Foo<S>() where S : IList // OK
{
}
}

RSRP-471495: Duplicate quick action bar

$
0
0
Reporter Maria Pleskunina (Maria.Pleskunina) Maria Pleskunina (Maria.Pleskunina)
Created Sep 13, 2018 12:43:45 PM
Updated Oct 8, 2018 12:20:34 PM
Subsystem Platform - VS Integration
Assignee Denis Korneev (Denis.Korneev)
Priority Major
State Submitted
Type Bug
Fix version No Fix versions
Affected versions 2018.2, 2018.2.1, 2018.2.2
Fixed In Version ReSharper Undefined
VsVersion All Versions

In an automatically open document in VS, two icons are displayed even if "Do not show Visual Studio bulb" is enabled.
The problem disappears after the tab is reopened.

RSRP-268224: QFix :: "Move to Corresponding Namespace": Renames to a Conflicting Name

$
0
0
Reporter Serge Baltic (baltic) Serge Baltic (baltic)
Created May 26, 2011 11:41:45 PM
Updated Oct 8, 2018 12:22:19 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
Renames into a namespace whose name is already occupied by a class.

For example see IProductNameAndVersion, its namespace is JetBrains.Application, wants to become JetBrains.Application.ApplicationDescriptor, and successfully becomes. But there is a class with such a name already, which makes the code red.

No conflict is reported by the refactoring.

RSRP-268868: Improvement to removal of redundant else and invert if optimisations for enhanced stylecop compliance.

$
0
0
Reporter Clive Chinery (tatworth) Clive Chinery (tatworth)
Created May 28, 2011 10:15:11 PM
Updated Oct 8, 2018 12:23:34 PM
Resolved Oct 8, 2018 12:23:34 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Fixed
Type Improvement
Fix version Unidentified prior version
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions
Further to http://devnet.jetbrains.net/message/5304424#5304424 and Andrew's statement "At the moment there's no way to force a blank line after an 'if' statement. ", please add the facility to specify this to ReSharper.

Re: Invert "if" statement to reduce nesting

With the block:

if (c == '\r' && this._delimiter != '\r')
{
return true;
}
else
return false;


Remove redundant else gives:

if (c == '\r' && this._delimiter != '\r')
{
return true;
}
return false;


... and what is required is one blank line after the close brace:

if (c == '\r' && this._delimiter != '\r')
{
return true;
}

return false;

RSRP-269568: Quickfix to remove commented out code

$
0
0
Reporter Hadi Hariri (hadihariri) Hadi Hariri (hadihariri)
Created May 31, 2011 3:34:12 PM
Updated Oct 8, 2018 12:24:29 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
Quick fix to remove commented out code. Relates to code cleanup

RSRP-270289: Quick fix "Use @" for "Bad compile constant value" error

$
0
0
Reporter Andrey Simanovsky (ands) Andrey Simanovsky (ands)
Created Jun 2, 2011 3:39:33 PM
Updated Oct 8, 2018 12:27:08 PM
Resolved Oct 8, 2018 12:27:08 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Fixed
Type Feature
Fix version Unidentified prior version
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions
Consider the code where "Bad compile constant value" error is shown:
CallMe("E:\Directory\cooccurrences.index");
Since the error is there an obvious quick-fix should be there too. In this particular case add "Use @" quick-fix that will add @ to the literal and, thus, make it verbatim:
CallMe(@"E:\Directory\cooccurrences.index");
This issue duplicates RSRP-2538. Well, after all this years it seems that this feature makes sense. :) It takes time to actually understand what the error is about and to navigate to the beginning of the string literal. Just pressing Alt+Enter, Enter would save time and make error correction experience smoother.

RSRP-272664: Are there annotations in R#? (VB)

$
0
0
Reporter Egor Malyshev (megor) Egor Malyshev (megor)
Created Jun 17, 2011 5:28:25 PM
Updated Oct 8, 2018 12:38:08 PM
Resolved Oct 8, 2018 12:38:08 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Fixed
Type Feature
Fix version Unidentified prior version
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions
I'd prefer them to be accessible via Alt+Enter, for example, I have a method in class that isn't used anywhere directly, and so R# highlights it as "not used". However, I may be using this method in some other way, e.g. exposing via some scripting API (like window.external.<mymethod>();). Well, I'd like one of Alt+Enter options to be extended from the currnt choice of remove or comment, with Annotate as not not used :)

RSRP-272738: Add "Annotate with PublicAPIAttribute" context action and quick fix

$
0
0
Reporter Julien Lebosquain (mrjul) Julien Lebosquain (mrjul)
Created Jun 18, 2011 5:26:00 PM
Updated Oct 8, 2018 12:54:48 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Submitted
Type Feature
Fix version Backlog
Affected versions 6.0 EAP, 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
For "Method/Property is never used" on public/protected members or "Virtual method is never overridden" code inspections it would be great to have an "Annotate with PublicAPIAttribute" quick fix.

Generally, a context action with the same effect should be available on every public or protected members.

RSRP-273174: ReSharper 5.1.3: Changing ? : to ?? results in incorrect code

$
0
0
Reporter Arno Tolmeijer (atolmeijer) Arno Tolmeijer (atolmeijer)
Created Jun 24, 2011 1:35:53 PM
Updated Oct 8, 2018 1:19:38 PM
Resolved Oct 8, 2018 1:19:38 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
According to ReSharper, the following method implementation could be rewritten using a ?? expression:

    public static class ActieDtoAssignerTest
{
public static void AssignBy( this Actie actie, ActieDto actieDto )
{
actie.Startdatum = ( actieDto.Startdatum == null ? DateTime.Today : actieDto.Startdatum );
}
}
Letting ReSharper doing its work, I get an error:

actie.Startdatum = ( actieDto.Startdatum ?? DateTime.Today );

// Error: Left operand of the ?? operator should be of reference or nullable type

The classes of the parameters are defined below:
//Left operand of the ?? operator should be of reference or nullable type

public class ActieDto
{
public DateTime Startdatum { get; set; }
}

#region Entities

/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmEntityTypeAttribute( NamespaceName = "Projects.DataModel", Name = "Actie" )]
[Serializable()]
[DataContractAttribute( IsReference = true )]
public partial class Actie : EntityObject
{

/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmScalarPropertyAttribute( EntityKeyProperty = false, IsNullable = true )]
[DataMemberAttribute()]
public Nullable<global::System.DateTime> Startdatum
{
get
{
return _Startdatum;
}
set
{
OnStartdatumChanging( value );
ReportPropertyChanging( "Startdatum" );
_Startdatum = StructuralObject.SetValidValue( value );
ReportPropertyChanged( "Startdatum" );
OnStartdatumChanged();
}
}
}
#endregion Entities

RSRP-273393: Add parameter fix is missing for attribute

$
0
0
Reporter Sergey Shkredov (serjic.shkredov) Sergey Shkredov (serjic.shkredov)
Created Jun 28, 2011 5:01:46 PM
Updated Oct 8, 2018 1:26:46 PM
Resolved Oct 8, 2018 1:26:46 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Duplicate
Type Unspecified
Fix version Backlog
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions
using System;

[FooGooLooo("sd{caret}f")]
internal class Program
{

}

internal class FooGooLoooAttribute : Attribute
{

}

RSRP-37317: Constructor of attribute with wrong number of params should have QF to create ctor

$
0
0
Reporter Ilya Ryzhenkov (orangy) Ilya Ryzhenkov (orangy)
Created Mar 17, 2007 6:50:25 PM
Updated Oct 8, 2018 1:26:46 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

RSRP-273642: Wrong name for QF: replace with method group.

$
0
0
Reporter Sergey Shkredov (serjic.shkredov) Sergey Shkredov (serjic.shkredov)
Created Jul 5, 2011 3:59:49 PM
Updated Oct 8, 2018 1:32:51 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Open
Type Cosmetics
Fix version Backlog
Affected versions 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions

RSRP-371593: Customize localization of sources downloaded from symbol server

$
0
0
Reporter Alex Berezoutsky (fergard) Alex Berezoutsky (fergard)
Created Jun 19, 2013 4:29:50 PM
Updated Oct 8, 2018 1:50:28 PM
Subsystem External Sources
Assignee Nikita Raba (nikita.raba)
Priority Critical
State Submitted
Type Feature
Fix version Backlog
Affected versions 8.0 EAP
Fixed In Version ReSharper Undefined
VsVersion All Versions
I really like ReSharpers ability to download sources for the .net library classes. It is even clever enough to get me a file that is adapted to my native language, speak, 'German'.

I guess, ReSharper retrieves my language from the Windows-Environment and then transfers it to the symbol/source server, which in response sends the localized version.

RSRP-274017: Bad Recommendation - Expression is always true - Exception.Data

$
0
0
Reporter Nigel Rheam (nij4t2) Nigel Rheam (nij4t2)
Created Jul 15, 2011 1:08:52 PM
Updated Oct 8, 2018 2:16:13 PM
Resolved Oct 8, 2018 2:16:12 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Obsolete
Type Unspecified
Fix version Backlog
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions
With the following code, the test of ex.Data gets flagged with an Expression is Always True recommendation.
catch (Exception ex)
{
string message = string.Format("Where string='{0}', Order-by='{1}' ", where, orderBy);
if (ex.Data != null) // this line gets an expression is always true recommendation
ex.Data.Add("GetPersonSearchOverviewInfo", message);

throw;
}

According to MSDN Exception.Data property page: "The ExecutionEngineException, OutOfMemoryException, StackOverflowException and ThreadAbortException classes always return null for the value of the Data property."

RSRP-274099: Delegate to Lambda Expression

$
0
0
Reporter Greg Law (lothan) Greg Law (lothan)
Created Jul 16, 2011 6:38:12 PM
Updated Oct 8, 2018 2:21:50 PM
Resolved Oct 8, 2018 2:21:50 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Obsolete
Type Bug
Fix version Backlog
Affected versions 6.0 Beta
Fixed In Version ReSharper Undefined
VsVersion All Versions
ReSharper 6.0.2202.688 is suggesting I change all delegate methods to lambda expressions in a website project targeting .NET Framework 2.0 even though lambda expressions aren't valid in this scenario.

Create a web site project targeting .NET Framework 2.0 and add this code to a web form:

List<string> list = new List<string>();
list.Sort(delegate(string x, string y) { return x.CompareTo(y); });

If you accept ReSharper's suggestion to use a lambda expression, the code compiles but throws an exception if you attempt to run or debug.
Viewing all 106942 articles
Browse latest View live


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