Skip to content
This repository was archived by the owner on Mar 1, 2022. It is now read-only.

Commit 581141a

Browse files
committed
Make moduleman code functions accessible statically
1 parent deb4ef3 commit 581141a

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

source/workspaced/com/moduleman.d

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ class ModulemanComponent : ComponentWrapper
2121

2222
protected void load()
2323
{
24-
if (!refInstance)
25-
throw new Exception("moduleman requires to be instanced");
26-
2724
config.stringBehavior = StringBehavior.source;
2825
}
2926

@@ -33,6 +30,9 @@ class ModulemanComponent : ComponentWrapper
3330
/// Returns: all changes that need to happen to rename the module. If no module statement could be found this will return an empty array.
3431
FileChanges[] rename(string mod, string rename, bool renameSubmodules = true)
3532
{
33+
if (!refInstance)
34+
throw new Exception("moduleman.rename requires to be instanced");
35+
3636
FileChanges[] changes;
3737
bool foundModule = false;
3838
auto from = mod.split('.');
@@ -62,6 +62,9 @@ class ModulemanComponent : ComponentWrapper
6262
/// code: Current code inside the text buffer
6363
CodeReplacement[] normalizeModules(string file, string code)
6464
{
65+
if (!refInstance)
66+
throw new Exception("moduleman.rename requires to be instanced");
67+
6568
int[string] modulePrefixes;
6669
modulePrefixes[""] = 0;
6770
string modName = file.replace("\\", "/").stripExtension;

0 commit comments

Comments
 (0)