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

RSRP-310639: [VB] 'Invert If' breaks code

$
0
0
Reporter Vladimir Reshetnikov (nikov) Vladimir Reshetnikov (nikov)
Created Jun 13, 2012 4:33:48 AM
Updated Oct 17, 2018 1:29:45 PM
Subsystem Context Actions
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
Module M
Sub Main()
If 0 <= <x/>.GetHashCode Then ' Invert If
End If
End Sub
End Module

Actual:

Module M
Sub Main()
If 0 > <x/>.GetHashCode Then ' error BC30201: Expression expected.
End If
End Sub
End Module

Expected:

Module M
Sub Main()
If 0 > (<x/>.GetHashCode) Then ' OK
End If
End Sub
End Module

RSRP-311922: Error tooltip unreadable in Dark theme

$
0
0
Reporter Igor Solomatov (sigan) Igor Solomatov (sigan)
Created Jun 16, 2012 1:31:48 PM
Updated Oct 17, 2018 1:30:37 PM
Resolved Oct 17, 2018 1:30:37 PM
Subsystem Context Actions
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Fixed
Type Usability Problem
Fix version Unidentified prior version
Affected versions 7.0
Fixed In Version ReSharper Undefined
VsVersion All Versions
Screen shot is attached to issue. The erroneous class is not correctly defined.

RSRP-312082: Add access modifier refactoring

$
0
0
Reporter Marius (geimas5) Marius (geimas5)
Created Jun 18, 2012 1:38:49 AM
Updated Oct 17, 2018 1:33:05 PM
Resolved Oct 17, 2018 1:33:05 PM
Subsystem Context Actions
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Fixed
Type Bug
Fix version Unidentified prior version
Affected versions 7.0
Fixed In Version ReSharper Undefined
VsVersion All Versions
Often you end up with code like:
int _test

void MethodName(int value)
{
_test = value;
}

But i prefer to have code with access modifiers like this because it is more explicit:

private int _test

public void MethodName(int value)
{
_test = value;
}

Currently if i want to add access modifiers i have to add them manualy by editing the code.

My suggestion is to add a refactoring to add access modifiers where it is missing. (maybe as a warning) The reason believe that having access modifiers is important is because it makes the code more explicit and the intent is more easily understood, especially for people coming from other languages where the default access modifiers might be different from C#.

RSRP-328209: Suggest to use type with the same name from another namespace

$
0
0
Reporter Guest 256 (guest256) Guest 256 (guest256)
Created Jul 24, 2012 11:40:18 PM
Updated Oct 17, 2018 1:36:21 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
This is a feature request to improve context action for suspicious type check or cast warnings.

namespace CommonNamespace
{
internal interface IFoo { }
}

namespace CorrectNamespace
{
using CommonNamespace;

internal sealed class AmbiguousClass : IFoo { }
}

namespace WrongNamespace
{
internal sealed class AmbiguousClass { }
}

namespace SomeNamespace
{
using CommonNamespace;
using WrongNamespace; // Used wrong namespace

internal static class Bar
{
public static bool Foo(IFoo foo)
{
return foo is AmbiguousClass; // suspicious cast!
}
}
}

It would be nice if R# check that exists another type with the same name which wouldn't be suspicious in current context and suggest context action “Use AmbiguousClass from CorrectNamespace instead”.

RSRP-466773: inspectcode.exe crashes with "Asking for writer lock unexpected. File changes"

$
0
0
Reporter Dmitry Tretyakov (Dmitry.Tretyakov) Dmitry Tretyakov (Dmitry.Tretyakov)
Created Oct 24, 2017 11:08:13 AM
Updated Oct 17, 2018 1:36:47 PM
Subsystem ReSharper Automation Tools (Command Line)
Assignee Alex Berezoutsky (fergard)
Priority Critical
State To Reproduce
Type Bug
Fix version 2017.3
Affected versions 2017.2
Fixed In Version ReSharper Undefined
VsVersion All Versions

Sometimes, independently of the sources to be checked, inspectcode.exe crashes:

