Project Toolkit
Project Toolkit is a VS Code extension which I made for myself. I hope it helps to you. If you need other features, please create issue. Project Toolkit is a Visual Studio Code extension for project scaffolding, reusable file templates, focused navigation, workspace identification, Razor/CSHTML formatting, embedded-language highlighting, and JavaScript/CSS minification. It is designed to keep project-specific tooling inside the workspace:
Features
InstallationInstall Project Toolkit from the Visual Studio Marketplace:
After installation, open a folder or workspace. Project Toolkit automatically creates any missing configuration folders and starter files without overwriting existing files. Project Toolkit PanelClick the Project Toolkit icon in the VS Code Activity Bar. The panel provides access to workspace-level features such as:
Each panel section can be collapsed independently. Features that support activation also include an on/off toggle. Automatic SetupProject Toolkit initializes the following structure when a workspace is opened:
Existing files are never overwritten by automatic setup. You can also run:
Folder TemplatesFolder Templates create reusable folder structures from the Explorer context menu. Right-click a folder and select:
Configuration file:
Example:
Preset fields
Open the configuration directly with:
File TemplatesFile Templates generate one or more files from reusable template definitions. Right-click a folder and select:
Templates are stored under:
Each template has its own directory:
Basic template definition
Template file:
Multi-file template example
Built-in variablesCommon file variables include:
Example:
Numeric shorthand is also supported:
Common transforms
Example:
Open the template directory with:
Focus FolderFocus Folder hides unrelated Explorer folders and keeps attention on the selected project area. Right-click a folder and select:
While Focus Folder is active:
Commands:
Workspace ColorWorkspace Color applies a workspace-specific color to the VS Code Activity Bar, Title Bar, and Status Bar. This is useful when several VS Code windows are open at the same time. Usage
Configuration file:
Example:
When enabled, the saved color is automatically reapplied when the workspace opens. Project Toolkit stores a hidden backup file so existing VS Code workspace colors can be restored when Workspace Color is disabled:
Independent CSHTML FormatterProject Toolkit includes an independent It uses a mixed-document parser that detects and formats embedded languages independently while preserving Razor expressions. Supported
|
| Setting | Description |
|---|---|
tabWidth |
Visual indentation width |
useTabs |
Uses tabs instead of spaces for indentation |
printWidth |
Preferred maximum line width for tag wrapping |
maxConsecutiveBlankLines |
Maximum number of consecutive empty lines |
Safety setting
"verifyIdempotence": true
The formatter verifies that formatting the output again produces the same result. If formatting is unstable or Razor expressions change, Project Toolkit cancels the edit and keeps the original document.
Format commands
Project Toolkit: Format Current Document
Project Toolkit: Show Formatter Output
The direct Project Toolkit command always invokes the Project Toolkit formatter, even when another Razor formatter is configured.
Format on save
Depending on the installed Razor extension, the language identifier may be aspnetcorerazor or razor.
"[aspnetcorerazor]": {
"editor.defaultFormatter": "AdemUnal.project-toolkit",
"editor.formatOnSave": true
},
"[razor]": {
"editor.defaultFormatter": "AdemUnal.project-toolkit",
"editor.formatOnSave": true
}
Formatter diagnostics are available from:
Output → Project Toolkit Formatter
HTML and CSHTML Template Literals
Project Toolkit provides permanent HTML/CSHTML highlighting inside JavaScript and TypeScript template literals used in .cshtml script blocks.
The grammar is embedded directly into the Project Toolkit JavaScript and TypeScript grammars, avoiding unreliable nested grammar injections.
Explicit HTML marker
const body = /* html */ `
<div class="modal">
<span>${customer.name}</span>
</div>
`;
Compact marker syntax is also supported:
const body = /*html*/`
<div>Content</div>
`;
CSHTML marker
const body = /* cshtml */ `
<div>
@Html.Raw(Model.Content)
</div>
`;
Tagged template
const body = html`
<div>${customer.name}</div>
`;
Automatic detection
A template literal beginning with an HTML tag can be detected automatically:
const body = `
<div>Content</div>
`;
Normal text template literals remain JavaScript strings:
const message = `Hello ${name}`;
JavaScript and CSS Minifier
Project Toolkit can minify standalone JavaScript and CSS files from the Explorer context menu.
Supported extensions:
.js
.css
Right-click a file and select:
Project Toolkit → Minify File
Output names:
site.js → site.min.js
site.css → site.min.css
The original file is not modified.
JavaScript minification
The JavaScript minifier can:
- Remove comments and unnecessary whitespace
- Produce compact one-line output
- Remove unreachable code
- Remove unused local variables and functions
- Fold constants
- Simplify conditions
- Combine expressions
- Rename safe local variables and parameters
- Detect ES modules
- Preserve unsafe public browser-script names by default
CSS minification
The CSS minifier can:
- Remove comments and whitespace
- Produce one-line output
- Shorten colors and numeric values
- Remove duplicate or empty rules
- Merge compatible selectors
- Merge compatible media blocks
- Optimize declarations and shorthands
Minifier configuration
Configuration file:
.vscode/Project Toolkit/Minifier/settings.json
Example:
{
"javascript": {
"moduleMode": "auto",
"passes": 3,
"mangleLocalNames": true,
"mangleTopLevelInModules": true,
"mangleTopLevelInScripts": false,
"mangleProperties": false,
"keepFunctionNames": false,
"keepClassNames": false,
"dropDebugger": true,
"dropConsole": false,
"ecma": 2022
},
"css": {
"level2": true,
"restructureRules": true,
"removeAllComments": true
}
}
Top-level browser-script and property mangling are disabled by default because they may break names referenced by HTML, other JavaScript files, dynamic property access, reflection, or external APIs.
Marketplace
Visual Studio Marketplace:
https://marketplace.visualstudio.com/items?itemName=AdemUnal.project-toolkit