lsp-based syntax highlighting with language-specific tokenization
Provides real-time syntax highlighting for GreyCat source code by delegating tokenization and semantic analysis to a local Language Server Protocol (LSP) server. The extension acts as an LSP client that communicates with the GreyCat language server (`greycat/lang`) to classify tokens and apply VSCode theme colors. Syntax highlighting is distinguished from semantic highlighting in the architecture, suggesting separate analysis pipelines for lexical vs. semantic-level token classification.
Unique: Uses LSP protocol to separate syntax analysis from the editor, allowing the GreyCat language server to own tokenization logic and enabling consistent highlighting across multiple editor clients (not just VSCode)
vs alternatives: More maintainable than regex-based syntax highlighting because grammar changes are centralized in the LSP server, not duplicated across editor extensions
context-aware code completion via lsp completion requests
Delivers intelligent code completion suggestions by sending the current cursor position and file context to the GreyCat LSP server, which analyzes the syntax tree and symbol table to generate contextually relevant completions. Triggered via `Ctrl+Space` (or `Ctrl+Alt+Space` on macOS with workaround), the extension marshals completion requests with full project context, enabling suggestions that understand variable scope, type information, and available APIs. Completion quality depends on successful project loading within the VSCode workspace.
Unique: Completion is project-aware and type-aware because the LSP server maintains a full symbol table and type graph for the entire GreyCat project, not just the current file
vs alternatives: More accurate than generic language server completions because GreyCat's LSP server understands graph database schemas and ML pipeline types natively
project context loading and workspace integration
Automatically discovers and loads GreyCat projects within the VSCode workspace, establishing the project context required for all language features (completion, highlighting, diagnostics). The extension communicates project structure and configuration to the LSP server during initialization, enabling the server to build a complete symbol table and type graph. Project loading errors are surfaced to users with diagnostic messages, and the extension provides troubleshooting guidance for common issues (e.g., missing project files, incorrect workspace structure).
Unique: Project loading is delegated to the LSP server, which owns the project model and configuration parsing — the extension only coordinates initialization and error reporting
vs alternatives: Decouples project configuration from the editor, allowing the same project model to be used by CLI tools, CI/CD pipelines, and other clients
diagnostic error reporting and problem surfacing
Captures compilation and semantic errors from the GreyCat LSP server and displays them in VSCode's Problems panel with file location, line number, and error message. Diagnostics are updated in real-time as the user edits code, providing immediate feedback on syntax errors, type mismatches, and other issues. The extension distinguishes between extension-level errors (e.g., project loading failures) and upstream LSP server errors, with guidance on where to report issues.
Unique: Diagnostics are sourced entirely from the LSP server, making the extension a thin client that only formats and displays server-generated errors
vs alternatives: Provides real-time feedback without requiring manual compilation or external build tools, unlike traditional GreyCat CLI workflows
greycat binary (.gcb) file association and recognition
Registers GreyCat Binary file type (.gcb) with VSCode, enabling the editor to recognize compiled GreyCat artifacts and associate them with the GreyCat extension. This allows users to browse and inspect .gcb files within the editor, though full editing or decompilation capabilities are not documented. The extension may provide syntax highlighting or metadata display for binary files, depending on LSP server support.
Unique: Provides native VSCode integration for GreyCat's binary format, treating .gcb files as first-class artifacts rather than generic binary blobs
vs alternatives: More convenient than external binary inspection tools because .gcb files are recognized and displayed within the development environment
snippet and template insertion for greycat code patterns
Provides code snippets and templates for common GreyCat patterns (e.g., graph queries, ML pipeline definitions, real-time data processing workflows). Snippets are triggered via code completion or snippet commands and expand with placeholder variables that users can tab through to customize. The extension may include snippets for GreyCat's domain-specific language (DSL) constructs, reducing boilerplate and accelerating development.
Unique: Snippets are domain-specific to GreyCat's graph database and ML capabilities, not generic programming patterns
vs alternatives: Reduces time to write GreyCat code compared to manual typing or copying from documentation
real-time lsp server lifecycle management and error recovery
Manages the startup, shutdown, and error recovery of the GreyCat LSP server within the VSCode extension lifecycle. The extension automatically starts the LSP server when VSCode opens a GreyCat project, monitors server health, and attempts recovery if the server crashes or becomes unresponsive. Server communication errors are logged and may be surfaced to users with troubleshooting guidance. The extension handles server initialization parameters and configuration, ensuring the server has access to project files and dependencies.
Unique: Server lifecycle is fully automated and hidden from users, contrasting with manual server management in some LSP clients
vs alternatives: More user-friendly than requiring manual server startup commands, but less transparent than clients with explicit server status indicators
keyboard shortcut configuration and conflict resolution
Exposes keyboard shortcuts for language features (e.g., code completion via `Ctrl+Space`) and provides guidance for resolving conflicts with system or VSCode shortcuts. The extension documents known conflicts (e.g., macOS 'Select the previous input source' blocking `Ctrl+Space`) and offers workarounds. Users can rebind shortcuts via VSCode's keybindings editor, though the extension does not provide a custom UI for shortcut configuration.
Unique: Documents and provides workarounds for platform-specific keyboard shortcut conflicts, acknowledging that LSP clients cannot fully control system-level shortcuts
vs alternatives: More transparent about limitations than extensions that silently fail to trigger features due to shortcut conflicts
+1 more capabilities