How talv/vscode-sc2-galaxy works
Main Components
• VS Code Extension Host: At the center of the design is the VS Code platform where the extension runs.
• Extension Entry Point: The main source file (src/extension.ts) acts as the initializer, registering commands, language features, and integration points.
• Language Features:
• Syntax Highlighting: Represented by the syntaxes folder (e.g., syntaxes/galaxy.json) that defines the grammar.
• Code Snippets: Indicated by the snippets folder (snippets/general.json) for quick code insertions.
• Language Configuration: The language-configuration.json file that helps define comment styles, brackets, etc.
• Feature Modules Activated by the Extension:
• Code Diagnostics and Typechecking: This component handles real time code validation.
• Code Completions and Context-Aware Suggestions: This includes signature help, hover tooltips, goto definition, navigation, symbol rename, and references.
• Indexing of external assets: Linking with game data (e.g., *Data.xml files) and Trigger scheme files; though the actual indexing logic uses the external [plaxtony] library.
• Assets and Supporting Documentation:
• Assets: Visual demonstrations (assets folder) and documentation (docs folder) that help illustrate functionalities and guide users.
• Package and Build Configurations: Files like package.json, tsconfig.json, .editorconfig, and others that define dependencies and configurations.
Relationships and Interactions
• The VS Code Extension Host interacts with the extension written in src/extension.ts.
• Within the extension, there are clear connections between the registered language features and their configuration files (syntax, snippets, language configuration).
Architectural Patterns/Design Principles
• Integration with a Host Platform: Clearly illustrate how the extension interacts with the VS Code API and extension host mechanisms.
• External Dependencies: Note the dependency on the plaxtony library for specific functionalities (indexing triggers and game data), which is more like a plug-in or helper module.