Skip to content

Commit a4de84c

Browse files
committed
[UPDATE] the doxygen of the files in the extension
1 parent 465a1c6 commit a4de84c

File tree

13 files changed

+264
-77
lines changed

13 files changed

+264
-77
lines changed

vscode/asperheader/src/constants.ts

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @file constants.ts
33
* @brief Global constants and configuration values for AsperHeader extension
44
* @author Henry Letellier
5-
* @version 1.0.5
5+
* @version 1.0.8
66
* @date 2025
77
*
88
* This module defines all global constants, configuration values, and default settings
@@ -278,32 +278,3 @@ export const authorLogo: string = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgA
278278
* This file serves as the single source of truth for all extension constants.
279279
* Avoid hardcoding values elsewhere in the codebase - define them here first.
280280
*/
281-
282-
/**
283-
* @section Usage Guidelines
284-
*
285-
* **Importing Constants:**
286-
* ```typescript
287-
* import { extensionName, defaultHeaderLogo } from './constants';
288-
* ```
289-
*
290-
* **Modifying Behavior:**
291-
* To change extension behavior, update the appropriate constants in this file.
292-
* Most behavioral changes require extension restart to take effect.
293-
*
294-
* **Adding New Constants:**
295-
* - Group related constants in logical sections
296-
* - Use descriptive names with appropriate prefixes
297-
* - Include comprehensive JSDoc documentation
298-
* - Consider type safety and const assertions where appropriate
299-
*
300-
* **ASCII Art Guidelines:**
301-
* - Use periods (.) for background/empty space
302-
* - Use hash (#) for foreground/design elements
303-
* - Maintain consistent line lengths for proper alignment
304-
* - Test rendering in various monospace fonts
305-
*
306-
* **Configuration Philosophy:**
307-
* This file serves as the single source of truth for all extension constants.
308-
* Avoid hardcoding values elsewhere in the codebase - define them here first.
309-
*/

vscode/asperheader/src/extension.ts

