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

RSRP-413881: Wrong parameter names after "Create method..." is selected from intellisense popup

$
0
0
Reporter Marcin Wiśnicki (Marcin.Wiśnicki) Marcin Wiśnicki (Marcin.Wiśnicki)
Created May 2, 2014 12:14:05 AM
Updated Apr 20, 2018 5:32:18 PM
Resolved Apr 20, 2018 5:32:18 PM
Subsystem IntelliSense (Code Completion)
Assignee Andrew Serebryansky (marcus23)
Priority Normal
State Can't Reproduce
Type Bug
Fix version No Fix versions
Affected versions 8.2
Fixed In Version ReSharper Undefined
VsVersion All Versions
For example lets say I have dependency property

public static readonly DependencyProperty FooProperty = DependencyProperty.Register(
"Foo", typeof (bool), typeof (Behaviors), new PropertyMetadata(default(bool)));

Now, when I place cursors after default(bool) and type ", " an intellisense popup will appear and propose to create lambda, delegate or method for propertyChangeCallback parameter.

Unfortunately when "Create method..." is selected following code will be generated:

private static void PropertyChangedCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
{
throw new NotImplementedException();
}

whereas if I type some name, e.g. "OnFooChange" and press Alt+Enter->"Create method" I will get better code:

        private static void OnFooChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
throw new NotImplementedException();
}

This time parameter names were obtained from PropertyChangedCallback delegate definition.

I would also like to request that the generated name in the former case should be based on property name (e.g. On{Name}Changed) instead of argument name (PropertyChangedCallback) since R# is already aware of DependencyProperty pattern. Same thing with coerce callback.

Viewing all articles
Browse latest Browse all 106942

Trending Articles



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