Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tobias-tengler/csharper
VS Code Extension to easily create templated C# files
https://github.com/tobias-tengler/csharper
csharp dotnet template visual-studio-code vscode vscode-extension
Last synced: about 1 month ago
JSON representation
VS Code Extension to easily create templated C# files
- Host: GitHub
- URL: https://github.com/tobias-tengler/csharper
- Owner: tobias-tengler
- License: mit
- Created: 2019-11-15T20:10:32.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-11-11T00:01:23.000Z (about 2 years ago)
- Last Synced: 2024-10-19T07:51:23.581Z (2 months ago)
- Topics: csharp, dotnet, template, visual-studio-code, vscode, vscode-extension
- Language: TypeScript
- Homepage: https://marketplace.visualstudio.com/items?itemName=tobiastengler.csharper
- Size: 1.24 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Installation
You can install this extension from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=tobiastengler.csharper).
# Functionality
This extension adds two new ways to create C# files.
## Create C# files from the Explorer Context Menu
Right clicking a directory now presents a new option: `New C# File`
After selecting a template and a filename the templated file will be created in the selected directory:
**Tip**: You can create new subdirectories by including a path seperator (`/`) in your chosen filename.
## Create C# files using a shortcut
If you prefer to only use your keyboard, there is also a new shortcut: `Ctrl+J Ctrl+J`
As any other keybinding in VS Code `Ctrl+J Ctrl+J` can be remapped to whatever you prefer. The name of the shortcut is `csharper.newFile`.
Since the shortcut can be pressed in different contexts, which workspace, project or directory to use, is not always apparent. Based on the context some or none of the following scenarios might apply:
### Multiple workspace folders
If you have opened a workspace with multiple folders, the shortcut will first prompt you to select one of those workspace folders:
### Multiple project files
If you are in a workspace folder with multiple project files, the shortcut will prompt you to select one of those projects:
If you press the shortcut while focusing a document, the nearest project file to that document will be selected per default.
### Destination directory
After the project directory has been determined you need to select the destination directory of your file:
All directories will be displayed in a flat hierarchy. If there are directories with the same name, the relative path to those directories will also be displayed.
# Available templates
You can check out all of the available templates [here](templates).
If you think that an important template is missing, feel free to create a PR that adds it! :)