"C:\BuildAgent\tools\jetbrains.resharper-clt.2017.2.0\inspectcode.exe" –no-swea -f=Xml -o="C:\BuildAgent\temp\buildTmp\tmp4B98.tmp" –properties=Configuration=Debug;Platform=AnyCPU -p="C:\BuildAgent\work\7919474d0b4d99a7\resharper\PACEReSharper.DotSettings" "C:\BuildAgent\work\7919474d0b4d99a7\src\CabinModules\Rules\Rules.sln"
[18:27:46][Exec] JetBrains Inspect Code 2017.2
[18:27:46][Exec] Running in 64-bit mode, .NET runtime 4.0.30319.42000 under Microsoft Windows NT 6.1.7601 Service Pack 1
[18:27:49][Exec] Custom settings layer is mounted. Used file C:\BuildAgent\work\7919474d0b4d99a7\resharper\PACEReSharper.DotSettings
[18:27:54][Exec] Disabled solution-wide analysis according to Inspect Code command line Setting.
[18:27:54][Exec] Build tool by version not found
[18:28:16][Exec] Solution-wide analysis is DISABLED
[18:28:16][Exec] Running inspections
[18:28:16][Exec] 
[18:28:16][Exec] Inspecting <RulesPlugIn>\Control\ParagraphBindableInlines.cs
[18:28:16][Exec] Asking for writer lock unexpected. File changes:
[18:28:16][Exec] 
[18:28:16][Exec] — EXCEPTION #1/1 [LoggerException]
[18:28:16][Exec] Message = "Asking for writer lock unexpected. File changes:"
[18:28:16][Exec] ExceptionPath = Root
[18:28:16][Exec] ClassName = JetBrains.Util.LoggerException
[18:28:16][Exec] HResult = COR_E_APPLICATION=80131600
[18:28:16][Exec] StackTraceString = "
[18:28:16][Exec]   bei JetBrains.CommandLine.InspectCode.Unattended.InspectCodeProductMain.<>c__DisplayClass10.<Main>b__9(Object sender, BeforeAcquiringWriteLockEventArgs args)
[18:28:16][Exec]      bei JetBrains.Application.Threading.ContentModelReadWriteLock.FireBeforeAcquiringWriteLock(BeforeAcquiringWriteLockEventArgs args)
[18:28:16][Exec]      bei JetBrains.Application.Threading.ContentModelReadWriteLock.AcquireWriteLock()
[18:28:16][Exec]      bei JetBrains.Application.Threading.IShellLocksEx.UsingWriteLock(IShellLocks locks)
[18:28:16][Exec]      bei JetBrains.ReSharper.Psi.Caches.PsiModuleAttributesCache.<>c__DisplayClass23.<>c__DisplayClass25.<QueueUpdateCaches>b__21()
[18:28:16][Exec]      bei JetBrains.Application.Threading.IShellLocksEx.ExecuteWithReadLock(IShellLocks th?s, Action F)
[18:28:16][Exec]      bei JetBrains.Threading.ReentrancyGuardEx.<>c__DisplayClass4.<>c__DisplayClass6.<Queue>b__3()
[18:28:16][Exec]      bei JetBrains.Threading.ReentrancyGuard.Execute(String name, Action action)
[18:28:16][Exec]      bei JetBrains.Threading.ReentrancyGuard.ExecutePendingActions()
[18:28:16][Exec]      bei JetBrains.Threading.JetDispatcher.Closure.Execute()
[18:28:16][Exec]      bei JetBrains.Util.Concurrency.WinJetDispatcher.ProcessQueue(Int32 nMinBucket)
[18:28:16][Exec]      bei System.Windows.Threading.DispatcherOperation.InvokeDelegateCore()
[18:28:16][Exec]      bei System.Windows.Threading.DispatcherOperation.InvokeImpl()
[18:28:16][Exec]      bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
[18:28:16][Exec]      bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
[18:28:16][Exec]      bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
[18:28:16][Exec]      bei MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
[18:28:16][Exec]      bei System.Windows.Threading.DispatcherOperation.Invoke()
[18:28:16][Exec]      bei System.Windows.Threading.Dispatcher.ProcessQueue()
[18:28:16][Exec]      bei System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
[18:28:16][Exec]      bei MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
[18:28:16][Exec]      bei MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
[18:28:16][Exec]      bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
[18:28:16][Exec]      bei System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
[18:28:16][Exec]      bei System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
[18:28:16][Exec]      bei MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
[18:28:16][Exec]      bei JetBrains.Interop.WinApi.User32Dll.DispatchMessageW(MSG* lpmsg)
[18:28:16][Exec]      bei JetBrains.Interop.WinApi.User32Dll.DispatchMessageW(MSG* lpmsg)
[18:28:16][Exec]      bei JetBrains.Util.Concurrency.WinJetDispatcher.WinJetDispatcherStaticMethods.InternalPumpMessagesOnce()
[18:28:16][Exec]      bei JetBrains.Util.Concurrency.WinJetDispatcher.WinJetDispatcherStaticMethods.JetBrains.Util.Concurrency.IJetDispatcherStaticMethods.Run(Func1 condition, TimeSpan timeout, Boolean bThrowOnTimeout)
[18:28:16][Exec]      bei JetBrains.CommandLine.InspectCode.Unattended.InspectCodeRunner.RunInspectionsInSeparateThread(ICollection1 files, Action1 issueConsumer)
[18:28:16][Exec]      bei JetBrains.CommandLine.InspectCode.Unattended.InspectCodeRunner.Run(IEnumerable1 inspectScope, IProjectFile[] files, InspectCodeOutputFormat format, Boolean useAbsolutePaths, FileSystemPath outputFile)
[18:28:16][Exec]      bei JetBrains.CommandLine.InspectCode.Unattended.InspectCodeProductMain.Main(Lifetime lifetime, IThreading invocator, IComponentContainer container, IShellLocks shellLocks, ILogger logger, IInspectCodeSettings settings, IProductCommandLineArguments argumentsRaw)
[18:28:16][Exec]      bei System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
[18:28:16][Exec]      bei System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
[18:28:16][Exec]      bei System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
[18:28:16][Exec]      bei JetBrains.Application.Environment.RunsPublicStaticIntMain.<>c__DisplayClass4.<.ctor>b__0()
[18:28:16][Exec]      bei JetBrains.Util.Logging.Logger.Catch(Action action)
[18:28:16][Exec]      bei JetBrains.Threading.JetDispatcher.Closure.Execute()
[18:28:16][Exec]      bei JetBrains.Util.Concurrency.WinJetDispatcher.ProcessQueue(Int32 nMinBucket)
[18:28:16][Exec]      bei System.Windows.Threading.DispatcherOperation.InvokeDelegateCore()
[18:28:16][Exec]      bei System.Windows.Threading.DispatcherOperation.InvokeImpl()
[18:28:16][Exec]      bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
[18:28:16][Exec]      bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
[18:28:16][Exec]      bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
[18:28:16][Exec]      bei MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
[18:28:16][Exec]      bei System.Windows.Threading.DispatcherOperation.Invoke()
[18:28:16][Exec]      bei System.Windows.Threading.Dispatcher.ProcessQueue()
[18:28:16][Exec]      bei System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
[18:28:16][Exec]      bei MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
[18:28:16][Exec]      bei MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
[18:28:16][Exec]      bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
[18:28:16][Exec]      bei System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
[18:28:16][Exec]      bei System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
[18:28:16][Exec]      bei MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
[18:28:16][Exec]      bei MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
[18:28:16][Exec]      bei MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
[18:28:16][Exec]      bei System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
[18:28:16][Exec]      bei JetBrains.DataFlow.Lifetimes.Using(Action`1 ?)
[18:28:16][Exec]      bei JetBrains.Application.Environment.IJetHostEx.RunHostMessageLoop(IComponentContainer containerEnv)
[18:28:16][Exec]      bei JetBrains.Application.Environment.HostParameters.JetHostParametersCaller.RunMainLoop(ComponentContainer containerEnv)
[18:28:16][Exec]      bei JetBrains.Application.Environment.JetEnvironment.InternalRun(JetHostParametersCaller host, ComponentContainer containerEnv)
[18:28:16][Exec]      bei JetBrains.Application.Environment.JetEnvironment.CreateAndRun(Full hostparams)
[18:28:16][Exec]      bei JetBrains.CommandLine.Common.Console.Application.CommandLineProgram.Main(Assembly assembly, Type environmentZoneType, HostInfo hostInfo, IProductInfo productInfo, String[] args)
[18:28:16][Exec]      bei JetBrains.CommandLine.Common.Console.Application.CommandLineProgram.Run[TZone,TProductInfo](String productHostShortName, String[] args)
[18:28:16][Exec]      bei JetBrains.CommandLine.InspectCode.InspectCodeProgram.Main(String[] args)

RSRP-328675: New refactoring: Cache calculated readonly property value

$
0
0
Reporter Drew Noakes (drewnoakes) Drew Noakes (drewnoakes)
Created Jul 30, 2012 12:17:50 AM
Updated Oct 17, 2018 2:22:46 PM
Subsystem Context Actions
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Submitted
Type Feature
Fix version Backlog
Affected versions 7.0, 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
Here's a readonly property I calculate per call at the moment.

public string[] AlternateNames
{
get { return Some.Costly().Expression(); }
}

I would like to cache the calculated value, as the parent is short lived (for gen 0 collection), but the value is calculated more than once in that short lifetime.

private string[] _value;

public string[] Value
{
get { _value ?? (_value = Some.Costly().Expression(); }
}

I tried to do this with SSR, but found it wasn't possible (or I just don't know how to do it). Copying property modifiers, attributes and ensuring the expression was a reference type didn't seem possible.

I suppose the refactoring is more complex if the original getter was more complex than a single expression, and even moreso if it had multiple exit points, especially if nested in complex control strucutes. But for a simple expression, it should be ok.

I personally think it would be useful :)

RSRP-329159: Convert method group to lambda bug

$
0
0
Reporter Alexander Shvedov (shvedov) Alexander Shvedov (shvedov)
Created Aug 11, 2012 7:17:34 PM
Updated Oct 17, 2018 2:24:40 PM
Subsystem Context Actions
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Submitted
Type Bug
Fix version Backlog
Affected versions 7.0, 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
Action breaks code behavior:

RSRP-329256: Context action classes do not support constructor injection

$
0
0
Reporter Matt Ellis (citizenmatt) Matt Ellis (citizenmatt)
Created Aug 16, 2012 6:07:32 PM
Updated Oct 17, 2018 2:25:46 PM
Subsystem Context Actions
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Open
Type Task
Fix version Backlog
Affected versions 6.1, 7.0
Fixed In Version ReSharper Undefined
VsVersion All Versions
Context action classes are required to have a single constructor parameter, and cannot receive dependencies in the constructor. So, if a context action wants to use e.g. LiveTemplatesManager, it must either use the obsolete LiveTemplatesManager.Instance, or use the Shell.Instance.GetComponent<>() method.

Alternatively, a plugin author can create a ContextActionDataBuilder class that is called to create the parameter. This class can have constructor injection, but since it's a ShellComponent, it can only receive injected ShellComponents. SolutionComponents must still be retrieved with the solution.GetComponent<>() extension method.

Can context actions support constructor injection in a future version?

RSRP-329655: Bug in Implement interface members in a mixed C# / VB solution

$
0
0
Reporter Andreas Seibt (luedi) Andreas Seibt (luedi)
Created Aug 31, 2012 7:58:08 PM
Updated Oct 17, 2018 2:27:50 PM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Submitted
Type Bug
Fix version Backlog
Affected versions 7.0.1, 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
I'm working on a solution which contains VB and C# projects. In a C# project i defined an interface which i use in a VB project. When i use the "Implement members" quickfix and select "Copy XML comments", the C# comments are copied to the VB file without changing the comment marker from "///" to "'''". See attached solution.

RSRP-471742: Incorrect 'expression is always true' on null check

$
0
0
Reporter Justin Davis (jdphenix) Justin Davis (jdphenix)
Created Oct 3, 2018 8:59:27 PM
Updated Oct 17, 2018 2:32:14 PM
Resolved Oct 17, 2018 2:32:14 PM
Subsystem Code Analysis - Control Flow
Assignee Andrey Dyatlov (Andrey.Dyatlov)
Priority Major
State Fixed
Type Bug
Fix version 2018.3
Affected versions Unidentified prior version, 2018.2.3
Fixed In Version ReSharper Undefined
VsVersion VS 2017 15.6

Consider the following program,

class Foo
{
    public string Score { get; set; }
}

class Program
{
    static Foo GetFoo(int x) => x < 0 ? null : new Foo {Score = x > 100 ? $"{x}": "^"};

    static void Main(string[] args)
    {
        Console.WriteLine("Hello World!");

        var foo = GetFoo(-2);

        switch (foo?.Score)
        {
            case string s when int.TryParse(s, out _):
                Console.WriteLine("Score exists");
                break;
            case null:
                break;
        }

        if (!int.TryParse(foo?.Score, out _))
        {
            Console.WriteLine(foo.Score);
        }
    }
}

When executed, a NullReferenceException is thrown on Console.WriteLine(foo.Score), because foo is null.

When the if is modified to

if (foo != null && !int.TryParse(foo?.Score, out _))

ReSharper 2018.2.3 reports that foo != null is always true, but it clearly isn't.

RSRP-471125: Extend selection on start of string interpolation expression select the whole string instead of single expression

$
0
0
Reporter Alexander Ulitin (alexander.ulitin) Alexander Ulitin (alexander.ulitin)
Created Aug 17, 2018 4:08:58 PM
Updated Oct 17, 2018 2:33:35 PM
Resolved Oct 17, 2018 2:33:35 PM
Subsystem Extend_Shrink Selection
Assignee Andrey Dyatlov (Andrey.Dyatlov)
Priority Critical
State Fixed
Type Bug
Fix version 2018.3
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions

sample to reproduce:

Console.WriteLine($"Something {|CARET|Console.BackgroundColor}");

sample

RSRP-451491: string interpolation extend selection

$
0
0
Reporter Andreas (soulfury) Andreas (soulfury)
Created Dec 2, 2015 12:32:37 AM
Updated Oct 17, 2018 2:34:28 PM
Resolved Oct 17, 2018 2:34:28 PM
Subsystem Extend_Shrink Selection
Assignee Andrey Dyatlov (Andrey.Dyatlov)
Priority Normal
State Fixed
Type Bug
Fix version 2018.3
Affected versions 10.0.1
Fixed In Version ReSharper Undefined
VsVersion All Versions
Hi.

I'll illustrate where i think extend selection is misbehaving.

I've flagged this as bug, because extend selection seems to be aware of string interpolation in general, depending on where the carret is sitting at the time of executing it, while being overly greedy in other cases.

CURRENT BEHAVIOR:

starting point:
return $"{E{caret}nvironment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)}/Crawler/";

current extend x4 (this is the selection i desire, so in general extend selection seems to be aware of string interpolation scopes)
return $"{selstart}{E{caret}nvironment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)}{selend}/Crawler/"
;

starting point:
return $"{{caret}Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)}/Crawler/";

current extend x1 (extends too much)
return $"{selstart}{Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)}/Crawler/{selend}{caret}";

starting point:
return $"{caret}{Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)}/Crawler/";

current extend x1 (does not extend the way i would expect it to)
return $"{selstart}{Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)}/Crawler/{selend}{caret}";

EXPECTED / CONVENIENT BEHAVIOR

starting point:
return $"{{caret}Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)}/Crawler/";

current extend x1
return $"{{selstart}Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData){selend}{caret}}/Crawler/";
current extend x2
return $"{selstart}{Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)}{selend}{caret}/Crawler/";

starting point:
return $"{caret}{Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)}/Crawler/";

current extend x1
return $"{selstart}{Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)}{selend}{caret}/Crawler/";
current extend x2
return $"{selstart}{Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)}/Crawler/{selend}{caret}";

This could be a nice time saver when working with extend selection.

RSRP-471867: Double icon for Formatter if it opens to upside

$
0
0
Reporter Maltseva Ekaterina (Maltseva.Ekaterina) Maltseva Ekaterina (Maltseva.Ekaterina)
Created Oct 16, 2018 6:07:00 PM
Updated Oct 17, 2018 2:34:35 PM
Subsystem UI
Assignee Denis Korneev (Denis.Korneev)
Priority Major
State Submitted
Type Usability Problem
Fix version 2018.3
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions
Select C# code - click on the Formatter button - you'll see two icons of it

RSRP-329736: "Convert to ??" simple improvement

$
0
0
Reporter Alexander Shvedov (shvedov) Alexander Shvedov (shvedov)
Created Sep 4, 2012 7:23:12 PM
Updated Oct 17, 2018 2:35:37 PM
Resolved Oct 17, 2018 2:35:36 PM
Subsystem Context Actions
Assignee Alisa Afonina (alisa.afonina)
Priority Minor
State Fixed
Type Feature
Fix version Unidentified prior version
Affected versions 7.0.1
Fixed In Version ReSharper Undefined
VsVersion All Versions
Just like "Convert to ternary operator" doing some optimizations when executing, "Convert to ??" may do better job:


Also do not forget about reversed case.

RSRP-471508: CA to convert null coalescing operator to if statement

$
0
0
Reporter Andrey Dyatlov (Andrey.Dyatlov) Andrey Dyatlov (Andrey.Dyatlov)
Created Sep 14, 2018 6:52:59 PM
Updated Oct 17, 2018 2:36:42 PM
Resolved Oct 17, 2018 2:32:46 PM
Subsystem Context Actions
Assignee Andrey Dyatlov (Andrey.Dyatlov)
Priority Normal
State Fixed
Type Feature
Fix version 2018.3
Affected versions No Affected versions
Fixed In Version ReSharper 2018.3 EAP 4
VsVersion All Versions
I have the following line:
var something = GetSomething() ?? myDefaultValueSerivce.CreateValue<ISomething>();

however if I want to change the fallback path to more complicated code that cannot be fit into a single expression I can't easily transform it with ReSharper to the following form:

var something = GetSomething();
if (something == null)
{
something = myDefaultValueSerivce.CreateValue<ISomething>();
}

A possible workaround in form of To conditional expression -> Convert to if statement CA combination is not always available and produces much more cumbersome version:

ISomething something;
if (GetSomething() != null)
something = GetSomething();
else
something = myDefaultValueSerivce.CreateValue<ISomething>();

Note that the suggested transformation will be invalid in case it's not the first expression in statement or if the inferred type will change and the desired type can't be used explicitly.

RSRP-470793: Object reference not set to an instance of an object.

$
0
0
Reporter ReSharper anonymous (resharper) ReSharper anonymous (resharper)
Created Jul 6, 2018 8:06:46 AM
Updated Oct 17, 2018 2:44:23 PM
Subsystem Debugger features
Assignee Alexander Ulitin (alexander.ulitin)
Priority Normal
State Submitted
Type Exception
Fix version No Fix versions
Affected versions 2018.2
Fixed In Version ReSharper Undefined
VsVersion All Versions
ReSharperPlatformVs14 Wave 182 — JetBrains ReSharper Ultimate 2018.2 EAP 1 Build 182.0.20180628.124316-eap01

JetBrains dotMemory 182 Build 182.0.20180628.132247-eap01
JetBrains dotTrace 182 Build 182.0.20180628.132215-eap01
JetBrains ReSharper 182 Build 182.0.20180628.125556-eap01

Object reference not set to an instance of an object.

— EXCEPTION #1/2 [NullReferenceException]
Message = “Object reference not set to an instance of an object.”
ExceptionPath = Root.InnerException
ClassName = System.NullReferenceException
HResult = E_POINTER=COR_E_NULLREFERENCE=80004003
Source = JetBrains.PsiFeatures.VisualStudio.Debugger
StackTraceString = “
 at JetBrains.PsiFeatures.VisualStudio.Debugger.Breakpoints.VsBreakpointsSynchronizer.Synchronize()
 at JetBrains.PsiFeatures.VisualStudio.Debugger.Breakpoints.VsBreakpointsSynchronizer.Synchronize()
 at JetBrains.PsiFeatures.VisualStudio.Debugger.Breakpoints.VsBreakpointsSynchronizer.<.ctor>b__26_0()
 at JetBrains.DataFlow.ISignalEx.<>c__DisplayClass0_0`1.<Advise>b__0(TValue value)
 at JetBrains.DataFlow.Signal`1.NotifySinks(TValue payload)


— Outer —

— EXCEPTION #2/2 [LoggerException]
Message = “Object reference not set to an instance of an object.”
ExceptionPath = Root
ClassName = JetBrains.Util.LoggerException
Data.ManagedThreadName = <NULL>
Data.SccRevisionShell = “<there are no packages matching the criteria>”
Data.HostProductInfo = “JetBrains ReSharper Ultimate 2018.2 EAP 1 Build 182.0.20180628.124316-eap01”
Data.SubProducts.#0 = “JetBrains dotTrace 182 Build 182.0.20180628.132215-eap01”
Data.SubProducts.#1 = “JetBrains ReSharper 182 Build 182.0.20180628.125556-eap01”
Data.SubProducts.#2 = “JetBrains dotMemory 182 Build 182.0.20180628.132247-eap01”
Data.SccRevisionEnv = “
Platform\Core\Shell:
    git::refs/heads/182-eap1::389b2b0a5d2b33c46224f8f1850bc61276990d1e


Platform\VisualStudio:
    git::refs/heads/182-eap1

Data.VsVersion = 14.0.25431.1
InnerException = “Exception #1 at Root.InnerException”
HResult = COR_E_APPLICATION=80131600
StackTraceString = “
 at JetBrains.DataFlow.Signal`1.NotifySinks(TValue payload)
 at JetBrains.DataFlow.Signal`1.NotifySinks(TValue payload)
 at JetBrains.DataFlow.Signal`1.Fire(TValue value, Object cookie)
 at JetBrains.Threading.GroupingEvent.Execute()
 at JetBrains.Threading.GroupingEventHost.ExecuteExpiredEvents()
 at JetBrains.Threading.GroupingEventHost.<OnClockTimerTick>b__22_0()
 at JetBrains.Threading.ReentrancyGuard.Execute(String name, Action action)
 at JetBrains.Threading.ReentrancyGuard.ExecuteOrQueue(String name, Action action, TaskPriority priority)
 at JetBrains.Threading.GroupingEventHost.OnClockTimerTick()
 at JetBrains.Threading.GroupingEventHost.ClockTimer.OnTimerTick(Object sender, EventArgs e)
 at System.Windows.Forms.Timer.OnTick(EventArgs e)
 at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
 at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

RSRP-329737: Surround With feature available via context action should be context sensitive

$
0
0
Reporter Sergey Shkredov (serjic.shkredov) Sergey Shkredov (serjic.shkredov)
Created Sep 4, 2012 10:20:51 PM
Updated Oct 17, 2018 2:44:36 PM
Resolved Oct 17, 2018 2:44:36 PM
Subsystem Context Actions
Assignee Alisa Afonina (alisa.afonina)
Priority Major
State Fixed
Type Feature
Fix version Unidentified prior version
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions
  • For selected expression:
    • Cast
    • ()
  • For statements:
    • if
    • {}

RSRP-452771: TypeScript: Incorrect "Qualifier can be 'null' or 'undefined'." Warning

$
0
0
Reporter Kevin Watkins (MrKWatkins) Kevin Watkins (MrKWatkins)
Created Jan 8, 2016 6:00:19 PM
Updated Oct 17, 2018 2:45:57 PM
Subsystem TypeScript
Assignee Nikita Popov (poksh)
Priority Critical
State Submitted
Type Bug
Fix version Backlog
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions
ReSharper 10.0.2.

class Something
{
public id: number;
}

function doSomething(x: Something, y: Something)
{
if (x == null && y == null)
{
throw "Must specify x or y.";
}

if (x != null)
{
alert(x.id);
}
else
{
alert(y.id);
}
}

The "Qualifier can be 'null' or 'undefined'" warning is given over the y in alert(y.id), however it cannot be null/undefined - at this point we know x is null/undefined, so if y was also null/undefined the throw earlier on would've been hit instead.

RSRP-471829: reviewing web.config and error thrown

$
0
0
Reporter Ewin Hong (minoseah629) Ewin Hong (minoseah629)
Created Oct 12, 2018 8:06:51 PM
Updated Oct 17, 2018 2:48:16 PM
Subsystem Quick Documentation Info
Assignee Slava Trenogin (derigel)
Priority Normal
State Submitted
Type Exception
Fix version 2018.3
Affected versions 2018.3
Fixed In Version ReSharper Undefined
VsVersion VS 2017 15.6

ReSharper – Runtime Error – Technical Data

JetBrains ReSharper has encountered a runtime error.
Technical data follows.
Hint: Ctrl+C copies the text of system message boxes to Clipboard.


Object reference not set to an instance of an object.

--- EXCEPTION #1/2 [NullReferenceException]

Message = “Object reference not set to an instance of an object.”

ExceptionPath = Root.InnerException

ClassName = System.NullReferenceException

Data.ReentrancyGuard.ActionName = GetHighlighters

HResult = E_POINTER=COR_E_NULLREFERENCE=80004003

Source = JetBrains.Platform.ComponentModel

StackTraceString = “

at JetBrains.Application.Components.ComponentStorage.<EnumerateDescriptors>d__17`1.MoveNext()

 at JetBrains.Application.Components.EnumerableValueResolver.EnumerableComponentDescriptor`1.<GetEnumerator>d__5.MoveNext()

 at JetBrains.PsiFeatures.VisualStudio.SinceVs10.TextControl.Intellisense.VsQuickInfoComponentSinceVs10.<>c__DisplayClass9_0.<GetContent>b__0()

 at JetBrains.Threading.ReentrancyGuard.Execute(String name, Action action)

--- Outer ---

--- EXCEPTION #2/2 [LoggerException]

Message = “Object reference not set to an instance of an object.”

ExceptionPath = Root

ClassName = JetBrains.Util.LoggerException

Data.ManagedThreadName = <NULL>

InnerException = “Exception #1 at Root.InnerException”

HResult = COR_E_APPLICATION=80131600

StackTraceString = “

at JetBrains.Threading.ReentrancyGuard.Execute(String name, Action action)

 at JetBrains.Threading.ReentrancyGuard.TryExecute(String name, Action action)

 at JetBrains.PsiFeatures.VisualStudio.SinceVs10.TextControl.Intellisense.VsQuickInfoComponentSinceVs10.GetContent(Lifetime sessionLifetime, ITextBuffer textBuffer, IQuickInfoSession session, ITextControl textControl)

 at JetBrains.PsiFeatures.VisualStudio.SinceVs10.TextControl.Intellisense.MEF.VsQuickInfoSourcePreviewSinceVs14.<>c__DisplayClass2_1.<Microsoft.VisualStudio.Language.Intellisense.IQuickInfoSource.AugmentQuickInfoSession>b__1()

 at JetBrains.PsiFeatures.VisualStudio.SinceVs10.TextControl.Intellisense.MEF.VsQuickInfoSourceSinceVs10.GetOrCreateQuickInfoData(IQuickInfoSession session, Func`1 creator)

 at JetBrains.PsiFeatures.VisualStudio.SinceVs10.TextControl.Intellisense.MEF.VsQuickInfoSourcePreviewSinceVs14.<>c__DisplayClass2_0.<Microsoft.VisualStudio.Language.Intellisense.IQuickInfoSource.AugmentQuickInfoSession>b__0()

 at JetBrains.Util.Logging.Logger.Catch[TValue](Func`1 func)

 at JetBrains.PsiFeatures.VisualStudio.SinceVs10.TextControl.Intellisense.MEF.VsQuickInfoSourcePreviewSinceVs14.Microsoft.VisualStudio.Language.Intellisense.IQuickInfoSource.AugmentQuickInfoSession(IQuickInfoSession session, IList`1 sessionItems, ITrackingSpan& applicableToSpan)

 at Microsoft.VisualStudio.Language.Intellisense.Implementation.LegacyQuickInfoSource.AugmentQuickInfoSession(IAsyncQuickInfoSession session, IList`1 content, ITrackingSpan& applicableToSpan)

 at Microsoft.VisualStudio.Language.Intellisense.Implementation.AsyncQuickInfoSession.<TryComputeContentFromLegacySourceAsync>d__46.MoveNext()

 at System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.InvokeMoveNext(Object stateMachine)

 at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

 at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

 at System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run()

 at Microsoft.VisualStudio.Threading.JoinableTaskFactory.SingleExecuteProtector.TryExecute()

 at Microsoft.VisualStudio.Threading.JoinableTaskFactory.SingleExecuteProtector.<>c.<.cctor>b__20_0(Object state)

 at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)

 at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

 at System.Windows.Threading.DispatcherOperation.InvokeImpl()

 at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)

 at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)

 at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

 at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

 at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

 at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)

 at System.Windows.Threading.DispatcherOperation.Invoke()

 at System.Windows.Threading.Dispatcher.ProcessQueue()

 at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)

 at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)

 at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)

 at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)

 at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

 at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)

 at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)


