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

RSRP-218843: Create Method overlooks unsafe context

$
0
0
Reporter Alex Berezoutsky (fergard) Alex Berezoutsky (fergard)
Created Feb 24, 2011 1:46:18 PM
Updated Oct 15, 2018 2:48:20 PM
Resolved Oct 15, 2018 2:48:20 PM
Subsystem Quick Fixes - Create From Usage
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Duplicate
Type Bug
Fix version Backlog
Affected versions 5.1.3, 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
Create Overload works incorrectly for unsafe content:

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

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Int32[] p = new int[100];
F(p);
}

unsafe private static void F(int[] ints)
{

fixed (int* p = ints)
{
p[0] = p[1] + p[2];
F(p, 1); // method to be created
}
}

}
}
Result:
        private static void F(int* ints, int i)
        {
            throw new NotImplementedException();
        }

RSRP-471156: Create member from usage should generate unsafe method if there are unsafe parameters/return type

$
0
0
Reporter Andrey Dyatlov (Andrey.Dyatlov) Andrey Dyatlov (Andrey.Dyatlov)
Created Aug 20, 2018 2:39:00 PM
Updated Oct 15, 2018 2:48:20 PM
Subsystem Quick Fixes - Create From Usage
Assignee Andrey Dyatlov (Andrey.Dyatlov)
Priority Normal
State Submitted
Type Bug
Fix version 2018.3
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions
unsafe class C
{
private void* m_Base;

void M()
{
UnsafeUtility.Free(m_Base);
}
}

internal class UnsafeUtility
{
}

RSRP-223238: I wanna moar choices on creating symbols! (VB)

$
0
0
Reporter Egor Malyshev (megor) Egor Malyshev (megor)
Created Mar 3, 2011 9:49:16 PM
Updated Oct 15, 2018 2:50:42 PM
Subsystem Quick Fixes - Create From Usage
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
In code like this
Public Event MetaCheckCompleted(ByVal info As UrlMetaInfo)
UrlMetaInfo don't exist. When I press Alt Enter I get 2 options: create class or nested class. And I wanted to create Structure. Why it's not there?

RSRP-469035: Transition failed: Transition from state on event . Cause: System.ServiceModel.EndpointNotFoundException: There

$
0
0
Reporter David Stacey-Gee (David.Stacey-Gee) David Stacey-Gee (David.Stacey-Gee)
Created Mar 20, 2018 1:24:45 PM
Updated Oct 15, 2018 2:54:35 PM
Resolved Apr 4, 2018 9:00:12 AM
Subsystem Unit Testing
Assignee Eugene Strizhok (Eugene.Strizhok)
Priority Show-stopper
State Duplicate
Type Exception
Fix version 2018.1
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions
ReSharperPlatformVs15 Wave 12 Hive _188944d0 — JetBrains ReSharper Ultimate 2018.1 EAP 3 Build 112.0.20180317.133322-eap03

JetBrains dotCover 2018.1 EAP 3 Build 2018.1.20180317.134708-eap03
JetBrains dotMemory 2018.1 EAP 3 Build 2018.1.20180317.134710-eap03
JetBrains dotTrace 2018.1 EAP 3 Build 2018.1.20180317.134715-eap03
JetBrains ReSharper 2018.1 EAP 3 Build 2018.1.20180317.134525-eap03
JetBrains ReSharper C++ 2018.1 EAP 3 Build 2018.1.20180317.134526-eap03
JetBrains TeamCity Add-in 2018.1 EAP 3 Build 2018.1.20180317.134527-eap03

