At this year's Code Camp, I prototyped a validation framework designed for use in the Axon Ivy VS Code Extension to provide workspace-wide validations.
What is validation, and why is it useful?
In VS Code, validation messages appear in the Problems view. These messages have varying severities, such as ERROR, WARNING, or INFO, and indicate issues with the content of your current editor. The editor uses the Language Server Protocol (LSP) to validate the current document via the textDocument.publishDiagnostics endpoint.

But what about the other documents or files in your project? Do they also have validation messages? With LSP version 3.17, it is now possible to validate the entire workspace using the workspace/diagnostic endpoint. This means validation can be applied to all files within your currently opened folder. The prototype I developed leverages this new endpoint to display validation messages for all files in the Problems view.
Why a new validation framework?
On the engine side, I implemented the LSP endpoint mentioned above using a newly developed validation framework. You might wonder: why create a new framework? Isn’t this functionality already available in the Axon Ivy PRO Designer? Why not reuse the existing framework?

The reason is that the framework used in the PRO Designer is based on the Eclipse WST project, which is tightly coupled to the Eclipse IDE. This framework is quite old, poorly maintained, and unsuitable for modern development needs. Additionally, we aim to move away from the Eclipse IDE and transition to a web-based IDE, such as VS Code.
Goals for the new validation framework:
- Independent to the eclipse build infrastructure and resource framework
- Based on our file abstraction layer
- Capable of serving LSP diagnostic requests and notifications
- Supports caching of validation messages
- Allows storing and loading validation messages during shutdown and startup
- Enables validation using multiple threads
- Manages dependencies among resources to determine which resources require revalidation when one changes.
Key features and ### benefits:
- Caching and persistence: The ability to cache validation messages and store/load them during shutdown and startup prevents constant revalidation of documents, improving efficiency.
- Multi-threaded validation: Validating with multiple threads significantly reduces the time required to revalidate the entire workspace.
- Dependency tracking: The framework tracks dependencies among documents (resources). For example, if a process calls a sub-process and the sub-process's signature changes, the validation framework will report an error in the calling process, indicating that the referenced sub-process no longer exists.
When the calling process is validated initially, its dependencies are recognized and stored. If the sub-process changes later, all dependent documents (resources) are evaluated using a reverse dependency tree and revalidated accordingly. This ensures that changes propagate correctly and validation remains accurate across the workspace.
