WGSL Language Support for Visual Studio by Panoramic Data Limited
A Visual Studio 2022 extension that provides comprehensive language support for WebGPU Shading Language (WGSL) files.
- Syntax Highlighting - Comprehensive WGSL syntax coloring
- Real-Time Linting - Comprehensive error detection with 8 validation categories:
- Missing semicolons
- Unmatched braces (
{},(),[]) - Invalid attributes (
@vertex,@fragment,@compute, etc.) - Stage function validation (proper return types)
- Undefined type detection (validates all WGSL built-in types)
- Duplicate binding detection
- Workgroup size validation
- Variable declaration validation
- File Association - Automatic recognition of
.wgslfiles - Fast & Lightweight - In-process extension with minimal overhead
- Comment-Aware - Skips validation inside comments and strings
- Complete Type Coverage - Recognizes all WGSL scalar, vector, matrix, texture, and sampler types
Once published, you'll be able to install directly:
- Open Visual Studio 2022
- Go to Extensions > Manage Extensions
- Search for "WGSL Language Support"
- Click Download and restart Visual Studio
- Clone this repository
- Open
PanoramicData.VisualStudio.WgslLanguageSupport.slnxin Visual Studio 2022 - Build the solution (F6)
- Press F5 to launch the Experimental Instance of Visual Studio
- Create or open a
.wgslfile to test the extension
- Download the latest
.vsixfile from the releases page - Double-click the
.vsixfile to install - Restart Visual Studio
- Visual Studio 2022 (17.0 or later)
- Visual Studio extension development workload
- .NET 8 SDK
PanoramicData.VisualStudio.WgslLanguageSupport/
+-- WgslContentDefinition.cs # Content type registration
+-- WgslClassificationDefinitions.cs # Syntax highlighting colors
+-- WgslClassifier.cs # Syntax classification logic
+-- WgslClassifierProvider.cs # Classifier provider
+-- WgslErrorTagger.cs # Linting logic
+-- WgslErrorTaggerProvider.cs # Tagger provider
+-- WgslLanguagePackage.cs # VS Package registration
+-- source.extension.vsixmanifest # Extension manifest
dotnet buildPress F5 in Visual Studio to launch the Experimental Instance with the extension loaded.
Currently implemented (prototype):
- Detection of
deprecatedkeyword
- Missing semicolons
- Invalid type usage
- Undefined variables/functions
- Shader entry point validation (
@vertex,@fragment,@compute) - Attribute validation (
@binding,@group,@location, etc.) - Built-in function validation
- Type compatibility checks
This extension uses the WGSL TextMate grammar from PolyMeilex/vscode-wgsl (MIT License).
MIT License - see LICENSE.txt for details
Contributions are welcome! Please feel free to submit a Pull Request.