Search with pattern

I use VB.Net and I want to search for this. for all the help.ShowHelp things and put those in a wrapper.

So I have something like this.

Private Sub BtnHelpClick(sender As System.Object, e As EventArgs) Handles btnHelp.Click
            Help.ShowHelp(Me, HelpFiles.AuditTables, HelpNavigator.TopicId, AudittablesContext.AuditTables)
        End Sub



And I want it turned into this.

Private Sub BtnHelpClick(sender As System.Object, e As EventArgs) Handles btnHelp.Click
            _navigation.ShowHelp(Me, HelpFiles.AuditTables, AudittablesContext.AuditTables)
        End Sub



More or less. Now I tried something like this as the searchpattern.

Help.ShowHelp($type1$, $type2$ , HelpNavigator.TopicId, $type3$)

where type1 is an expression of System.Windows.Form.Form
where type2 is an expression of System.String
where type3 is an expression of System.Object

I tried more things then I care to remember. But even this doesn't work Help.ShowHelp($type1$

When I do Help.ShowHelp( it does find that. So I think it's the expressions that don't find anything.

Any help would be grately appreciated.
7 comments
Comment actions Permalink

Hi Christian,

thanks for your report. It seems that such usage of expression placeholders is not yet properly supported. I've created request for this: http://youtrack.jetbrains.com/issue/RSRP-295315
Meanwhile, you could use argument placeholder, as Add Placeholder → Extract From Pattern suggests.

0
Comment actions Permalink

Yep that works too.

0
Comment actions Permalink

Oh wait. That is weird.

I have this pattern.

Help.ShowHelp($type1$, $type2$, HelpNavigator.TopicId, $type3$)


where type1 any number of arguments and
where type2 any number of arguments and
where type any number of arguments

And I have a replace pattern like this.

_navigation.ShowHelp($type1$, $type2$, $type3$)

Then I get this.

_navigation.ShowHelp(, Me, HelpFiles.Raman, RamanContext.Raman)

Where the original was this.

Help.ShowHelp(Me, HelpFiles.Raman, HelpNavigator.TopicId, RamanContext.Raman)

For some reason it adds an extra comma in front of the Me, and I'm pretty sure I'm not telling it to do that.

If it's a bug I will file it myself ;-) I take great pride in my issues list ;-)
0
Comment actions Permalink

Argument placeholders with unlimited constraints are not intended to be use sequentially. You need just one and everything will work.
However, this issue worth to be mentioned in issue tracker, please file it ;)

0
Comment actions Permalink

YAAAAAAAAAAAAY, it works now.

I limited them all to 1.

Cool and thanks very much. I'll file the issue.

0
Comment actions Permalink

Thank you very much!

0

Please sign in to leave a comment.