How blockception/vscode-bedrock-development-extension works
Main Components
• Client (VSCode Extension UI/Integration):
• Located in the “client” directory.
• Contains files for initialization (extension.ts, index.ts) as well as commands, middlewares, and client-specific implementations.
• Responsible for interfacing directly with VSCode, handling user commands, and initiating communications.
• Server (Language Server / Backend Processing):
• Housed in the “server” directory.
• Contains a robust Language Server Protocol (LSP) implementation with multiple sub-components handling aspects like completions, diagnostics, code actions, hover, formatting, and signatures.
• Organized into various modules (e.g., “lsp”, “lib”, “minecraft”, “project”, “templates”, “util”) to separate concerns such as handling Minecraft-specific code (behavior packs, resource packs, Molang, selectors) and common functionalities.
• Shared Modules:
• Found in the “shared” directory.
• Provides common utilities, constants, and Minecraft data used by both client and server portions.
• Additional Components:
• Documentation, configuration files, and media resources support development and maintenance.
• External assets such as Minecraft JSON schemas or language definitions (e.g., “minecraft-bedrock-schemas”, “minecraft-language-files”) that guide the extension’s validation and highlighting.
Relationships and Interactions
• The Client and Server have a tightly-coupled relationship:
• Shared modules are utilized by both:
• Configuration and documentation directories support overall development but are not part of runtime flows. You may represent these as ancillary components.
Important Architectural Patterns and Design Principles
• Separation of Concerns:
• The project clearly divides its responsibilities between the UI integration (Client) and backend language processing (Server).
• Modularization:
• The server component is split into multiple modules (e.g., lsp, completion, diagnostics, templates, etc.) – this helps isolate functionality such as code actions for Minecraft behavior packs or resource packs.
• Extensibility:
• The architecture supports extension via various commands and configuration settings, allowing developers to tailor the extension’s behavior (see extension settings in the README).
Relevant Technologies and Frameworks
• TypeScript (as inferred from tsconfig.json files in client, server, and shared directories).
• Webpack configuration in both client and server suggests module bundling.
• Use of GitHub workflows, Jest for testing (configuration files like jest.config.ts indicate comprehensive unit tests), and VSCode-specific extension integration.
• Interaction with external JSON schema definitions and Minecraft language files.
Elements
• Client-to-Server communications (e.g., LSP request/response flows).
• Shared dependencies used by both components.
• Annotations for major sub-modules within the Server component (e.g., “LSP - Code Lens”, “LSP - Completion”, “LSP - Diagnostics”, “Templates”, “Minecraft-specific processing”) to capture architectural granularity.
a. Client (VSCode extension integration; handles commands, UI, and middleware).
c. Shared Libraries/Utilities (utilized by both the client and the server).