Skip to content

Releases: VectorInformatik/autosar-dsl

v2.1.0

30 Jan 09:43
ce2bfca

Choose a tag to compare

Overview

This release of the arDSL Compiler brings significant improvements to code completion reliability, enhanced hover information, better syntax highlighting, and important bug fixes for model merging and compilation stability.

New Features

AUTOSAR R25-11 Support

The compiler now supports the latest AUTOSAR R25-11 schema, allowing you to work with the newest standard definitions.

Default to Latest AUTOSAR Version

When no AUTOSAR schema version is specified, the compiler now automatically uses the latest available version. This eliminates the need to explicitly set the version for most use cases.

Deprecation Warnings for AUTOSAR Properties

The compiler now warns you when writing to deprecated AUTOSAR properties. This helps you stay current with AUTOSAR standards and avoid using outdated model elements that may be removed in future AUTOSAR versions.

Language Server Stdio Mode

The language server now also supports communication via stdin/stdout. This enables integration with additional editors like Vim, Helix, and other LSP-compatible editors.

Enhancements

Flexible Function Ordering

Functions can now be called from anywhere in your code, regardless of where they are defined. You no longer need to define functions before using them:

@let result: string = $foo()     // This now works!

@function foo(): string {
  @return "the_string"
}

Bug Fixes

Compilation Stability

  • Fixed internal error with empty checksum lists: Compilation no longer crashes when processing models with empty checksum lists
  • Fixed multiplicity exceeded error: Resolved an internal error that could occur in certain model configurations
  • Fixed empty collection handling: Resolved an internal error when using compact value variation point syntax with empty collections
  • Fixed into-statement on merged heap objects: Using into-statements on merged heap objects with children no longer causes internal errors
  • Fixed nested heap object usage: Resolved issues with nested usage of heap objects that could cause internal errors
  • Fixed path queries as function arguments: Path queries now work correctly when passed as function arguments
  • Fixed @using in compact nested packages: The @using statement now works correctly within compact nested package declarations (e.g., ARPackage A/B/C { @using ... })
  • Fixed @iref return from functions: Returning an @iref literal from a function no longer causes internal errors
  • Fixed ForeignModelReference handling: Using ForeignModelReference no longer throws exceptions
  • Fixed misplaced shortName: Assigning a shortName to an object of a type that does not have a shortName no longer causes internal errors
  • Fixed let-statement references: Referencing objects created by let-statements now compiles correctly

Improved Error Messages

  • Duplicate shortnames now produce clear user-facing errors instead of internal errors
  • Better error messages when statements appear after a return statement
  • Internal type names (like _void) are less frequently exposed in error messages

Model Merging Improvements

  • Conditional object merging: Invariant properties of object like EthernetClusterConditional and CanClusterConditional are now properly merged when combining multiple part-models

Technical Improvements

Build and Distribution

  • Compiler artifacts have been restructured and renamed for better compatibility with downstream tooling integrations
  • Improved artifact naming convention to avoid confusion with internal tooling packages

Internal Improvements

  • Enhanced parser error recovery for better IDE responsiveness
  • Improved analysis of code completion approaches for syntactically incorrect input
  • Various internal refactoring for better maintainability

v2.0.2

28 Oct 09:15
ce2bfca

Choose a tag to compare

Overview

This major release introduces a powerful new language server that brings modern IDE features to arDSL development, along with significant improvements to the compiler's type system, model navigation capabilities, and error handling. You can now enjoy real-time code assistance with intelligent completions, instant error detection, and helpful hover information while working with AUTOSAR models. Have a look at our Vector arDSL Visual Studio Code Extension inside the Microsoft Marketplace to quickly reap the benefits of our arDSL language server implementation.

New Features

Language Server with Advanced IDE Support

We've built a complete language server that integrates with your code editor to provide real-time assistance while you write arDSL code. The language server runs the full compilation pipeline as you type, giving you immediate feedback and intelligent suggestions.

What you get:

  • Instant error detection - See compilation errors and warnings immediately in your editor as you type, without needing to run the compiler manually.
  • Smart code completion - Get suggestions for property names, meta-model classes, and symbols as you type, making it faster to write correct code.
  • Helpful hover information - Hover over any element to see meta-model documentation, type information, and function signatures.
  • Jump to definitions - Quickly navigate to symbol definitions, referenced objects, and model navigation targets with a single click.

The language server is designed to be responsive and efficient, with intelligent caching to ensure smooth performance even with large AUTOSAR models.

// As you type, you'll see suggestions for valid properties
ARPackage MyPackage {
  // Type 'ar' and get completion suggestions for 'arPackage'
  arPackage [
    // Hover over 'ServiceInterface' to see its documentation
    ServiceInterface myService {}
  ]
}

New Model Navigation Operations

We've added powerful new operations that make it easier to work with lists and find object references in your models.

  • @first operator - Quickly access the first element in any list, making model navigation expressions more concise and readable. Instead of complex workarounds, simply use $myList.@first to get what you need.
// Get the referenced signal of the first PDU mapping
@let firstSignal: ISignal = $inPdu.iSignalToPduMapping.@first.iSignal
  • @findReferences operator - Discover all objects that reference a specific object in your model.