Transition failed: Transition from state <RunnerStarting> on event <local::RunnerStarted>. Cause: System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at net.pipe://mikestacey-b4a7/vstest.discoveryengine/21084 that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. —> System.IO.PipeException: The pipe endpoint 'net.pipe://mikestacey-b4a7/vstest.discoveryengine/21084' could not be found on your local machine. — End of inner exception stack trace — Server stack trace: at System.ServiceModel.Channels.PipeConnectionInitiator.GetPipeName(Uri uri, IPipeTransportFactorySettings transportFactorySettings) at System.ServiceModel.Channels.NamedPipeConnectionPoolRegistry.NamedPipeConnectionPool.GetPoolKey(EndpointAddress address, Uri via) at System.ServiceModel.Channels.CommunicationPool2.TakeConnection(EndpointAddress address, Uri via, TimeSpan timeout, TKey& key) at System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout) at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModel.Channels.ServiceChannel.ICallOnce.Call(ServiceChannel channel, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade) at System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at Microsoft.VisualStudio.TestPlatform.Core.ITestRunnerService.InitializeConnection(IEnumerable1 pathToAdditionalExtensions, Boolean loadOnlyWellKnownExtensions) at JetBrains.ReSharper.UnitTesting.MSTest.Provider.Execution.Wcf.TestRunnerServiceProxy.InitializeConnection(IEnumerable1 pathToAdditionalExtensions, Boolean loadOnlyWellKnownExtensions) at JetBrains.ReSharper.UnitTesting.MSTest.Provider.Execution.MsTestDiscoveryProtocol.<>c__DisplayClass23_0.<OpenClient>b__1(ITestRunnerService x) at JetBrains.ReSharper.UnitTesting.MSTest.Provider.Execution.Wcf.ResurrectableProxy1.WithTimeout(Action1 action) at JetBrains.ReSharper.UnitTesting.MSTest.Provider.Execution.MsTestDiscoveryProtocol.OpenClient() at Appccelerate.StateMachine.Machine.ActionHolders.ArgumentLessActionHolder.Execute(Object argument) at Appccelerate.StateMachine.Machine.States.State2.ExecuteEntryAction(IActionHolder actionHolder, ITransitionContext2 context)

--- EXCEPTION #1/1 [LoggerException]
Message = “
Transition failed: Transition from state <RunnerStarting> on event <local::RunnerStarted>.
Cause: System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at net.pipe://mikestacey-b4a7/vstest.discoveryengine/21084 that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. ---> System.IO.PipeException: The pipe endpoint 'net.pipe://mikestacey-b4a7/vstest.discoveryengine/21084' could not be found on your local machine.
--- End of inner exception stack trace ---

Server stack trace:
at System.ServiceModel.Channels.PipeConnectionInitiator.GetPipeName(Uri uri, IPipeTransportFactorySettings transportFactorySettings)
at System.ServiceModel.Channels.NamedPipeConnectionPoolRegistry.NamedPipeConnectionPool.GetPoolKey(EndpointAddress address, Uri via)
at System.ServiceModel.Channels.CommunicationPool
2.TakeConnection(EndpointAddress address, Uri via, TimeSpan timeout, TKey& key)
 at System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)
 at System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)
 at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout)
 at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
 at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
 at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
 at System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModel.Channels.ServiceChannel.ICallOnce.Call(ServiceChannel channel, TimeSpan timeout)
 at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)
 at System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpan timeout)
 at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
 at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
 at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:
 at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
 at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
 at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
 at Microsoft.VisualStudio.TestPlatform.Core.ITestRunnerService.InitializeConnection(IEnumerable`1 pathToAdditionalExtensions, Boolean loadOnlyWellKnownExtensions)
 at JetBrains.ReSharper.UnitTesting.MSTest.Provider.Execution.Wcf.TestRunnerServiceProxy.InitializeConnection(IEnumerable`1 pathToAdditionalExtensions, Boolean loadOnlyWellKnownExtensions)
 at JetBrains.ReSharper.UnitTesting.MSTest.Provider.Execution.MsTestDiscoveryProtocol.<>c__DisplayClass23_0.<OpenClient>b__1(ITestRunnerService x)
 at JetBrains.ReSharper.UnitTesting.MSTest.Provider.Execution.Wcf.ResurrectableProxy`1.WithTimeout(Action`1 action)
 at JetBrains.ReSharper.UnitTesting.MSTest.Provider.Execution.MsTestDiscoveryProtocol.OpenClient()
 at Appccelerate.StateMachine.Machine.ActionHolders.ArgumentLessActionHolder.Execute(Object argument)
 at Appccelerate.StateMachine.Machine.States.State`2.ExecuteEntryAction(IActionHolder actionHolder, ITransitionContext`2 context)

