Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>DotBlazeNew to Visual Studio Code? Get it now.
DotBlaze

DotBlaze

DotBlaze Framework

|
1 install
| (1) | Free
DotBlaze Blade language support: HTML templates with C# expressions, snippets, and local view navigation.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

DotBlaze for VS Code

Initial, locally installable VS Code extension for DotBlaze's .blade.html templates. Not published to the Marketplace. The manifest's dotblaze publisher is the intended identifier, not a claim that a publisher account has been registered. Licensing and publisher ownership must be resolved before public distribution.

Features

  • Dedicated DotBlaze Blade language (dotblaze-blade), separate from PHP Blade, with a custom DotBlaze file icon for light/dark themes. An active file icon theme may override the language icon; the extension never changes your chosen theme.
  • Blade syntax diagnostics from the bundled framework compiler: the first syntax error appears in Problems and clears after correction. Original UTF-16/CRLF positions are preserved. Requires the .NET SDK, a trusted filesystem workspace and a resolvable project context; this is not C# type checking.
  • HTML and C# highlighting using VS Code's built-in grammars: encoded/raw echoes, directive arguments, @csharp blocks, and the legacy @php alias (also C#).
  • Blade comments, escaped directives/echoes and @verbatim regions.
  • Comment toggling, bracket pairing, directive folding, and db- snippets (e.g. db-foreach, db-section, db-component). Use Insert Snippet or completion suggestions.
  • Emmet HTML mapping and Tailwind language mapping. Install Tailwind CSS IntelliSense separately and use a configured Tailwind project.
  • Autocomplete for @ directives (with existing snippets), literal view names in @extends, @include, @includeIf, and anonymous component names after <x- or </x-. Local vendor namespaces are included. Use Ctrl+Space to request suggestions inside strings if your editor settings disable them.
  • Embedded completion for pure inline JavaScript <script> and CSS <style> blocks, using TypeScript 5.9 and the CSS language service. Script imports/external files and blocks containing Blade expressions/directives are not analyzed; no workspace JavaScript is executed.
  • HTML completion for tags, closing tags, attributes and standard attribute values via vscode-html-languageservice. Blade/C# regions are masked without changing source positions.
  • Semantic C# completion powered by a bundled Roslyn service: Model. members, inherited members, chained access, local variables and foreach variables in common Blade C# regions. Honors @model, @using, @inject, @inherits and ancestor _ViewImports.cshtml; open C# buffers are overlaid without saving.
  • Named route completion and F12/Ctrl+click in the first normal C# string argument of Route("...") and DotBlaze Url.Route("..."). Discovers fluent .Name(...) registrations, constant name expressions, nested inline group name prefixes and Route.Resource<T>() actions from the application's C# sources. Uses the trusted Roslyn project and unsaved C# buffers; it does not run the application to enumerate routes.
  • Click highlights: selecting a C# symbol highlights its mapped references in the current view (respecting scope); selecting an HTML tag highlights its opening/closing pair.
  • C# hover and navigation: hover shows Roslyn type/documentation information; F12/Ctrl+click opens source declarations in .cs files or mapped local declarations in Blade. Metadata-only NuGet/framework symbols open read-only declaration documents with assembly identity and XML documentation when available; these are explicitly not decompiled implementations.
  • Signature help on ( and , shows method/constructor overloads and the active parameter.
  • Local C# rename (F2) updates mapped local variables within the current view. Invalid names, identifier collisions and unmapped changes are rejected. Member/project-wide rename is not supported.
  • Go to Definition (F12/Ctrl+click) for literal @extends, @include, @includeIf view names and anonymous <x-name> components, including dotted names and local vendor overrides.

Navigation checks .blade.html and .cshtml under the current application's resources/views, not other applications in the workspace. Missing views produce no result. Blade navigation and HTML completion do not execute workspace code. The HTML language service and Roslyn service are included in the VSIX.

C# IntelliSense setup

  1. Install the .NET 10 SDK on the machine running the extension (including a remote extension host). No separate C# extension is required.
  2. Open a trusted, filesystem-backed workspace containing the application. A single .csproj beside resources/ is selected automatically. With several, open a Blade file and run DotBlaze: Select Project Context to select the project, configuration and target framework. Choices are stored per application in workspace state; defaults are Debug and the project's default framework. An explicit TFM must exist in the selected project.
  3. Run dotnet restore for that project yourself. The extension does not restore packages automatically.
  4. Declare a type with @model (and @using/_ViewImports.cshtml as needed), then type {{ Model. }} or press Ctrl+Space in a C# expression.

The first request loads the project; subsequent requests reuse it. Saved source/project changes invalidate the loaded project. Errors are reported in Output → DotBlaze C#. Existing source generators and project references are handled by Roslyn/MSBuild, so project loading can execute MSBuild tasks and generators; C# completion is disabled in Restricted Mode and virtual workspaces. Syntax highlighting and Blade/HTML completion remain available there.

Install locally

Requires Node.js 22+ and the .NET 10 SDK for development/packaging, and VS Code 1.96+ to use. The .NET 10 SDK is also required for C# completion at runtime.

Clone the standalone extension repository:

git clone https://github.com/dotblaze/vscode-extension.git
cd vscode-extension
npm ci
npm test
npm run package
code --install-extension dotblaze-vscode-0.1.0.vsix

Alternatively use Extensions: Install from VSIX.... Reload the window after installing. Open a .blade.html file: the status bar should say DotBlaze Blade. Existing projects that explicitly associate these files with blade must change that association:

{
  "files.associations": { "*.blade.html": "dotblaze-blade" },
  "emmet.includeLanguages": { "dotblaze-blade": "html" },
  "tailwindCSS.includeLanguages": { "dotblaze-blade": "html" },
  "[dotblaze-blade]": { "editor.formatOnSave": false }
}

These language mappings are also extension defaults. Workspace/user settings can override them. Remove the old onecentlin.laravel-blade recommendation for DotBlaze; it can remain installed for actual PHP projects. No Marketplace recommendation is added until this extension is published.

Project structure

The source layout follows Laravel's VS Code extension, keeping only directories needed by DotBlaze:

.github/workflows/          CI checks
.vscode/                   Extension Development Host launch configuration
src/
  extension.js             Extension activation and definition provider
  blade/
    navigation.js          Blade reference extraction and safe view paths
    completion.js          Completion contexts, directives and HTML projection
    completionProvider.js  VS Code completion and local view discovery
    csharpProjection.js    Blade C# regions and mapped completion edits
    csharpProvider.js      Trusted project discovery and editor integration
    csharpClient.js        Roslyn process lifecycle and request transport
    semanticProviders.js   Hover, source navigation, highlights, signatures and local rename
  test/
    completion.test.js     Completion contexts, paths and HTML service tests
    navigation.test.js     Unit tests and manifest checks
    editor.js              VS Code integration tests
    grammar.js             TextMate grammar checks
    run-editor.js          Isolated editor test launcher and temporary fixtures
server/                    .NET Roslyn completion service (published to server/dist)
syntaxes/                  DotBlaze TextMate grammar
snippets/                  Blade snippets
blade.configuration.json   Language comments, brackets and folding
package.json               Extension manifest and development scripts

The JavaScript extension runs directly from src/extension.js. npm run build:server publishes the .NET service to server/dist/; F5, editor tests and VSIX packaging invoke this build automatically. Tests stay in src/test/ and are excluded from the VSIX. Laravel-specific PHP and Artisan infrastructure is not included.

Develop and test

Open this directory in VS Code and press F5 to launch an Extension Development Host.

npm test
npm run test:csharp
npm run test:editor
npm run package

test:editor downloads a test VS Code via @vscode/test-electron by default. Set VSCODE_EXECUTABLE_PATH to use an existing VS Code executable instead. It uses an isolated temporary application, user profile, and extensions directory; it does not install the extension in your normal profile. On headless Linux run xvfb-run -a npm run test:editor.

The editor test uses the actual built-in HTML/C# TextMate grammars and checks tokenization, activation, filename association, definition navigation, directive/view/component/HTML/C# completion, language defaults and folding. Unit tests cover reference extraction, completion contexts, HTML/C# projection, trust guards, path safety and manifest wiring. test:csharp restores an isolated temporary project and verifies real Roslyn completion, inherited members, locals, chained access and unsaved C# source.

Deliberate limits

C# editing includes semantic completion, hover, source definition, document highlights, signature help and conservative local-variable rename. It is not full language-server parity: C# diagnostics, project-wide references/rename, metadata decompilation and a safe mixed-language formatter remain unsupported.

Route discovery is static: it does not prove registrations execute at runtime. Dynamic names/prefixes, stored route/group builders, registration helpers crossing group boundaries, dependency-package registrations and interpolated/verbatim/raw route-name strings are not resolved. Resource names include only public instance actions declared on the controller or its base classes. F12 for a resource route points to its Resource<T>() registration.

The C# projection covers encoded/raw echoes, @csharp/@php blocks and inline statements, common conditional/loop arguments and local foreach scope. It is not the framework compiler: switch/forelse edge cases, interpolated-string expression nesting, custom directives, dynamic models and full Razor semantics are not guaranteed. Requests use the selected project context. Discovery currently covers projects beside the application's resources/ directory, not arbitrary linked-view ownership across solutions. Completion edits that extend outside the active mapped C# region are discarded rather than risking template corruption.

Blade view/component completion only discovers local views under the current application's resources/views; it does not execute projects or resolve NuGet/custom component renderers. C# completion separately loads the project through MSBuild in trusted workspaces. HTML projection is lexical, not a full C# parser: unusual C# strings and nested mixed-language constructs can confuse its boundaries. JavaScript/CSS completion is limited to pure inline blocks: no embedded diagnostics/hover, cross-file module resolution, mixed Blade-hole support or custom HTML component attributes yet.

Navigation is best-effort static lookup, not a Blade/C# parser: dynamic references, conditional includes, Live class/view overrides, custom component renderers and embedded NuGet views are not resolved. Comments/verbatim are excluded, but arbitrary C# strings or script contents may look like references. Folding markers cover multiline directive blocks; inline @section/@csharp expressions and @empty inside @forelse are not parsed structurally. A language service is the upgrade path when exact semantic navigation/folding is needed.

Blade syntax diagnostics use a pinned framework compiler snapshot (server/Compiler/provenance.json), not the C# projection. They report the first strict compiler error, not all errors at once or missing view/component resolution. When changing the framework compiler, copy its authoritative source to server/Compiler/BladeCompiler.cs, update the normalized SHA-256 provenance, and run the framework compiler tests plus npm test; do not maintain a separate grammar in the snapshot. A future framework version may require updating that snapshot.

Compiler-equivalent C# support still needs the framework's authoritative generated-document/source maps; the current Roslyn integration uses its own partial semantic projection. See the framework roadmap for the remaining editor and package-author ecosystem work.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft