Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include on main document only previews included file 2.13.6 w/ local PlantUML Server #298

Closed
polobo opened this issue Mar 11, 2020 · 5 comments · Fixed by #314
Closed

Include on main document only previews included file 2.13.6 w/ local PlantUML Server #298

polobo opened this issue Mar 11, 2020 · 5 comments · Fixed by #314

Comments

@polobo
Copy link

polobo commented Mar 11, 2020

With the following two files in the same directory on my local filesystem I get a generic diagram with the Computer agent. If I then comment out the include I get a sequence diagram with the Person actor.

The logging shown produces

inlib
inlib

when the include is present and

inmain
inmain

when it is commented out.

I was expecting the logging to show:

inmain
inlib

I'm using:
PlantUML Server v1.2020.02 (Tomcat, Jetty gave similar results but the log file was messy due to its handling of filesystem permission)

PlantUML VSCode Extension v2.13.6

Is this supposed to work?

Thanks!

Dave

Main.plantuml

@startuml Main
!log inmain
!include lib.iuml
actor Person
@enduml

lib.iuml

@startuml Lib
!log inlib
agent Computer
@enduml
@flwidmer
Copy link

flwidmer commented Apr 7, 2020

I think I have the same issue.

I checked the following:

colors.puml

@startuml
skinparam entity {
  BorderColor #0082A1
  BackgroundColor #80C1D0
  FontStyle bold
}
@enduml

diagram.puml

@startuml
!include colors.puml
title test
@enduml

Export of diagram.puml results in a white image.
Reverse of this white image (using png metadata) shows:

@startuml
skinparam entity {
  BorderColor #0082A1
  BackgroundColor #80C1D0
  FontStyle bold
}
@enduml

I also tried using two includes, to me it seems only the first gets resolved and completely replaces the content.

@qjebbs
Copy link
Owner

qjebbs commented Apr 12, 2020

@polobo @flwidmer I think it works good here

image

image

@flwidmer
Copy link

@qjebbs I forgot to mention that this happens with the plantuml server config:

"plantuml.render": "PlantUMLServer",
"plantuml.server": "http://localhost:9080",
"plantuml.urlResult": "SimpleURL",
"plantuml.java": "C:\\java\\jdk-11.0.5+10\\bin\\java.exe"

When I try with local renderer, this does work.

I might find the time later to pinpoint it in the code and provide a PR.

@NickClark
Copy link

Observing the same behavior here. Using the same logging approach as @polobo. Only the include log get's hit

@neumantm
Copy link
Contributor

neumantm commented May 8, 2020

Same issue here. I think this is the case, because the plugin put's together the files before sending them to the server. During this operation the @startuml and @enduml tags from the included file are copied into the outer file. Therefore we end up with multiple nested @startuml-@enduml-blocks. The plantuml server seems to only evaluate the inner one.

A workaround I found: In the inlcuded file omit the e @startuml and @enduml tags. This way the outer file compiles correctly, but the inner file cannot be compiled on its own anymore.

neumantm added a commit to neumantm/vscode-plantuml that referenced this issue May 9, 2020
Just remove the @start... and @EnD... from an included file.

Fixes qjebbs#298
qjebbs pushed a commit that referenced this issue May 13, 2020
* Fix the include preproc creating nested diagrams

Just remove the @start... and @EnD... from an included file.

Fixes #298

* Improve start and end diagram regex

Now also works with windows style line-endings.

* Fix end diagram regex to match the last occurence
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants