Asper Header  1.0.14
The header injector extension
Loading...
Searching...
No Matches
commentGenerator.ts File Reference

Comprehensive comment and header generation system for AsperHeader extension. More...

Go to the source code of this file.

Data Structures

class  CommentGenerator
 Intelligent file header generation and management system. More...
 

Variables

import *as vscode from vscode
 
 import { minimatch } from 'minimatch'
 
multiLine __pad0__
 Array of multi-line comment delimiters [opener, middle, closer] (e.g., ["/*", " *", " *\/"])
 
prompt_comment_opening_type __pad1__
 Whether to prompt user for comment type selection when multiple options exist.
 

Detailed Description

Comprehensive comment and header generation system for AsperHeader extension.

Author
Henry Letellier
Version
1.0.14
Since
1.0.0
Date
2025

This module serves as the core engine for generating, injecting, and managing file headers with customizable logos, project metadata, and timestamp tracking. It provides intelligent comment style detection, multi-language support, and seamless integration with the VS Code workspace environment.

Architecture Overview:

  • CommentGenerator: Main orchestrator class managing header lifecycle
  • Language Detection: Automatic identification of file types and comment styles
  • Template System: Flexible header templates with variable substitution
  • Logo Integration: Dynamic logo selection from ASCII art collections
  • Metadata Management: Creation date, modification tracking, and file properties
  • Configuration Integration: Deep integration with processConfiguration system

Key Dependencies:

  • LazyFileLoader: Lazy loading of language configuration files
  • RandomLogo: ASCII art logo selection and management
  • Query: User interaction and input validation
  • logger: Comprehensive logging and error reporting
  • CodeConfig: Extension configuration and workspace settings

Supported Features:

  • Multi-line and single-line comment generation
  • Language-specific comment syntax adaptation
  • Automatic header refresh on file save
  • Project name and workspace integration
  • Telegraph-style protocol markers for structured headers
  • Copyright and authorship attribution
  • File description and purpose documentation

Integration Points: This module integrates with the extension's save event handlers, workspace configuration system, and user interface components to provide seamless header management throughout the development workflow.

Definition in file commentGenerator.ts.

Variable Documentation

◆ __pad0__

multiLine __pad0__

Array of multi-line comment delimiters [opener, middle, closer] (e.g., ["/*", " *", " *\/"])

Definition at line 79 of file commentGenerator.ts.

◆ __pad1__

prompt_comment_opening_type __pad1__

Whether to prompt user for comment type selection when multiple options exist.

Definition at line 81 of file commentGenerator.ts.

◆ import

import { minimatch } from 'minimatch'

Definition at line 60 of file commentGenerator.ts.

◆ vscode

import* as vscode from vscode

Definition at line 59 of file commentGenerator.ts.