ExceptionPath = Root
ClassName = JetBrains.Util.LoggerException
Data.ManagedThreadName = <NULL>
Data.LastExtension = vb
Data.SccRevisionShell = “<there are no packages matching the criteria>”
Data.HostProductInfo = “JetBrains ReSharper Ultimate 2018.1 EAP 3 Build 112.0.20180317.133322-eap03”
Data.SubProducts.#0 = “JetBrains dotCover 2018.1 EAP 3 Build 2018.1.20180317.134708-eap03”
Data.SubProducts.#1 = “JetBrains dotTrace 2018.1 EAP 3 Build 2018.1.20180317.134715-eap03”
Data.SubProducts.#2 = “JetBrains ReSharper C++ 2018.1 EAP 3 Build 2018.1.20180317.134526-eap03”
Data.SubProducts.#3 = “JetBrains TeamCity Add-in 2018.1 EAP 3 Build 2018.1.20180317.134527-eap03”
Data.SubProducts.#4 = “JetBrains ReSharper 2018.1 EAP 3 Build 2018.1.20180317.134525-eap03”
Data.SubProducts.#5 = “JetBrains dotMemory 2018.1 EAP 3 Build 2018.1.20180317.134710-eap03”
Data.SccRevisionEnv = “
Platform\Core\Shell:
    git::refs/heads/wave12-eap3-take2

Platform\VisualStudio:
    git::refs/heads/wave12-eap3-take2::52fab4436e0faa19489e3510ea47c7a0f301d5b4