OK

RSRP-471828: Used Visual Studio shortcut to suspend resharper got this error

$
0
0
Reporter Ewin Hong (minoseah629) Ewin Hong (minoseah629)
Created Oct 12, 2018 8:04:47 PM
Updated Oct 17, 2018 2:48:34 PM
Subsystem Platform - VS Integration
Assignee Denis Korneev (Denis.Korneev)
Priority Show-stopper
State Submitted
Type Exception
Fix version 2018.3
Affected versions 2018.3
Fixed In Version ReSharper Undefined
VsVersion VS 2017 15.6

maybe be related to https://youtrack.jetbrains.com/issue/RSRP-471626


ReSharper – Runtime Error – Technical Data

JetBrains ReSharper has encountered a runtime error.
Technical data follows.
Hint: Ctrl+C copies the text of system message boxes to Clipboard.


The lifetime has already been terminated. Object name: 'Lifetime'.

--- EXCEPTION #1/2 [ObjectDisposedException]

Message = “The lifetime has already been terminated.”

ExceptionPath = Root.InnerException

ClassName = System.ObjectDisposedException

HResult = COR_E_OBJECTDISPOSED=80131622

Source = JetBrains.Platform.RdCore

ObjectName = Lifetime

StackTraceString = “

at JetBrains.DataFlow.Lifetime.ReportTerminatedLifetime(String sAnotherLifetimeRelation)

 at JetBrains.DataFlow.Lifetime.AttachNested(LifetimeDefinition defNested, Boolean isPossiblyAlreadyTerminated)

 at JetBrains.DataFlow.Lifetimes.CreateIntersection2(ILog logger, Lifetime[] lifetimes)

 at JetBrains.Util.Concurrency.UnguardedCallbackMerger.ExecuteOrQueueOrMerge(Lifetime lifetimeQueue, String name, Action F)

 at JetBrains.VsIntegration.TextControl.VsTextControlCommon.SyncToVsUnguarded()

 at JetBrains.Platform.VisualStudio.SinceVs10.TextControl.VsTextControlScrollingDevTen.<>c__DisplayClass7_0.<InitEvents>b__0(Object sender, EventArgs args)

 at System.EventHandler.Invoke(Object sender, EventArgs e)

 at Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.OnSizeChanged(Object sender, SizeChangedEventArgs e)

 at System.Windows.SizeChangedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)

 at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)

 at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)

 at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)

 at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)

 at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)

 at System.Windows.FrameworkElement.OnRenderSizeChanged(SizeChangedInfo sizeInfo)

 at System.Windows.ContextLayoutManager.fireSizeChangedEvents()

 at System.Windows.ContextLayoutManager.UpdateLayout()

 at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)

 at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()

 at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()

 at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)

 at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)

 at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)

 at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

