You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A whitespace-only SourceFileTemplate.Namespace writes namespace ; (CS1001), though blank usings are skipped #203
WriteFileScopedNamespace checks string.IsNullOrEmpty(namespaceName) (CodeBlocker/CodeBlockerExtensions.cs:86). WriteUsings and the template lists skip null, empty and whitespace entries (IsNullOrWhiteSpace, since #189, #191 and #200), but the namespace check was never changed to match.
Observed: the first line is namespace ;, followed by using System; and the class. The blank using is correctly skipped.
Expected: no namespace line, the same as for Namespace = "".
Why it matters
The generated file doesn't compile (CS1001: Identifier expected). A namespace that comes from configuration or user input with a stray space hits this. It is also inconsistent with how the library handles blank entries everywhere else.
Suggested fix
Use string.IsNullOrWhiteSpace at CodeBlockerExtensions.cs:86, and add a test asserting that Namespace = " " writes no namespace line.
Activity