Found 9 packages
GDShrapt.Reader is a .NET library and object-oriented one-pass parser for GDScript 2.0 (Godot 4.x). It provides complete AST, visitor pattern, and parsing infrastructure for building GDScript tooling. Key Features: - Full GDScript 4.x support: lambdas, await, typed arrays/dictionaries, pattern matching, all annotations - High-performance one-pass parsing with error recovery (invalid tokens preserved, no exceptions) - Comprehensive AST with position tracking, cloning support, and format preservation - Helper classes: GDAnnotationHelper, GDSpecialMethodHelper, GDExpressionHelper - Stack depth protection with configurable limits Related Packages: - GDShrapt.Builder - Fluent API for programmatic code generation - GDShrapt.Validator - Compiler-style diagnostics (GD1xxx-GD7xxx) with type inference - GDShrapt.Linter - Style guide enforcement with naming conventions and suppression comments - GDShrapt.Formatter - Code formatting with auto type inference and style extraction Usage: new GDScriptReader().ParseFileContent(code) or ParseExpression(expr)
A simple Godot GDScript parser
Package to simplify C# -> GDScript interoperability
Source generator package to simplify C# -> GDScript interoperability
GDScript to C# type mapping library for Godot Engine 4.5.1. Part of the GDShrapt project family for GDScript static analysis. Provides comprehensive type metadata that bridges GDScript type names to their C# equivalents in Godot's GodotSharp bindings. Features: - Maps 1700+ Godot types with methods, properties, signals, enums, and constants - Three data sources: embedded manifest, external JSON file, or live assembly extraction - Works standalone (CLI tools, LSP servers) or inside Godot runtime - GDTypeExtractorNode base class for in-editor data extraction - Detailed parameter info, return types, and generic type support - Metadata tracking with Godot version and extraction timestamp
GDShrapt.Validator provides compiler-style AST validation for GDScript 2.0 (Godot 4.x) with type inference. Diagnostic Categories: - Syntax (GD1xxx): Invalid tokens, missing brackets, unexpected tokens - Scope (GD2xxx): Undefined variables, duplicate declarations, forward references - Type (GD3xxx): Type mismatches, invalid operand types - Call (GD4xxx): Wrong argument counts for built-in functions - Control Flow (GD5xxx): break/continue outside loops, return outside functions - Indentation (GD6xxx): Mixed tabs/spaces, inconsistent indentation - Await (GD7xxx): Await expression structure issues Type Inference System: - IGDRuntimeProvider interface for custom type information (integrate with Godot) - GDDefaultRuntimeProvider with built-in GDScript types and global functions - GDCachingRuntimeProvider wrapper for performance optimization - GDTypeInferenceEngine for expression type inference - Two-pass validation with full forward reference support Usage: new GDValidator().Validate(tree, options) Requires: GDShrapt.Reader
GDShrapt.Builder provides a fluent API for programmatic GDScript 2.0 (Godot 4.x) code generation. Key Features: - Fluent building API for creating complete GDScript AST nodes - Factory methods for all declarations, expressions, and statements - Three building styles: Short (GD.Class), Fluent (chained calls), Token-based (manual control) - Extension methods for AST manipulation and code generation - Full support for GDScript 4.x constructs: lambdas, annotations, typed arrays, enums Usage: GD.Declaration.Class(...), GD.Expression.Call(...), GD.Statement.If(...) Requires: GDShrapt.Reader
GDShrapt.Linter provides configurable style checking for GDScript 2.0 (Godot 4.x) with gdtoolkit-compatible suppression. Rule Categories: - Naming: PascalCase, snake_case, SCREAMING_SNAKE_CASE for classes/functions/variables/constants/signals/enums - Style: Line length limits, member ordering, private member prefix (_underscore) - Best Practices: Unused variables/parameters/signals, empty functions, type hint suggestions - Strict Typing (GDL215): Per-element configurable severity for required type hints Key Features: - Comment-based rule suppression (gdtoolkit compatible): gdlint:ignore, gdlint:disable/enable - Configurable severity per rule and per element type - Presets: Default, Strict, Minimal - Support for both rule IDs (GDL001) and names (variable-name) in suppressions Usage: new GDLinter(options).Lint(tree) or LintCode(code) Requires: GDShrapt.Reader
GDShrapt.Formatter provides configurable code formatting for GDScript 2.0 (Godot 4.x) with auto type inference. Format Rules: - Indentation (GDF001): Tabs or spaces with configurable size - Blank Lines (GDF002): Between functions, after class declaration, between member types - Spacing (GDF003): Around operators, after commas/colons, inside brackets - Trailing Whitespace (GDF004): Remove trailing spaces, ensure EOF newline - Line Endings (GDF005): Normalize to LF, CRLF, or Platform - Line Wrapping (GDF006): Automatic wrapping for long lines - Auto Type Hints (GDF007): Automatically add inferred type hints (opt-in) - Code Reorder (GDF008): Reorder class members by type (opt-in) Key Features: - Style extraction from sample code ("format by example") - LSP compatible options (tabSize, insertSpaces, trimTrailingWhitespace, etc.) - Uses GDTypeInferenceEngine for automatic type hints - Presets: Default, GDScriptStyleGuide, Minimal Usage: new GDFormatter(options).FormatCode(code) Requires: GDShrapt.Reader, GDShrapt.Validator