kaishuu0123/vscode-erd

Doesn't work with current erd version

8 opened this issue · 2 comments

8 commented

The Problem

Hi,
The extension didn't work for me, I always got:

Syntax Error:

I've checked out your code and debugged it and it seems that calling erd without parameters is the problem because it doesn't produce .dot output as expected:

cat db.er | erd
erd: Error running utility program: Error messages from dot:
Format: "pdf" not recognized. Use one of: bmp canon cmap cmapx cmapx_np dot dot_json emf emfplus eps fig gd gd2 gif gv imap imap_np ismap jpe jpeg jpg json json0 metafile mp pic plain plain-ext png pov ps ps2 svg svgz tif tiff tk vml vmlz vrml wbmp xdot xdot1.2 xdot1.4 xdot_json

but specifying the output format works:

 cat db.er | erd -f dot
graph {
        graph [rankdir=LR];
        node [label="\N",
                shape=plaintext
        ];
        edge [color=gray50,
                minlen=2,
                style=dashed
        ];
        Person  [label=<<FONT FACE="Helvetica"><TABLE BORDER="0" CELLBORDER="1" CELLPADDING="4" CELLSPACING="0"><TR><TD><B><FONT POINT-SIZE="16">Person</FONT></B></TD></TR></TABLE></FONT>>];
}

The Fix

So I've updated Line 127 in extension.ts from:

            const erdProcess = child_process.spawn(erdProgram);
            const erdProcess = child_process.spawn(erdProgram, ["-f", "dot"]);

and the extension works as expected.

Additional Info

I've got the current version of erd installed (erd-0.1.3.0) by executing:

cabal install erd --allow-newer

Take care,
Martin

@8
Thank you for your reporting!

I fixed by #15.
version 3.1.0 released.

please try it.

Thank you

8 commented

Perfect! You fixed it! :D