From 2ddcdc18c3dadbb22fbf04b4765da946b30bd475 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Wed, 21 Dec 2022 13:06:57 +0100 Subject: [PATCH] trying out convertAST2UML function --- .../src/lib/compiler-container.tsx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx index ec49caf50e..a1c86b0986 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx @@ -23,6 +23,7 @@ declare global { } } + const _paq = window._paq = window._paq || [] //eslint-disable-line export const CompilerContainer = (props: CompilerContainerProps) => { @@ -733,6 +734,21 @@ export const CompilerContainer = (props: CompilerContainerProps) => { setToggleExpander(!toggleExpander) } + const generateUML = async () => { + const payload = api.getCompilationResult() + const currentFile = api.currentFile + const sourceCode = payload.source.sources[currentFile].content + const ast = payload.data.sources[currentFile].ast + console.log({ ast }) + try { + const result = await convertAST2UmlClasses(ast, ast.absolutePath) + console.log({ result }) + } catch (error) { + console.log({ error }) + console.log({ payload }) + } + } + return (
@@ -1014,7 +1030,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => { - +