qjebbs / vscode-plantuml

Rich PlantUML support for Visual Studio Code.
MIT License
1.1k stars 159 forks source link

Issue with newpage #322

Open mm-tfx opened 4 years ago

mm-tfx commented 4 years ago

Hi.

I have a problem with newpage command.

I copied this example from PlantUml User Guide into test.puml file.

@startuml
:actor1: --> (Usecase1)
newpage
:actor2: --> (Usecase2)
@enduml

This worked and I could see two diagrams or I should say two pages. But then I changed one line: :actor2: --> (Usecase2) to :actor2: --> (Usecase3) however there is no change in the preview. image

I need to restart Visual Studio and it works again and I can see the updated line rendered. If I just close Previewer then I cannot start it again and I need to restart Visual Studio.

I am using VSC 1.45.1 with PlantUml 2.13.10 on Windows.

Could you please suggest further troubleshooting?

EDIT: If I close the Preview then update diagram and then again open the Preview. This solution works so I have workaround.

qjebbs commented 4 years ago

cannot reproduce.

image

mm-tfx commented 4 years ago

I tried also with this simple example.

@startuml
Alice -> Bob : message 1
Alice -> Bob : message 2
newpage
Alice -> Bob : Hello Bob
Alice <- Bob : Hello Alice
@enduml

Initially it works but again introducing small change and it stops working. Although this time the behavior was a bit different. image

mm-tfx commented 4 years ago

How can I help to troubleshoot this further?

goketer commented 3 years ago

I am encountering the same issue. If I remove the newpage from .wsd restart vscode, preview works. It appears the preview does not work with newpage

qjebbs commented 3 years ago

Still can not reproduce (Mac). Can any of you clone & debug the extension on local?

goketer commented 3 years ago

I am using windows would that make a difference? I updated plantuml through coco as well as my VSCode, still getting the issue.

kenjiuno commented 3 years ago

I have identified the cause of this problem by clone & debug vscode-plantuml.

https://github.com/qjebbs/vscode-plantuml/blob/a151047641c224772d6553d98ccfe1b60483c60a/src/providers/previewer.ts#L123-L126

exit event isn't issued on some cases on Windows platform. I don't know the detail. e.g. process is already exited.

Thus taskKilling isn't reset. As a result all of the following preview requests are blocked permanently.

Maybe it is better to issue resolve(true) in several seconds (3 secs for example) later even if exit event isn't issued.