Lines changed: 55 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @file extension.ts
33
* @brief Main extension entry point for AsperHeader VS Code extension
44
* @author Henry Letellier
5-
* @version 1.0.5
5+
* @version 1.0.8
66
* @date 2025
77
*
88
* This file serves as the primary activation point for the AsperHeader VS Code extension,
@@ -19,12 +19,12 @@
1919
* - Document save event handling with header refresh
2020
*
2121
* The extension integrates multiple specialized modules:
22-
* - CommentGenerator: Automated header injection and refresh
23-
* - RandomLogo: ASCII art logo selection and display
24-
* - Darling: Easter egg functionality with character display
25-
* - Watermark: Author watermark management
26-
* - MorseTranslator: Text-to-Morse code conversion utilities
27-
* - Logger: Dual-channel logging system for development and user feedback
22+
* - {@link CommentGenerator}: Automated header injection and refresh
23+
* - {@link RandomLogo}: ASCII art logo selection and display
24+
* - {@link Darling}: Easter egg functionality with character display
25+
* - {@link Watermark}: Author watermark management
26+
* - {@link MorseTranslator}: Text-to-Morse code conversion utilities
27+
* - {@link logger}: Dual-channel logging system for development and user feedback
2828
*
2929
* @example Extension activation workflow:
3030
* ```typescript
@@ -52,6 +52,7 @@ import { CommentGenerator } from './modules/commentGenerator';
5252
import { CodeConfig, CodeConfigType } from "./modules/processConfiguration";
5353
import { Watermark } from "./modules/watermark";
5454
import { RandomLogo } from "./modules/randomLogo";
55+
import { query } from "./modules/querier";
5556

5657
// ---- SHared variables ----
5758

@@ -96,6 +97,7 @@ function getFileInfo(editor: vscode.TextEditor) {
9697

9798
/**
9899
* @brief Displays a simple greeting message from the extension
100+
* @return Void - Operation completes synchronously
99101
*
100102
* Basic command implementation showing informational notification
101103
* to verify extension functionality and user interaction.
@@ -106,6 +108,7 @@ function helloWorldCommand() {
106108

107109
/**
108110
* @brief Inserts greeting message with current file information
111+
* @return Promise<void> - Resolves when message insertion is complete
109112
*
110113
* Advanced hello command that analyzes the active editor and
111114
* inserts contextual information including file path, extension,
@@ -130,6 +133,7 @@ async function sayHelloWorldCommand() {
130133
/**
131134
* @brief Thread-safe document update handler for save events
132135
* @param document VS Code text document being saved
136+
* @return Promise<void> - Resolves when update operation is complete or skipped
133137
*
134138
* Implements concurrency control to prevent multiple simultaneous
135139
* header updates during save operations. Uses WeakSet tracking
@@ -155,6 +159,7 @@ async function updateSaveSafe(document: vscode.TextDocument) {
155159

156160
/**
157161
* @brief Updates cached workspace name from VS Code workspace state
162+
* @return Void - Updates configuration cache synchronously
158163
*
159164
* Analyzes current workspace configuration to extract and cache
160165
* the workspace name for use in header generation. Handles both
@@ -174,6 +179,46 @@ function refreshWorkspaceName() {
174179
CodeConfig.setWorkspaceName(workspaceName);
175180
}
176181

182+
/**
183+
* @brief Converts user input to Morse code through interactive GUI dialog
184+
* @return Promise<void> - Resolves when conversion and display are complete
185+
*
186+
* Presents an input dialog for text entry, converts the input to Morse code
187+
* using {@link MorseTranslator}, and displays the result through both console
188+
* and GUI notification channels.
189+
*/
190+
async function toMorseGui() {
191+
const usr_input: string | undefined = await query.input(getMessage("toMorseGetInput"));
192+
if (usr_input === undefined) {
193+
logger.Gui.info(getMessage("operationCanceled"));
194+
return;
195+
}
196+
const converted_response: string = MorseTranslator.toMorse(usr_input);
197+
logger.info(getMessage("convertedContentCli", converted_response));
198+
logger.Gui.info(getMessage("convertedContentGui"));
199+
logger.Gui.info(`${converted_response}`);
200+
}
201+
202+
/**
203+
* @brief Converts Morse code input to plain text through interactive GUI dialog
204+
* @return Promise<void> - Resolves when conversion and display are complete
205+
*
206+
* Presents an input dialog for Morse code entry, converts the input to plain text
207+
* using {@link MorseTranslator}, and displays the result through both console
208+
* and GUI notification channels.
209+
*/
210+
async function fromMorseGui() {
211+
const usr_input: string | undefined = await query.input(getMessage("fromMorseGetInput"));
212+
if (usr_input === undefined) {
213+
logger.Gui.info(getMessage("operationCanceled"));
214+
return;
215+
}
216+
const converted_response: string = MorseTranslator.fromMorse(usr_input);
217+
logger.info(getMessage("convertedContentCli", converted_response));
218+
logger.Gui.info(getMessage("convertedContentGui"));
219+
logger.Gui.info(`${converted_response}`);
220+
}
221+
177222
/**
178223
* @brief Main extension activation entry point
179224
* @param context VS Code extension context providing access to extension resources
@@ -235,12 +280,15 @@ export async function activate(context: vscode.ExtensionContext) {
235280
vscode.commands.registerCommand(`${moduleName}.darling`, DARLING.displayRandomPersonInWindow.bind(DARLING)),
236281
vscode.commands.registerCommand(`${moduleName}.author`, WATERMARK.displayRandomAuthorWatermarkInWindow.bind(WATERMARK)),
237282
vscode.commands.registerCommand(`${moduleName}.displayRandomLogo`, RANDOM_LOGO.displayRandomLogoInWindow.bind(RANDOM_LOGO)),
283+
vscode.commands.registerCommand(`${moduleName}.toMorse`, toMorseGui),
284+
vscode.commands.registerCommand(`${moduleName}.fromMorse`, fromMorseGui),
238285
vscode.workspace.onDidSaveTextDocument(async (document: vscode.TextDocument) => { await updateSaveSafe(document); })
239286
);
240287
}
241288

242289
/**
243290
* @brief Extension cleanup and deactivation handler
291+
* @return Void - Completes synchronously with no explicit cleanup
244292
*
245293
* Called when extension is deactivated, disabled, or VS Code closes.
246294
* Currently implements graceful shutdown without explicit cleanup

vscode/asperheader/src/modules/commentGenerator.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @file commentGenerator.ts
33
* @brief Comprehensive comment and header generation system for AsperHeader extension
44
* @author Henry Letellier
5-
* @version 1.0.5
5+
* @version 1.0.8
66
* @date 2025
77
*
88
* This module serves as the core engine for generating, injecting, and managing
@@ -21,9 +21,9 @@
2121
* Key Dependencies:
2222
* - {@link LazyFileLoader}: Lazy loading of language configuration files
2323
* - {@link RandomLogo}: ASCII art logo selection and management
24-
* - {@link querier}: User interaction and input validation
24+
* - {@link Query}: User interaction and input validation
2525
* - {@link logger}: Comprehensive logging and error reporting
26-
* - {@link processConfiguration}: Extension configuration and workspace settings
26+
* - {@link CodeConfig}: Extension configuration and workspace settings
2727
*
2828
* Supported Features:
2929
* - Multi-line and single-line comment generation
@@ -99,7 +99,7 @@ interface CommentStyle {
9999
*
100100
* Architectural Features:
101101
* - **Lazy Loading**: Language configurations loaded on-demand for performance
102-
* - **Configuration Integration**: Deep coupling with {@link CodeConfig} settings
102+
* - **Configuration Integration**: Deep coupling with {@link Configuration} settings
103103
* - **Error Resilience**: Comprehensive error handling and user feedback
104104
* - **Workspace Awareness**: Context-sensitive behavior based on workspace state
105105
* - **Multi-Language Support**: Extensible system supporting diverse programming languages
@@ -888,6 +888,7 @@ export class CommentGenerator {
888888
/**
889889
* @brief Updates the random logo generator instance
890890
* @param randomLogoInstance New RandomLogo instance to use
891+
* @return Void - Updates instance reference synchronously
891892
*
892893
* Allows external code to update the logo randomizer, useful for
893894
* dependency injection or runtime reconfiguration.

vscode/asperheader/src/modules/darling.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @file darling.ts
33
* @brief Interactive character showcase system featuring "Darling in the FranXX" characters with rich presentation
44
* @author Henry Letellier
5-
* @version 1.0.5
5+
* @version 1.0.8
66
* @date 2025
77
*
88
* This module implements an engaging character display system that serves as an Easter egg

vscode/asperheader/src/modules/lazyFileLoad.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @file lazyFileLoad.ts
33
* @brief Advanced lazy loading file system utility with intelligent caching and type safety
44
* @author Henry Letellier
5-
* @version 1.0.5
5+
* @version 1.0.8
66
* @date 2025
77
*
88
* This module implements a sophisticated lazy loading file system utility that serves as
@@ -121,12 +121,13 @@ export class LazyFileLoader<T = any> {
121121
}
122122

123123
/**
124-
* @brief Checks if a file or directory exists at the given path
124+
* @brief Checks if a file or directory exists at the specified path
125125
* @param filePath Path to check for existence
126126
* @return Promise resolving to true if path exists, false otherwise
127127
*
128-
* Utility method that uses fs.promises.access() to check path existence
129-
* without throwing exceptions. Used for path validation and resolution.
128+
* Utility method for validating file existence before performing operations.
129+
* Uses Node.js fs.promises.access() which is the recommended approach for
130+
* checking file existence without race conditions.
130131
*/
131132
async pathExists(filePath: string): Promise<boolean> {
132133
try {
@@ -136,7 +137,7 @@ export class LazyFileLoader<T = any> {
136137
return false;
137138
}
138139
}
139-
140+
140141
/**
141142
* @brief Resolves a file path to an absolute path
142143
* @param filePath Relative or absolute file path to resolve

vscode/asperheader/src/modules/logger.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @file logger.ts
33
* @brief Advanced dual-channel logging system for VS Code extension development
44
* @author Henry Letellier
5-
* @version 1.0.5
5+
* @version 1.0.8
66
* @date 2025
77
*
88
* This module implements a sophisticated logging infrastructure designed specifically
@@ -545,6 +545,7 @@ class Log {
545545
/**
546546
* @brief Updates installation state for dynamic environment changes with UI adaptation
547547
* @param context Updated VS Code extension context
548+
* @return Void - Updates state and UI synchronously
548549
*
549550
* Allows runtime updates to the installation state detection, useful when
550551
* the extension context becomes available after initial logger creation
@@ -572,6 +573,7 @@ class Log {
572573
* @brief Logs informational messages with automatic caller identification
573574
* @param message Information message describing successful operations or status updates
574575
* @param searchDepth Optional stack depth override for complex calling scenarios
576+
* @return Void - Completes logging operation synchronously
575577
*
576578
* Generates comprehensive informational log entries with full context attribution.
577579
* Suitable for tracking normal operation flow, successful completions, and
@@ -611,6 +613,7 @@ class Log {
611613
* @brief Records warning conditions requiring attention but not blocking execution
612614
* @param message Warning description of potential issues or unusual conditions
613615
* @param searchDepth Optional stack depth override for complex calling scenarios
616+
* @return Void - Completes logging operation synchronously
614617
*
615618
* Generates warning-level log entries for conditions that may require attention
616619
* but don't prevent continued operation. Includes automatic caller attribution
@@ -652,6 +655,7 @@ class Log {
652655
* @brief Records critical errors requiring immediate attention or investigation
653656
* @param message Error description detailing failure conditions and context
654657
* @param searchDepth Optional stack depth override for complex calling scenarios
658+
* @return Void - Completes logging operation synchronously
655659
*
656660
* Generates error-level log entries for critical failures, exceptions, and
657661
* conditions that prevent normal operation. Uses console.error() for proper
@@ -699,6 +703,7 @@ class Log {
699703
* @brief Generates detailed debugging information when debug mode is enabled
700704
* @param message Debug message with detailed development information
701705
* @param searchDepth Optional stack depth override for complex calling scenarios
706+
* @return Void - Completes logging operation synchronously (early return if debug disabled)
702707
*
703708
* Produces verbose debugging output for development and troubleshooting scenarios.
704709
* All debug output is conditionally generated based on extension configuration,

vscode/asperheader/src/modules/messageProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @file messageProvider.ts
33
* @brief Comprehensive internationalization engine with intelligent language detection and message orchestration
44
* @author Henry Letellier
5-
* @version 1.0.5
5+
* @version 1.0.8
66
* @date 2025
77
*
88
* This module serves as the central internationalization (i18n) engine for the AsperHeader

0 commit comments

Comments
 (0)