File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -33,12 +33,15 @@ public ExtractMethodModel(IActiveCodePaneEditor editor, IEnumerable<Declaration>
33
33
. ToList ( ) ;
34
34
35
35
var usedInSelection = new HashSet < Declaration > ( inScopeDeclarations . Where ( item =>
36
+ selection . Selection . Contains ( item . Selection ) &&
36
37
item . References . Any ( reference => inSelection . Contains ( reference ) ) ) ) ;
37
38
38
39
var usedBeforeSelection = new HashSet < Declaration > ( inScopeDeclarations . Where ( item =>
40
+ item . Selection . StartLine < selection . Selection . StartLine ||
39
41
item . References . Any ( reference => reference . Selection . StartLine < selection . Selection . StartLine ) ) ) ;
40
42
41
43
var usedAfterSelection = new HashSet < Declaration > ( inScopeDeclarations . Where ( item =>
44
+ item . Selection . StartLine > selection . Selection . StartLine ||
42
45
item . References . Any ( reference => reference . Selection . StartLine > selection . Selection . EndLine ) ) ) ;
43
46
44
47
// identifiers used inside selection and before selection (or if it's a parameter) are candidates for parameters:
You can’t perform that action at this time.
0 commit comments