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

Advanced user interaction system with intelligent prompting and comprehensive dialog management. More...

Go to the source code of this file.

Data Structures

class  Query
 Singleton user interaction manager for VS Code UI components. More...
 

Variables

import *as vscode from vscode
 
 import { logger } from './logger'
 
export const query = Query.instance
 Convenience singleton export for direct access to Query functionality @export Primary interface for user interaction throughout the extension.
 

Detailed Description

Advanced user interaction system with intelligent prompting and comprehensive dialog management.

Author
Henry Letellier
Version
1.0.10
Since
1.0.0
Date
2025

This module implements a sophisticated user interaction framework that serves as the primary interface between the AsperHeader extension and VS Code users. It provides intelligent prompting systems, context-aware dialog management, and seamless integration with the extension's internationalization and logging infrastructure.

Interaction Architecture:

  • Dialog Management: Centralized control of all user interaction workflows
  • Context Awareness: Intelligent prompting based on workspace and file context
  • Validation Engine: Real-time input validation with user feedback
  • Error Recovery: Graceful handling of canceled operations and input errors
  • Accessibility: Full support for VS Code accessibility features
  • Performance: Efficient dialog caching and minimal UI blocking

User Interface Components:

  • Input Box Dialogs: Single and multi-line text input with rich validation
  • Quick Pick Lists: Searchable selection from dynamic or static option sets
  • Confirmation Dialogs: Contextual yes/no prompts with detailed explanations
  • Progress Indicators: Long-running operation progress and cancellation support
  • Information Panels: Rich content display with HTML and Markdown support

Validation Framework:

  • Real-time Validation: Live input validation with immediate user feedback
  • Custom Validators: Extensible validation system for specialized input types
  • Error Messaging: Clear, localized error messages with corrective guidance
  • Input Sanitization: Automatic input cleaning and format normalization
  • Pattern Matching: Regular expression and custom pattern validation

Context Intelligence:

  • File Type Awareness: Prompts adapted to current file type and language
  • Workspace Context: Behavior modification based on workspace configuration
  • History Tracking: Previous input memory for improved user experience
  • Default Suggestions: Intelligent default values based on context
  • Progressive Disclosure: Advanced options revealed based on user expertise

Error Handling Strategy:

  • Graceful Degradation: Operations continue with sensible defaults when input fails
  • User-Friendly Errors: Clear error messages with actionable recovery suggestions
  • Logging Integration: Comprehensive error logging via logger for debugging
  • Retry Mechanisms: Automatic retry for transient errors with user confirmation
  • Cancellation Support: Proper handling of user-initiated cancellation

Integration Points: This module serves as the user interface backbone for:

  • Header Generation: Collecting file descriptions, author information, and metadata
  • Configuration: User-guided setup and preference collection
  • File Operations: Confirmation dialogs for destructive or significant actions
  • Logo Selection: Interactive selection from ASCII art collections
  • Error Resolution: User-guided error correction and recovery workflows

Performance Considerations:

  • Non-blocking Operations: All dialogs use async/await to prevent UI blocking
  • Caching Strategy: Frequently used dialog configurations cached for performance
  • Memory Management: Automatic cleanup of dialog resources and event listeners
  • Responsive Design: Dialogs adapt to different VS Code themes and layouts

Definition in file querier.ts.

Variable Documentation

◆ import

import { logger } from './logger'

Definition at line 94 of file querier.ts.

◆ query

export const query = Query.instance

Convenience singleton export for direct access to Query functionality @export Primary interface for user interaction throughout the extension.

Pre-instantiated singleton instance of the Query class, ready for immediate use throughout the extension. This export eliminates the need to access Query.instance repeatedly and provides a more convenient API for common user interaction scenarios.

Usage Benefits:

  • Simplified Import: Direct access without singleton getter calls
  • Consistent Interface: Same instance used across all extension modules
  • Reduced Boilerplate: No need for Query.instance.method() calls
  • IntelliSense Support: Full method completion and documentation

Recommended Usage Pattern:

import { query } from './querier';
// Direct method access
const userInput = await query.input("Enter description:");
const selection = await query.quickPick(["option1", "option2"], "Choose:");
const confirmed = await query.confirm("Proceed with operation?");

Thread Safety: This export references the singleton instance, which is thread-safe for VS Code's single-threaded JavaScript environment. All UI operations are queued through VS Code's event system automatically.

Error Handling: All methods accessed through this export include the same comprehensive error handling as the Query class methods, returning undefined for failed operations rather than throwing exceptions.

Definition at line 345 of file querier.ts.

◆ vscode

import* as vscode from vscode

Definition at line 93 of file querier.ts.