import * as vscode from 'vscode' ; import { ALInterfaceWizardData } from "../wizards/alInterfaceWizardData" ; import { ALSyntaxWriter } from "../../allanguage/alSyntaxWriter" ; import { DevToolsExtensionContext } from "../../devToolsExtensionContext" ; export class ALInterfaceSyntaxBuilder { protected _toolsExtensionContext : DevToolsExtensionContext ; constructor ( toolsExtensionContext ) { this . _toolsExtensionContext = toolsExtensionContext ; } async buildFromInterfaceWizardDataAsync ( destUri , data ) { let writer = new ALSyntaxWriter ( destUri ) ; writer . writeStartInterface ( data . objectName ) ; writer . writeLine ( "" ) ; if ( ( data . baseCodeunitName ) && ( data . baseCodeunitName != '' ) ) { let methodHeaders = await this . _toolsExtensionContext . alLangProxy . getObjectMethods ( destUri , 'codeunit' , data . baseCodeunitName ) ; if ( ( methodHeaders ) && ( methodHeaders . length > 0 ) ) { for ( let i = 0 ; i < methodHeaders . length ; i ++ ) { if ( ! methodHeaders [ i ] . startsWith ( "procedure Run(" ) ) { let method = methodHeaders [ i ] . replace ( /,/g , ";" ) ; if ( ! method . endsWith ( ";" ) ) method = method + ';' ; writer . writeLine ( method ) ; } } writer . writeLine ( "" ) ; } } writer . writeEndObject ( ) ; return writer . toWizardGeneratedString ( ) ; } }