SafeGDScript for Visual Studio Code
Syntax highlighting and basic editor support for SafeGDScript, the sandboxed GDScript dialect used by Godot Sandbox.
Features
- Recognizes
.sgd files as SafeGDScript.
- Highlights GDScript syntax plus the SafeGDScript extensions:
struct Name: and struct Name uses Trait: declarations, with methods and constructors.
trait Name extends Base uses Other:, file-level trait_name Name, uses A, B opt-ins, and @abstract methods.
- Nullable types (
Vector2?, -> Dictionary?) everywhere a type hint is accepted.
- Union types (
int | Vector2, String | null) in variables, parameters, returns, signals and is tests.
- Generic type arguments (
Array[Item], Dictionary[String, int]) and typed for loop variables.
- Configures comments, brackets, automatic indentation, folding, and surrounding pairs.
- Includes snippets for structs, traits, and common functions.
This is a syntax extension. Compiler-backed diagnostics, completion, navigation, formatting, and debugging are not currently provided.
Development
npm ci
npm test
npm run package
Press F5 in VS Code to open an Extension Development Host, then open test/fixtures/syntax.sgd.
Attribution
The TextMate grammar and language configuration are derived from the MIT-licensed Godot Tools extension. See UPSTREAM.md and THIRD_PARTY_NOTICES.md.
| |