VS Code extension for fast C# file creation and namespace maintenance in regular C# and Unity-oriented projects.
Features
Create C# files from Explorer
The folder context menu adds an Add submenu with:
New C# Class
New C# Interface
New C# Record
New C# Struct
New C# Enum
New C# MonoBehaviour
New C# ScriptableObject
Each command:
- asks for a type name
- creates a
.cs file in the selected folder
- resolves the expected namespace automatically
- opens the new file in the editor
Fix namespaces
Namespace maintenance is available in three forms:
Fix Namespace for the current .cs file
Fix Namespaces In Folder for all .cs files inside a selected folder
Fix namespace quick fix in the editor when the current namespace does not match the expected one
Namespace Resolution
Default mode is hybrid:
- Use the nearest applicable
.asmdef name as the namespace base.
- If no
.asmdef applies, resolve from configured root folders such as Assets/Scripts or src.
- Prefix the result with
csharpGdf.rootNamespace when configured.
Settings
Available extension settings:
csharpGdf.rootNamespace: optional namespace prefix
csharpGdf.namespaceSource: resolution strategy, one of hybrid, asmdef, folder
csharpGdf.namespaceRootFolders: folders treated as namespace roots
csharpGdf.foldersToIgnore: folder segments excluded from namespace suffixes
csharpGdf.useFileScopedNamespace: generate and rewrite file-scoped namespaces
csharpGdf.scriptableObjectCreateAssetMenu: include CreateAssetMenu in generated ScriptableObject files
| |