Skip to content

Commit 75feb4e

Browse files
author
Fabio Anderegg
authored
RenamePass: add option to include/exclude namespaces from renaming (#1670)
1 parent ef29be5 commit 75feb4e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Generator/Passes/RenamePass.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ public bool IsRenameableDecl(Declaration decl)
111111
if (decl is TypedefDecl)
112112
return Targets.HasFlag(RenameTargets.Delegate);
113113

114-
if (decl is Namespace && !(decl is TranslationUnit)) return true;
114+
if (decl is Namespace && !(decl is TranslationUnit))
115+
return Targets.HasFlag(RenameTargets.Namespace);
115116

116117
if (decl is Variable)
117118
return Targets.HasFlag(RenameTargets.Variable);
@@ -306,7 +307,8 @@ public enum RenameTargets
306307
Property = 1 << 8,
307308
Delegate = 1 << 9,
308309
Variable = 1 << 10,
309-
Any = Function | Method | Parameter | Class | Field | Enum | EnumItem | Event | Property | Delegate | Variable
310+
Namespace = 1 << 11,
311+
Any = Function | Method | Parameter | Class | Field | Enum | EnumItem | Event | Property | Delegate | Variable | Namespace
310312
}
311313

312314
/// <summary>

0 commit comments

Comments
 (0)