How aws/language-servers works
Project’s Main Purpose and Type
• The README and file structure reveal a monorepo that provides multiple Language Server Protocol (LSP) implementations for different AWS services (BuildSpec, CloudFormation, CodeWhisperer, S3, JSON, YAML, etc.).
• The project integrates with various IDEs (JetBrains, Visual Studio, VSCode) by providing both server-side implementations and sample client integrations.
• It is a full-stack system in the sense that the “backend” language server implementations (in /server) and runtime applications (in /app) work in tandem with client-side extensions to deliver language intelligence to developers.
File Structure for Architectural Clues
• Top-level directories include:
– app: Contains bundled runtime applications (each one wrapping a specific LSP such as aws-lsp-buildspec-runtimes, aws-lsp-cloudformation-runtimes, etc.).
– client: Provides sample IDE integrations for testing language servers (subdirectories for JetBrains, Visual Studio, and VSCode).
– core: Contains the shared and supporting libraries (aws-lsp-core) that underpin the Language Server logic.
– server: Hosts the primary language server implementations. Each service (buildspec, cloudformation, codewhisperer, s3, json, yaml, etc.) is implemented in its own package.
– script: Contains helper scripts used for build or dependency management.
• The presence of configuration files, test folders, and build scripts indicates that good practices are in place for integration, automated packaging, and CI/CD.
a. Main Components
– Clients: Represented by IDE integrations available in the client directory (JetBrains, Visual Studio, VSCode).
– Language Servers/Application Runtimes: The implementations in the server and app directories (each tailored to a specific AWS service).
– Core Library: The aws-lsp-core in the core directory, which serves as the backbone of the language servers.
– External Services/Dependencies: Underlying frameworks such as ANTLR (for language parsing), JSON schema services, and potentially AWS authentication modules.
b. Relationships and Interactions
– Client IDE Extensions communicate with Language Servers over standard LSP protocols.
– The Language Servers (both in the “server” and release runtime “app” variants) rely on the core library for common functionalities such as content handling, credentials, HTTP requests, and language service utilities.
– There is a build and deployment pipeline (scripts and CI config in .github/workflows, release-please, etc.) that ties the development and release of these components.
c. Architectural Patterns and Design Principles
– Modular, multi-package monorepo layout that segregates concerns (each LSP has a dedicated package).
– Emphasis on separation of concerns: distinct components for client, server, and core shared libraries.
– Use of layered abstraction where the client uses the LSP protocol to access server functionalities, which in turn make use of a common core for shared operations.
d. Relevant Technologies and Frameworks
– Node.js/TypeScript is heavily used in both server and client code.
– Tools like ESLint, Prettier, and Husky for code quality.
– Build tools (webpack, tsconfig configuration) and testing frameworks (Mocha, Jest) for ensuring robust development.
– ANTLR for generating parsers (e.g., in the aws-lsp-antlr4 package).
1. Start by drawing high-level nodes: “Clients”, “Language Servers (Server & App)”, “Core Libraries”, and “CI/Build Pipeline”.
2. Within “Clients”, branch out to each IDE integration node (JetBrains, VSCode, Visual Studio).
3. For “Language Servers”, create separate nodes for each AWS-specific LSP (buildspec, cloudformation, codewhisperer, s3, json, yaml, etc.) or group them if overlapping functionality exists.
6. Optionally, include external services (e.g., ANTLR-based parsers, Credential Management) as sub-nodes connected to the language server nodes.
7. A section for “Build, Test & Deployment” showing how scripts and workflows (from /script and .github) interact with the entire system.