Data.VsVersion = 15.7.27512.0
Data.VsPreview = True
HResult = COR_E_APPLICATION=80131600
StackTraceString = “
 at JetBrains.ReSharper.UnitTesting.MSTest.Provider.Execution.MsTestDiscoveryProtocol.<.ctor>b__17_16(Object sender, TransitionExceptionEventArgs`2 args)
 at JetBrains.ReSharper.UnitTesting.MSTest.Provider.Execution.MsTestDiscoveryProtocol.<.ctor>b__17_16(Object sender, TransitionExceptionEventArgs`2 args)
 at Appccelerate.StateMachine.Machine.StateMachine`2.RaiseEvent[T](EventHandler`1 eventHandler, T arguments, ITransitionContext`2 context, Boolean raiseEventOnException)
 at Appccelerate.StateMachine.Machine.StateMachine`2.OnExceptionThrown(ITransitionContext`2 context, Exception exception)
 at Appccelerate.StateMachine.Machine.Contexts.TransitionContext`2.OnExceptionThrown(Exception exception)
 at Appccelerate.StateMachine.Machine.States.State`2.HandleException(Exception exception, ITransitionContext`2 context)
 at Appccelerate.StateMachine.Machine.States.State`2.HandleEntryActionException(ITransitionContext`2 context, Exception exception)
 at Appccelerate.StateMachine.Machine.States.State`2.ExecuteEntryAction(IActionHolder actionHolder, ITransitionContext`2 context)
 at Appccelerate.StateMachine.Machine.States.State`2.ExecuteEntryActions(ITransitionContext`2 context)
 at Appccelerate.StateMachine.Machine.States.State`2.Entry(ITransitionContext`2 context)
 at Appccelerate.StateMachine.Machine.Transitions.Transition`2.Fire(IState`2 source, IState`2 target, ITransitionContext`2 context)
 at Appccelerate.StateMachine.Machine.Transitions.Transition`2.Fire(ITransitionContext`2 context)
 at Appccelerate.StateMachine.Machine.States.State`2.Fire(ITransitionContext`2 context)
 at Appccelerate.StateMachine.Machine.StateMachine`2.Fire(TEvent eventId, Object eventArgument)
 at Appccelerate.StateMachine.ActiveStateMachine`2.ProcessEventQueue(CancellationToken cancellationToken)
 at Appccelerate.StateMachine.ActiveStateMachine`2.<Start>b__32_0()
 at System.Threading.Tasks.Task.InnerInvoke()
 at System.Threading.Tasks.Task.Execute()
 at System.Threading.Tasks.Task.ExecutionContextCallback(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.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
 at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)
 at System.Threading.Tasks.ThreadPoolTaskScheduler.LongRunningThreadWork(Object obj)
 at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
 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 System.Threading.ThreadHelper.ThreadStart(Object obj)

RSRP-229546: Create event from method should honor method scope (VB)

$
0
0
Reporter Egor Malyshev (megor) Egor Malyshev (megor)
Created Mar 15, 2011 5:34:08 PM
Updated Oct 15, 2018 2:55:30 PM
Subsystem Quick Fixes - Create From Usage
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
Say I have a Public method in which I put RaiseEvent SomeEvent. SomeEvent don't exist so R# offers me to create one. After event is created, it's Private, which is not convenient. I think that by default its scope should be same as method in which I raise it.

RSRP-259857: Create from usage in handles clause

$
0
0
Reporter Olga Lukianova (olka) Olga Lukianova (olka)
Created Apr 27, 2011 5:49:23 PM
Updated Oct 15, 2018 3:17:33 PM
Subsystem Quick Fixes - Create From Usage
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Open
Type Feature
Fix version Backlog
Affected versions 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
Create WithEvents field from usage and create event from usage

Public Class C
Public Sub Foo1() Handles E1{caret1}.Fo{caret2}o
End Sub
End Class

RSRP-108288: create from usage in handles statement

$
0
0
Reporter Sergey Shkredov (serjic.shkredov) Sergey Shkredov (serjic.shkredov)
Created May 19, 2009 1:25:20 PM
Updated Oct 15, 2018 3:19:03 PM
Resolved Oct 15, 2018 3:19:03 PM
Subsystem Quick Fixes - Create From Usage
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Duplicate
Type Feature
Fix version Backlog
Affected versions 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
Public Module Her

End Module


Public Class A



Dim e As A

Sub Foo() Handles e.Hoo
End Sub


Sub Gee()
Foo()
End Sub
End Class

RSRP-272395: Create Section from Usage

$
0
0
Reporter Hadi Hariri (hadihariri) Hadi Hariri (hadihariri)
Created Jun 14, 2011 9:21:32 PM
Updated Oct 15, 2018 3:35:04 PM
Subsystem Quick Fixes - Create From Usage
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State To be discussed
Type Feature
Fix version Backlog
Affected versions 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
Posssibility of doing a @section Header and having it created from usage. Need to discuss...

RSRP-53016: [QF] Create extension method

$
0
0
Reporter Sergey Kuks (coox) Sergey Kuks (coox)
Created Nov 16, 2007 8:02:08 PM
Updated Oct 15, 2018 3:42:23 PM
Subsystem Quick Fixes - Create From Usage
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
it would be nice, if it suggest to create method in one of the classes containing extension methods for current type or create a new class

RSRP-274248: Create parameter in containing method from undefined method

$
0
0
Reporter Kirill Ponimash (Kirill.Ponimash) Kirill Ponimash (Kirill.Ponimash)
Created Jul 21, 2011 4:54:47 PM
Updated Oct 15, 2018 3:47:19 PM
Subsystem Quick Fixes - Create From Usage
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
Example:

void test()
{
IEnumerable<string> t = ...;
DoWork1(t);
int i = DoWork2(t);
}

After automatic parameter creation i see:

void test(object DoWork1, object DoWork1)
...

Instead this for example:

void test(Action<IEnumerable<string>> DoWork1, Func<IEnumerable<string>, int> DoWork2)
...

RSRP-471633: False positive redundant parantheses warning with await

$
0
0
Reporter Kirill Rakhman (kirill.rakhman) Kirill Rakhman (kirill.rakhman)
Created Sep 25, 2018 10:52:50 AM
Updated Oct 15, 2018 3:48:05 PM
Resolved Oct 15, 2018 3:48:05 PM
Subsystem Code Analysis - C#
Assignee Ivan Serduk (IvanSerduk)
Priority Normal
State Fixed
Type Bug
Fix version 2018.3
Affected versions No Affected versions
Fixed In Version ReSharper Undefined
VsVersion All Versions
Version: RD-182.4231.496
Timezone: Europe/Berlin
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 1920x1080, 1920x1080

The following code triggers an inspection warning for redundant parantheses. Removing the parantheses however breaks the code.

await (bool.Parse("true") ? Task.CompletedTask : Task.FromResult(0));

RSRP-275058: AddressOf Delegated Method not created properly

$
0
0
Reporter Denis Abramov (sparky2708) Denis Abramov (sparky2708)
Created Aug 24, 2011 10:47:42 PM
Updated Oct 15, 2018 3:57:35 PM
Resolved Oct 15, 2018 3:57:35 PM
Subsystem Quick Fixes - Create From Usage
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
in Class MasterSlaveGridBehavior:
 Public Delegate Sub SQLSettingDelegate(ByVal masterGridSelectedRowIdx As Integer, ByRef filter As String)
Public Sub New(ByVal masterGrid As DataGridView, ByVal SettingSQLDelegate As SQLSettingDelegate)
...
End Sub

In some other class I typed:
Dim mslave As New MasterSlaveGridBehavior(GridDealerClrInstr, AddressOf DealerDeliveryAccountColumnJoin)

The method "DealerDeliveryAccountColumnJoin" doesn't exist in my class so I press "Alt-Enter" and select "create method". I get:

Private Sub DealerDeliveryAccountColumnJoin()
End Sub

was expecting:

Private Sub DealerDeliveryAccountColumnJoin(ByVal masterGridSelectedRowIdx As Integer, ByRef filter As String)
End Sub

RSRP-275489: Create Method produces Sub rather than Function for Implicitly Typed Variables VB.Net

$
0
0
Reporter Scott Munro (scott.munro) Scott Munro (scott.munro)
Created Sep 12, 2011 3:44:18 AM
Updated Oct 15, 2018 3:58:47 PM
Resolved Oct 15, 2018 3:58:47 PM
Subsystem Quick Fixes - Create From Usage
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
In the following code, if the 'NonexistantMethod' does not exist and I use the 'Create Method' quick-fix to generate it, the resulting method is a Sub rather than a function. The quick-fix works as expected if I explicitly type the local variable.

Dim localVariable = SomeClass.NonexistantMethod()

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 15, 2018 4:03:30 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-275738: [VB.NET] Create Class based on usage

$
0
0
Reporter Denis Abramov (sparky2708) Denis Abramov (sparky2708)
Created Sep 17, 2011 12:58:37 AM
Updated Oct 15, 2018 4:10:09 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
Suppose I have:

  Public Sub Login(ByVal dbLogin As VCDataBaseLogin)
Login(dbLogin.UserID, dbLogin.Password, dbLogin.ServerName, dbLogin.DataBaseName)
End Sub

Suppose VCDataBaseLogin doesn't exist. I would like to hit "Alt-Enter" on the line "Public Sub Login(ByVal dbLogin As VCDataBaseLogin)" and have an option to "Create class from usage" that would create VCDataBaseLogin as follows:

Public Class VCDataBaseLogin
Public Property UserID() As String
Public Property Password() As String
Public Property ServerName() As String
Public Property DataBaseName() As String
End Class

RSRP-15088: QF: Create class from usage - extended

$
0
0
Reporter Ilya Ryzhenkov (orangy) Ilya Ryzhenkov (orangy)
Created Aug 5, 2006 9:21:32 PM
Updated Oct 15, 2018 4:10:33 PM
Subsystem Quick Fixes - Create From Usage
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State To be discussed
Type Feature
Fix version Backlog
Affected versions 2018.2
Fixed In Version ReSharper Undefined
VsVersion All Versions
Consider the following code, when class Blah does not exist.
void foo(IProgress progress)
{
Blah b = new Blah();
b.Init();
b.Process(progress);
}
I would like to have a single QF, which will create class, ctor and all methods that would resolve to this class, if it were existing.
For the first time, it would be enough, if it would work in the scope of single method.

If not possible due to timeframe or resources available, please give advice how to do it myself via OpenAPI.

RSRP-283332: QF create class from usage when invoked on a .ctor should create fields/ properties assigned from .ctor parameters

$
0
0
Reporter Sergey Kuks (coox) Sergey Kuks (coox)
Created Nov 25, 2011 6:18:40 PM
Updated Oct 15, 2018 4:10:33 PM
Subsystem Quick Fixes - Create From Usage
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Submitted
Type Feature
Fix version Backlog
Affected versions 2018.2
Fixed In Version ReSharper Undefined
VsVersion All Versions
 new Foo("aaa", 23); 
class Foo {
private readonly string myS;
private readonly int myI;

public Foo (string s, int i) {
myS = s;
myI = i;
}
}

RSRP-471595: Not initialized

$
0
0
Reporter Lilia Shamsutdinova (Lilia.Shamsutdinova) Lilia Shamsutdinova (Lilia.Shamsutdinova)
Created Sep 20, 2018 6:00:31 PM
Updated Oct 15, 2018 4:13:36 PM
Subsystem Platform - Project Model
Assignee Nikita Popov (poksh)
Priority Normal
State Submitted
Type Exception
Fix version No Fix versions
Affected versions 2018.3
Fixed In Version ReSharper Undefined
VsVersion VS10 (2010)
ReSharperPlatformVs10 Wave 183 Hive ProjectModel — JetBrains ReSharper Ultimate 2018.3 EAP 1 D Build 183.0.20180918.154710-eap01d

JetBrains ReSharper 2018.3 EAP 1 D Build 2018.3.20180918.160255-eap01d

Not initialized

— EXCEPTION #1/2 [InvalidOperationException]
Message = “Not initialized”
ExceptionPath = Root.InnerException
ClassName = System.InvalidOperationException
HResult = COR_E_INVALIDOPERATION=80131509
Source = JetBrains.Platform.RdCore
StackTraceString = “
 at JetBrains.Platform.RdFramework.Util.Maybe`1.OrElseThrow(Func`1 func)
 at JetBrains.Platform.RdFramework.Util.Maybe`1.OrElseThrow(Func`1 func)
 at JetBrains.Platform.RdFramework.Util.RProperty`1.get_Value()
 at JetBrains.Platform.RdFramework.Impl.RdProperty`1.get_Value()
 at JetBrains.PsiFeatures.VisualStudio.SinceVs10.NuGet.Common.NuGetApi.get_IsNuGetAvailable()
 at JetBrains.PsiFeatures.VisualStudio.SinceVs10.NuGet.ReferenceAnnotations.ReferenceAnnotationsPackageProvider.<GetActions>d__2.MoveNext()
 at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
 at JetBrains.ReSharper.Feature.Services.QuickFixes.QuickFixTable.CreateCustomWarningActions(IHighlighting highlighting, ISolution solution, DocumentRange highlightingRange)
 at JetBrains.ReSharper.Intentions.Bulbs.QuickFixesProvider.CollectQuickFixesUnderCaret(BulbItemsCache bulbItemsCache, IntentionsBulbItems intentionsBulbItems, ITextControl textControl, HighlightingsData highlightingsData)
 at JetBrains.ReSharper.Intentions.Bulbs.QuickFixesProvider.CollectActions(IntentionsBulbItems intentionsBulbItems, BulbItemsCache bulbItemsCache, ITextControl textControl, Lifetime caretPositionLifetime, IPsiSourceFile psiSourceFile, Object precalculatedData)
 at JetBrains.ReSharper.Intentions.Bulbs.BulbItems.<>c__DisplayClass21_0.<BuildAvailableActionsList>b__1()
 at JetBrains.Application.Threading.InterruptableReadActivityThe.Work()
 at JetBrains.Application.Threading.InterruptableReadActivity.DoWork()
 at JetBrains.Application.Threading.InterruptableReadActivity.WorkerThreadProc()
 at JetBrains.Util.Logging.Logger.Catch(Action action)


— Outer —

— EXCEPTION #2/2 [LoggerException]
Message = “Not initialized”
ExceptionPath = Root
ClassName = JetBrains.Util.LoggerException
Data.ManagedThreadName = “JetPool(S) #6”
Data.SccRevisionShell = “<there are no packages matching the criteria>”
Data.HostProductInfo = “JetBrains ReSharper Ultimate 2018.3 EAP 1 D Build 183.0.20180918.154710-eap01d”
Data.SubProducts.#0 = “JetBrains ReSharper 2018.3 EAP 1 D Build 2018.3.20180918.160255-eap01d”
Data.SccRevisionEnv = “
Platform\Core\Shell:
    git::refs/heads/183-deferred-projects::f881e303bc575e4fd458361426a27fbf97c94603


Platform\VisualStudio:
    git::refs/heads/183-deferred-projects

Data.VsVersion = 10.0.40219.1
InnerException = “Exception #1 at Root.InnerException”
HResult = COR_E_APPLICATION=80131600
StackTraceString = “
 at JetBrains.Util.Logging.Logger.Catch(Action action)
 at JetBrains.Util.Logging.Logger.Catch(Action action)
 at JetBrains.Application.Threading.Tasks.TaskHostEx.<>c__DisplayClass2_0.<RunSafe>b__0()
 at JetBrains.Application.Threading.Tasks.TaskHost.AccessViolationCatcher(Action action)
 at JetBrains.Application.Threading.Tasks.TaskHost.<>c__DisplayClass33_0.<Create>b__1(Object state)
 at System.Threading.Tasks.Task.InnerInvoke()
 at System.Threading.Tasks.Task.Execute()
 at System.Threading.Tasks.Task.ExecutionContextCallback(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.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
 at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)
 at System.Threading.Tasks.TaskScheduler.TryExecuteTask(Task task)
 at JetBrains.Application.Threading.Tasks.Scheduler.JetScheduler.ExecuteTask(Task task)
 at JetBrains.Application.Threading.Tasks.Scheduler.JetSchedulerThread.EnqueueNextTask()
 at JetBrains.Application.Threading.Tasks.Scheduler.JetSchedulerThread.ThreadPoolProc()
at ANNOTATED: JetBrains.Application.Threading.Tasks.Scheduler.JetSchedulerThread #5.JetPool(S) #6(Action )
 at JetBrains.Util.Reflection.CallStackAnnotation.InvokeAnnotated(String classNameOfNewFrame, String methodNameOfNewFrame, Action actionToAnnotate)
 at JetBrains.Util.Reflection.CallStackAnnotation.CatchAnnotatedInvocation[TClassOfNewFrame](String methodNameOfNewFrame, Action actionToAnnotate)
 at JetBrains.Application.Threading.Tasks.Scheduler.JetSchedulerThread.<Start>b__20_0()
 at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
 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 System.Threading.ThreadHelper.ThreadStart()

RSRP-283370: VB.NET: Variables get created in the wrong place when using 'Create field ...'

$
0
0
Reporter Denis Abramov (sparky2708) Denis Abramov (sparky2708)
Created Nov 25, 2011 9:56:06 PM
Updated Oct 15, 2018 4:16:02 PM
Subsystem Quick Fixes - Create From Usage
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
Suppose I have in VS2010:

Public Class NoteBehavior
Implements IDisposable <Caret Here>

Public i as Integer = 1

Hit <Enter>
And Visual Studio will generate:
Public Class NoteBehavior
Implements IDisposable


Public i As Integer = 1


#Region "IDisposable Support"
Private disposedValue As Boolean ' To detect redundant calls

' IDisposable
Protected Overridable Sub Dispose(disposing As Boolean)
If Not Me.disposedValue Then
If disposing Then
' TODO: dispose managed state (managed objects).
End If

' TODO: free unmanaged resources (unmanaged objects) and override Finalize() below.
' TODO: set large fields to null.
End If
Me.disposedValue = True
End Sub

' TODO: override Finalize() only if Dispose(ByVal disposing As Boolean) above has code to free unmanaged resources.
'Protected Overrides Sub Finalize()
' ' Do not change this code. Put cleanup code in Dispose(ByVal disposing As Boolean) above.
' Dispose(False)
' MyBase.Finalize()
'End Sub

' This code added by Visual Basic to correctly implement the disposable pattern.
Public Sub Dispose() Implements IDisposable.Dispose
' Do not change this code. Put cleanup code in Dispose(ByVal disposing As Boolean) above.
Dispose(True)
GC.SuppressFinalize(Me)
End Sub
#End Region

End Class

Now create a new method called Test as follows:
Public Class NoteBehavior
Implements IDisposable


Public i As Integer = 1

Public Sub Test()
newVariable = 2
End Sub


#Region "IDisposable Support"
Private disposedValue As Boolean ' To detect redundant calls

' IDisposable
Protected Overridable Sub Dispose(disposing As Boolean)
If Not Me.disposedValue Then
If disposing Then
' TODO: dispose managed state (managed objects).
End If

' TODO: free unmanaged resources (unmanaged objects) and override Finalize() below.
' TODO: set large fields to null.
End If
Me.disposedValue = True
End Sub

' TODO: override Finalize() only if Dispose(ByVal disposing As Boolean) above has code to free unmanaged resources.
'Protected Overrides Sub Finalize()
' ' Do not change this code. Put cleanup code in Dispose(ByVal disposing As Boolean) above.
' Dispose(False)
' MyBase.Finalize()
'End Sub

' This code added by Visual Basic to correctly implement the disposable pattern.
Public Sub Dispose() Implements IDisposable.Dispose
' Do not change this code. Put cleanup code in Dispose(ByVal disposing As Boolean) above.
Dispose(True)
GC.SuppressFinalize(Me)
End Sub
#End Region

End Class


Hit <Alt-Enter> on the newVariable and select "Create field 'newVariable'" and R# generates:
Public Class NoteBehavior
Implements IDisposable


Public i As Integer = 1

Public Sub Test()
newVariable = 2
End Sub


#Region "IDisposable Support"
Private disposedValue As Boolean
Private newVariable As Integer '<-------------------------- VARIABLE SHOULD NOT BE GENERATED HERE
' To detect redundant calls

' IDisposable
Protected Overridable Sub Dispose(disposing As Boolean)
If Not Me.disposedValue Then
If disposing Then
' TODO: dispose managed state (managed objects).
End If

' TODO: free unmanaged resources (unmanaged objects) and override Finalize() below.
' TODO: set large fields to null.
End If
Me.disposedValue = True
End Sub

' TODO: override Finalize() only if Dispose(ByVal disposing As Boolean) above has code to free unmanaged resources.
'Protected Overrides Sub Finalize()
' ' Do not change this code. Put cleanup code in Dispose(ByVal disposing As Boolean) above.
' Dispose(False)
' MyBase.Finalize()
'End Sub

' This code added by Visual Basic to correctly implement the disposable pattern.
Public Sub Dispose() Implements IDisposable.Dispose
' Do not change this code. Put cleanup code in Dispose(ByVal disposing As Boolean) above.
Dispose(True)
GC.SuppressFinalize(Me)
End Sub
#End Region

End Class

BUT I EXPECT IT TO GENERATE:
Public Class NoteBehavior
Implements IDisposable


Public i As Integer = 1
Private newVariable As Integer '<-------------------------- VARIABLE SHOULD BE GENERATED HERE

Public Sub Test()
newVariable = 2
End Sub


#Region "IDisposable Support"
Private disposedValue As Boolean

' To detect redundant calls

' IDisposable
Protected Overridable Sub Dispose(disposing As Boolean)
If Not Me.disposedValue Then
If disposing Then
' TODO: dispose managed state (managed objects).
End If

' TODO: free unmanaged resources (unmanaged objects) and override Finalize() below.
' TODO: set large fields to null.
End If
Me.disposedValue = True
End Sub

' TODO: override Finalize() only if Dispose(ByVal disposing As Boolean) above has code to free unmanaged resources.
'Protected Overrides Sub Finalize()
' ' Do not change this code. Put cleanup code in Dispose(ByVal disposing As Boolean) above.
' Dispose(False)
' MyBase.Finalize()
'End Sub

' This code added by Visual Basic to correctly implement the disposable pattern.
Public Sub Dispose() Implements IDisposable.Dispose
' Do not change this code. Put cleanup code in Dispose(ByVal disposing As Boolean) above.
Dispose(True)
GC.SuppressFinalize(Me)
End Sub
#End Region

End Class

RSRP-287495: 'Create from usage' should infer base type from expected array type at usage

$
0
0
Reporter Vladimir Reshetnikov (nikov) Vladimir Reshetnikov (nikov)
Created Dec 30, 2011 1:46:42 AM
Updated Oct 15, 2018 4:17:15 PM
Subsystem Quick Fixes - Create From Usage
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Submitted
Type Bug
Fix version Backlog
Affected versions 2018.3
Fixed In Version ReSharper Undefined
VsVersion All Versions
using System;

class Program
{
static void Main()
{
Exception[] s = new MyException[] { }; // Create MyException from usage
}
}

Actual result:

using System;

class Program
{
static void Main()
{
Exception[] s = new MyException[] { }; // error CS0029: Cannot implicitly convert type 'MyException[]' to 'System.Exception[]'
}
}

internal class MyException
{
}

Expected:

using System;

class Program
{
static void Main()
{
Exception[] s = new MyException[] { }; // OK
}
}

internal class MyException : Exception
{
}
Viewing all 106942 articles
Browse latest View live


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