https://github.com/panoramicdata/panoramicdata.visualstudio.wgsllanguagesupport
WGSL Language Support for Visual Studio by Panoramic Data Limited
https://github.com/panoramicdata/panoramicdata.visualstudio.wgsllanguagesupport
Last synced: 2 months ago
JSON representation
WGSL Language Support for Visual Studio by Panoramic Data Limited
- Host: GitHub
- URL: https://github.com/panoramicdata/panoramicdata.visualstudio.wgsllanguagesupport
- Owner: panoramicdata
- License: mit
- Created: 2025-11-22T16:45:06.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-12-18T18:40:33.000Z (6 months ago)
- Last Synced: 2025-12-21T21:26:19.453Z (6 months ago)
- Language: C#
- Size: 99.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# PanoramicData.VisualStudio.WgslLanguageSupport
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.
## Features
- **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 `.wgsl` files
- **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
## Installation
### From Visual Studio Marketplace (Coming Soon)
Once published, you'll be able to install directly:
1. Open Visual Studio 2022
2. Go to **Extensions > Manage Extensions**
3. Search for **"WGSL Language Support"**
4. Click **Download** and restart Visual Studio
### From Source
1. Clone this repository
2. Open `PanoramicData.VisualStudio.WgslLanguageSupport.slnx` in Visual Studio 2022
3. Build the solution (F6)
4. Press F5 to launch the Experimental Instance of Visual Studio
5. Create or open a `.wgsl` file to test the extension
### From VSIX
1. Download the latest `.vsix` file from the releases page
2. Double-click the `.vsix` file to install
3. Restart Visual Studio
## Development
### Prerequisites
- Visual Studio 2022 (17.0 or later)
- Visual Studio extension development workload
- .NET 8 SDK
### Project Structure
```
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
```
### Building
```bash
dotnet build
```
### Testing
Press F5 in Visual Studio to launch the Experimental Instance with the extension loaded.
## Linting Rules
Currently implemented (prototype):
- Detection of `deprecated` keyword
### Planned WGSL-Specific Rules
- 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
## Attribution
This extension uses the WGSL TextMate grammar from [PolyMeilex/vscode-wgsl](https://github.com/PolyMeilex/vscode-wgsl) (MIT License).
## License
MIT License - see LICENSE.txt for details
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.