--- Outer ---

--- EXCEPTION #2/2 [LoggerException]

Message = “

The lifetime has already been terminated.

Object name: 'Lifetime'.

ExceptionPath = Root

ClassName = JetBrains.Util.LoggerException

Data.ManagedThreadName = <NULL>

InnerException = “Exception #1 at Root.InnerException”

HResult = COR_E_APPLICATION=80131600

StackTraceString = “

at JetBrains.Application.Environment.HostParameters.InitStdWindowsAppFxHostMixin.<>c__DisplayClass0_0.<JetBrains.Application.Environment.HostParameters.IInitAppHostMixin.InitHost>b__0(Object sender, DispatcherUnhandledExceptionEventArgs args)

 at System.Windows.Threading.DispatcherUnhandledExceptionEventHandler.Invoke(Object sender, DispatcherUnhandledExceptionEventArgs e)

 at System.Windows.Threading.Dispatcher.CatchException(Exception e)

 at System.Windows.Threading.Dispatcher.CatchExceptionStatic(Object source, Exception e)

 at System.Windows.Threading.ExceptionWrapper.CatchException(Object source, Exception e, Delegate catchHandler)

 at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

 at System.Windows.Threading.DispatcherOperation.InvokeImpl()

 at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)

 at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)

 at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

 at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

 at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

 at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)

 at System.Windows.Threading.DispatcherOperation.Invoke()

 at System.Windows.Threading.Dispatcher.ProcessQueue()

 at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)

 at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)

 at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)

 at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)

 at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

 at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)

 at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)


OK

Viewing all 106942 articles
Browse latest View live


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