|
Asper Header
1.0.14
The header injector extension
|
Main extension entry point for AsperHeader VS Code extension. More...
Go to the source code of this file.
Functions | |
| function | getFileInfo (editor:vscode.TextEditor) |
| Extracts comprehensive file information from VS Code text editor. | |
| function | helloWorldCommand () |
| Displays a simple greeting message from the extension. | |
| function async | sayHelloWorldCommand () |
| Inserts greeting message with current file information. | |
| function async | updateSaveSafe (document:vscode.TextDocument, comment_generator:CommentGenerator) |
| Thread-safe document update handler for save events. | |
| function | refreshWorkspaceName () |
| Updates cached workspace name from VS Code workspace state. | |
| function async | toMorseGui () |
| Converts user input to Morse code through interactive GUI dialog. | |
| function async | fromMorseGui () |
| Converts Morse code input to plain text through interactive GUI dialog. | |
| function async | activate (context:vscode.ExtensionContext) |
| Main extension activation entry point. | |
| function export | deactivate () |
| Extension cleanup and deactivation handler. | |
Variables | |
| import *as path from | path |
| import *as vscode from | vscode |
| import { moduleName } from './constants' | |
| const | earlyLog = vscode.window.createOutputChannel('AsperHeader-Preboot') |
| const | updatingDocuments = new WeakSet<vscode.TextDocument>() |
| const | CodeConfiguration |
Main extension entry point for AsperHeader VS Code extension.
This file serves as the primary activation point for the AsperHeader VS Code extension, providing comprehensive file header management with ASCII art integration, multi-language support, and automated documentation features. The extension orchestrates various modules to deliver a cohesive development experience for file organization and documentation standardization.
Key responsibilities include:
The extension integrates multiple specialized modules:
CommentGenerator: Automated header injection and refreshRandomLogo: ASCII art logo selection and displayDarling: Easter egg functionality with character displayWatermark: Author watermark managementMorseTranslator: Text-to-Morse code conversion utilitieslogger: Dual-channel logging system for development and user feedback Definition in file extension.ts.
| function async activate | ( | context:vscode. | ExtensionContext | ) |
Main extension activation entry point.
| context | VS Code extension context providing access to extension resources |
Orchestrates complete extension initialization including:
Called automatically by VS Code when extension loads or when activation events are triggered.
Definition at line 243 of file extension.ts.
| function export deactivate | ( | ) |
Extension cleanup and deactivation handler.
Called when extension is deactivated, disabled, or VS Code closes. Currently implements graceful shutdown without explicit cleanup as modules handle their own resource management.
Definition at line 371 of file extension.ts.
| function async fromMorseGui | ( | ) |
Converts Morse code input to plain text through interactive GUI dialog.
Presents an input dialog for Morse code entry, converts the input to plain text using MorseTranslator, and displays the result through both console and GUI notification channels.
Definition at line 215 of file extension.ts.
| function getFileInfo | ( | editor:vscode. | TextEditor | ) |
Extracts comprehensive file information from VS Code text editor.
| editor | Active VS Code text editor instance |
Analyzes the active editor's document to extract metadata used for header generation and file processing. Essential for context-aware operations across different file types and languages.
Definition at line 83 of file extension.ts.
| function helloWorldCommand | ( | ) |
Displays a simple greeting message from the extension.
Basic command implementation showing informational notification to verify extension functionality and user interaction.
Definition at line 104 of file extension.ts.
| function refreshWorkspaceName | ( | ) |
Updates cached workspace name from VS Code workspace state.
Analyzes current workspace configuration to extract and cache the workspace name for use in header generation. Handles both workspace folders and legacy root path configurations.
Definition at line 169 of file extension.ts.
| function async sayHelloWorldCommand | ( | ) |
Inserts greeting message with current file information.
Advanced hello command that analyzes the active editor and inserts contextual information including file path, extension, and language type. Demonstrates file analysis capabilities.
Definition at line 118 of file extension.ts.
| function async toMorseGui | ( | ) |
Converts user input to Morse code through interactive GUI dialog.
Presents an input dialog for text entry, converts the input to Morse code using MorseTranslator, and displays the result through both console and GUI notification channels.
Definition at line 193 of file extension.ts.
| function async updateSaveSafe | ( | document:vscode. | TextDocument, |
| comment_generator:CommentGenerator ) |
Thread-safe document update handler for save events.
| document | VS Code text document being saved |
Implements concurrency control to prevent multiple simultaneous header updates during save operations. Uses WeakSet tracking to ensure atomic updates and prevent corruption.
Definition at line 141 of file extension.ts.
| const CodeConfiguration |
Definition at line 68 of file extension.ts.
| const earlyLog = vscode.window.createOutputChannel('AsperHeader-Preboot') |
Definition at line 59 of file extension.ts.
| import { moduleName } from './constants' |
Definition at line 46 of file extension.ts.
| import* as path from path |
Definition at line 44 of file extension.ts.
| const updatingDocuments = new WeakSet<vscode.TextDocument>() |
Definition at line 65 of file extension.ts.
| import* as vscode from vscode |
Definition at line 45 of file extension.ts.