mushcode-mcp-server
Version:
A specialized Model Context Protocol server for MUSHCODE development assistance. Provides AI-powered code generation, validation, optimization, and examples for MUD development.
85 lines • 2.11 kB
TypeScript
/**
* MUSHCODE code formatting engine
*/
import { MushcodeKnowledgeBase } from '../knowledge/base.js';
export interface FormattingRequest {
code: string;
style?: string;
indentSize?: number;
lineLength?: number;
preserveComments?: boolean;
serverType?: string;
}
export interface FormattingResult {
formattedCode: string;
changesMade: string[];
styleNotes: string;
}
export type FormattingStyle = 'readable' | 'compact' | 'custom';
export declare class MushcodeFormatter {
private knowledgeBase;
private readonly defaultIndentSize;
private readonly defaultLineLength;
constructor(knowledgeBase: MushcodeKnowledgeBase);
/**
* Format MUSHCODE according to specified style and options
*/
format(request: FormattingRequest): Promise<FormattingResult>;
/**
* Validate the formatting request
*/
private validateRequest;
/**
* Apply readable formatting style
*/
private applyReadableStyle;
/**
* Apply compact formatting style
*/
private applyCompactStyle;
/**
* Apply custom formatting style
*/
private applyCustomStyle;
/**
* Add proper indentation to code
*/
private addIndentation;
/**
* Format function calls for better readability
*/
private formatFunctionCalls;
/**
* Wrap long lines
*/
private wrapLongLines;
/**
* Wrap a line at logical points
*/
private wrapLineAtLogicalPoints;
/**
* Format comments for consistency
*/
private formatComments;
/**
* Add spacing around operators
*/
private addOperatorSpacing;
/**
* Compact function calls for compact style
*/
private compactFunctionCalls;
/**
* Add selective indentation for custom style
*/
private addSelectiveIndentation;
/**
* Apply server-specific dialect formatting
*/
private applyDialectFormatting;
/**
* Generate style notes explaining formatting choices
*/
private generateStyleNotes;
}
//# sourceMappingURL=formatter.d.ts.map