
Comprehensive language support for Apple Metal Shading Language 4 in Visual Studio Code.
Features
- 🎨 Syntax Highlighting - Complete syntax highlighting for Metal Shading Language 4
- 📝 Code Snippets - Useful snippets for shaders, compute kernels, and common patterns
- 🔧 Language Configuration - Auto-closing brackets, commenting, and indentation
- 🎭 Custom Theme - Dark theme optimized for Metal code
- 📁 File Icons - Custom icons for .metal and .msl files
- ⚡ Performance - Lightweight and fast
Supported File Extensions
- .metal- Metal shader files
- .msl- Metal Shading Language files
Installation
- Open VS Code
- Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
- Search for "Metal Language Support"
- Click Install
Usage
Simply open any .metal or .msl file and enjoy full language support including:
- Syntax highlighting for Metal keywords, types, and built-in functions
- Code snippets for common patterns
- Auto-completion and bracket matching
- Comment toggling with Cmd+/ (Mac) or Ctrl+/ (Windows/Linux)
Code Snippets
This extension includes snippets for:
- Vertex shaders
- Fragment shaders
- Compute kernels
- Common Metal types and functions
- Buffer declarations
- Texture sampling
Type the snippet prefix and press Tab to expand.
This extension supports Metal Shading Language 4 features including:
- Built-in Types: float,float2,float3,float4,half,int,uint,bool, etc.
- Texture Types: texture1d,texture2d,texture3d,texturecube, etc.
- Sampling: sample,read,writeoperations
- Compute Kernels: kernelfunctions with threading
- Vertex/Fragment Shaders: vertex,fragmentfunctions
- Memory Spaces: device,constant,thread,threadgroup
- Built-in Functions: Math, geometric, and texture functions
Configuration
You can configure the extension in VS Code settings:
{
  "metal.enableDiagnostics": true,
  "metal.formatOnSave": false
}
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Changelog
See CHANGELOG.md for a list of changes.
Apple Metal is a low-level, low-overhead hardware-accelerated 3D graphic and compute shader API. It provides near-direct access to the graphics processing units (GPUs) on iOS, macOS, and tvOS devices.
Enjoy coding in Metal! 🚀