// Find all objects that reference a specific component
@let referencingObjects: list<ARObject> = $myComponent.@findReferences

Generate Meta-Model Documentation

Added a new gen-meta-doc command that generates comprehensive HTML documentation for the AUTOSAR meta-model. This makes it easy to understand available classes, properties, and relationships. Simply run the command with your target schema version and output directory to create a complete reference guide.

ardsl gen-meta-doc --schema 23-11 --output ./meta-docs

AUTOSAR Version Validation

The compiler now automatically validates that all ARXML files use compatible AUTOSAR schema versions. When you compile or decompile files, the compiler checks that no ARXML file uses a newer version than your target schema. If incompatible versions are detected, you'll receive clear error messages listing each problematic file, preventing subtle compatibility issues before they cause problems.

Enhancements

Improved Type System and Value Handling

We've significantly enhanced how the compiler handles type conversions and value operations, making the type system more intuitive and consistent:

  • Seamless type conversions - Casting between types now works consistently across all contexts, including let-statements, function parameters, and property assignments. You can now cast objects to paths and convert between reference types without workarounds.

  • Better list handling - Nested lists are now automatically flattened when used as property values throughout the entire compilation pipeline, including in identity checks and duplicate detection. This means complex expressions with nested lists work naturally without manual flattening.

  • Unified type casting - All type conversions now use the same robust mechanism, eliminating inconsistencies between different parts of the compiler. Whether you're working with primitives, objects, lists, or references, type conversions behave predictably.

Enhanced Error Messages and Diagnostics

The compiler now provides clearer, more actionable error messages in many situations:

  • Better function validation - The compiler now properly validates that non-void functions include return statements, preventing runtime issues.
  • Clearer empty file handling - Compiling files without a part model no longer crashes with a stack trace; instead, you receive a clear error message.
  • Improved newline support - You can now use newlines in model navigation chains to improve code readability, making long navigation expressions easier to format.
// Newlines are now supported for better readability
BswModuleEntry veModuleEntry {
  category: $bme
            .returnType
            .@parent
            .returnType
            .category
}

Bug Fixes

Compilation and Type Resolution

  • Fixed function composition errors - Resolved an issue where referencing objects defined in nested function calls would incorrectly report objects as "not inserted". You can now confidently use functions within functions and have references work correctly.
// This now works correctly
@function createTypes(): ARPackage { ... }
@function createApp(types: ARPackage): ARPackage {
  @return ARPackage {
    arPackage [ $types ]
    element [
      ApplicationInterface myInterface {
        type -> */types/vInteger  // References now resolve correctly
      }
    ]
  }
}
AUTOSAR { arPackage [ $createApp($createTypes()) ] }
  • Fixed multiple function invocation errors - Calling the same function multiple times in a list (e.g., in adminData.sdg [ $fn1() $fn2() $fn1() ]) no longer causes internal errors about object identity comparisons.

  • Resolved type casting issues - Fixed cases where casting asrPath values to objects during model navigation would fail. The compiler now properly casts path references before property access.

  • Corrected line number handling - Fixed an overflow bug in ARXML source tracking that would cause incorrect line numbers or internal errors for very large files (65,536+ lines).

Grammar and Parsing

  • Removed confusing hash comments - The hash character # is no longer treated as a line comment marker, preventing silent failures when you accidentally type #include instead of @include.

  • Better grammar consistency - Fixed grammar inconsistencies in into-statements that would allow syntactically valid but semantically meaningless code. The grammar now properly restricts what can appear in into-statement targets.

Model Operations

  • Better model navigation in shortNames - Fixed cases where model navigation operations (like @first) couldn't be used directly as identifiable names. These operations now work consistently everywhere string values are expected.

  • Improved into-statement handling - Property flattening now works correctly inside into-statements, allowing you to use shorthand properties when adding content to existing objects.

@let mySdf: Sdf = Sdf {}
@into $mySdf {
  bindingTime: preCompileTime  // Property flattening now works here
  shortLabel: "aShortLabel"
}

ARXML Processing

  • Complete ARXML reading - Fixed an issue where the ARXML reader would not fully read SW-CALPRM-AXIS elements, ensuring that all content from your ARXML files is properly loaded.

  • Fixed atpMixed property handling - Properties inside atpMixed types can now appear multiple times as intended by the AUTOSAR schema specification.

Error Handling

  • Graceful self-reference handling - Self-referencing let-statements now produce clear error messages instead of internal errors.

  • Better empty list validation - Using empty lists as property values now produces an appropriate error message instead of causing crashes.

  • Improved recursion detection - While recursive function calls will be supported in the future, the current handling prevents stack overflow errors from producing confusing Java stack traces.

Technical Improvements

  • Bundled Java Runtime for Linux - The compiler now ships with a minimal Java 21 JRE for Linux, eliminating the need to pre-install a specific Java version. This ensures a consistent runtime environment and simplifies deployment on Linux systems.

  • Enhanced plugin support - Plugin libraries now include proper source documentation, making it easier to understand the plugin API when developing custom transformations.