Skip to content

Commit 1eda58b

Browse files
committed
Resolve Issue #3393
1 parent d9ac266 commit 1eda58b

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

RetailCoder.VBE/UI/CodeExplorer/Commands/AddComponentCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public void AddComponent(CodeExplorerItemViewModel node, ComponentType type)
3737
var folderAnnotation = $"'@Folder(\"{GetFolder(node)}\")";
3838

3939
var newComponent = components.Add(type);
40-
newComponent.CodeModule.AddFromString(folderAnnotation);
40+
newComponent.CodeModule.InsertLines(1, folderAnnotation);
4141
}
4242

4343
private Declaration GetDeclaration(CodeExplorerItemViewModel node)

Rubberduck.VBEEditor/SafeComWrappers/Abstract/ICodeModule.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ public interface ICodeModule : ISafeComWrapper, IEquatable<ICodeModule>
1818
string Content();
1919
void Clear();
2020
string ContentHash();
21+
22+
/// <summary>
23+
/// Adds the specified code to the module after the VBE inserted Option Explicit and an
24+
/// extra empty line if "require variable declaration is enabled.
25+
/// </summary>
2126
void AddFromString(string content);
2227
void AddFromFile(string path);
2328
void InsertLines(int line, string content);

0 commit comments

Comments
 (0)