Skip to content

Commit 1e819c8

Browse files
authored
Merge pull request #6058 from Mo-Gul/next
chore: list annotations first (fixes #6054)
2 parents 18213d9 + 97151f9 commit 1e819c8

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

Rubberduck.Refactorings/ExtractInterface/ExtractInterfaceRefactoringAction.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ private static string InterfaceModuleBody(ExtractInterfaceModel model)
117117
var interfaceAnnotation = new InterfaceAnnotation();
118118
var interfaceAnnotationText = $"'@{interfaceAnnotation.Name}{Environment.NewLine}";
119119

120-
return $"{optionExplicit}{Environment.NewLine}{folderAnnotationText}{exposedAnnotationText}{interfaceAnnotationText}{Environment.NewLine}{interfaceMembers}";
120+
return $"{folderAnnotationText}{exposedAnnotationText}{interfaceAnnotationText}{Environment.NewLine}{optionExplicit}{Environment.NewLine}{interfaceMembers}";
121121
}
122122

123123
private static string ExposedInterfaceHeader(string interfaceName)
@@ -358,7 +358,7 @@ private static void DeleteMembers(ExtractInterfaceModel model, IRewriteSession r
358358
private static bool IsParameterlessPropertyGet(ModuleBodyElementDeclaration member)
359359
=> member.DeclarationType.Equals(DeclarationType.PropertyGet) && member.Parameters.Count == 0;
360360

361-
private static List<Declaration> SelectedDeclarations(ExtractInterfaceModel model)
361+
private static List<Declaration> SelectedDeclarations(ExtractInterfaceModel model)
362362
=> model.SelectedMembers.Select(m => m.Member).ToList();
363363

364364
private static List<Declaration> MembersWithExternalReferences(ExtractInterfaceModel model)
@@ -382,4 +382,4 @@ private static string ConstrainNewlineSequences(string content, int maxConsecuti
382382
return content;
383383
}
384384
}
385-
}
385+
}

Rubberduck.UnitTesting/CodeGeneration/TestCodeGeneratorStatics.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using Rubberduck.Resources.UnitTesting;
33

44
namespace Rubberduck.UnitTesting.CodeGeneration
@@ -116,12 +116,13 @@ End If
116116
#End If";
117117

118118
private static string TestModuleTemplate =>
119-
$@"{{0}}Option Explicit
120-
Option Private Module
121-
122-
'@TestModule
119+
$@"'@TestModule
123120
'@Folder(""{DefaultTestFolder}"")
124121
122+
{{0}}
123+
Option Explicit
124+
Option Private Module
125+
125126
{{1}}
126127
127128
'@ModuleInitialize

RubberduckTests/Refactoring/ExtractInterface/ExtractInterfaceRefactoringActionTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Linq;
44
using NUnit.Framework;
@@ -328,12 +328,12 @@ Public Sub Foo(ByVal arg1 As Integer, ByVal arg2 As String)
328328
END
329329
Attribute VB_Name = ""IClass""
330330
Attribute VB_Exposed = True
331-
Option Explicit
332-
333331
'@Folder(""MyFolder.MySubFolder"")
334332
'@Exposed
335333
'@Interface
336334
335+
Option Explicit
336+
337337
Public Sub Foo(ByVal arg1 As Integer, ByVal arg2 As String)
338338
End Sub
339339
";

0 commit comments

Comments
 (0)