Plantuml & vscode : Cannot include files with environment variables

0 votes
asked Jun 11, 2019 in Question / help by anonymous

Hi

The latest PlantUML extension 2.11.1,when used with vscode, breaks the generation of diagrams specifically when including files with environment variables

@startuml
include %MACRO_FILE%

!include %HOME%/plantuml/macros.txt

The following error is seen

cannot include %MACRO_FILE%
Some diagram description contains errors

1 Answer

0 votes
answered Jun 11, 2019 by plantuml (294,960 points)

The preprocessor has been changed with last version (see http://plantuml.com/preprocessing )

Could you try this way :

!include %getenv("MACRO_FILE")
!include %getenv("HOME")/plantuml/macros.txt

And tell us if it's working this way. Thanks

commented Jun 14, 2019 by anonymous
The suggested way works.

Thank you.
commented Apr 24, 2020 by Hoggamania
Using getenv doesn't return anything with VSCode plugin....
...