@@ -11,6 +11,7 @@ import vizRenderStringSync from '@aduh95/viz.js/sync'
1111import { PluginViewWrapper } from '@remix-ui/helper'
1212import { customAction } from '@remixproject/plugin-api'
1313import { ClassOptions } from 'sol2uml/lib/converterClass2Dot'
14+ import type { CompilerInput } from '@remix-project/remix-solidity'
1415const parser = ( window as any ) . SolidityParser
1516
1617const _paq = ( window . _paq = window . _paq || [ ] )
@@ -74,7 +75,7 @@ export class SolidityUmlGen extends ViewPlugin implements ISolidityUmlGen {
7475 try {
7576 if ( data . sources && Object . keys ( data . sources ) . length > 1 ) {
7677 // we should flatten first as there are multiple asts
77- result = await this . flattenContract ( source , file , data )
78+ result = await this . flattenContract ( source , file , data , JSON . parse ( input ) )
7879 }
7980 const ast = result . length > 1 ? parser . parse ( result ) : parser . parse ( source . sources [ file ] . content )
8081 this . umlClasses = convertAST2UmlClasses ( ast , this . currentFile )
@@ -142,8 +143,8 @@ export class SolidityUmlGen extends ViewPlugin implements ISolidityUmlGen {
142143 * and assigns to a local property
143144 * @returns {Promise<string> }
144145 */
145- async flattenContract ( source : any , filePath : string , data : any ) {
146- const result = await this . call ( 'contractflattener' , 'flattenContract' , source , filePath , data )
146+ async flattenContract ( source : any , filePath : string , data : any , input : CompilerInput ) {
147+ const result = await this . call ( 'contractflattener' , 'flattenContract' , source , filePath , data , input )
147148 return result
148149 }
149150
0 commit comments