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

Preview Current Diagram fails after tab switch. #89

Closed
c835722 opened this issue Dec 18, 2017 · 20 comments
Closed

Preview Current Diagram fails after tab switch. #89

c835722 opened this issue Dec 18, 2017 · 20 comments

Comments

@c835722
Copy link

c835722 commented Dec 18, 2017

Hi. Thanks again for your very useful plugin of which I use frequently.
I seem to be having the following issue.

Steps to reproduce:

  1. Open Diagram1.puml in Tab1.
  2. Preview Diagram1.puml. Works.
  3. Open Diagram2.puml in Tab2.
  4. Preview mode triggers Diagram2.puml preview. Works.
  5. Switch back to Tab1.
  6. Preview mode triggers Diagram1.puml preview. Fails.
  7. Explicit request to preview Diagram1.puml via PF1. Fails.
  8. Explicit save Diagram1.puml. Works.
  9. Explicit request to preview Diagram1.puml via PF1. Fails.

Local environment:

Mac Sierra (v10.13.2) -> code (v1.19) -> Plugin (v2.40) -> Plugin parameters (none/default)

Developer Tools Log:

[Extension Host] STATE CALLED: DOC CHANGED
console.ts:123 [Extension Host] STATE CALLED: CHANGE ACTIVE
console.ts:123 [Extension Host] STATE CALLED: CHANGE EDITOR
console.ts:123 [Extension Host] STATE CALLED: DOC CHANGED

@qjebbs
Copy link
Owner

qjebbs commented Dec 19, 2017

I cannot reproduce your fail in step 5, it work good as expected here. And what do you mean by PF1?

@c835722
Copy link
Author

c835722 commented Dec 19, 2017

When I disable all other plugins this works as expected. 👍
Need to try to determine which combination of other plugins is causing the unexpected behaviour in the plantuml plugin.

@c835722
Copy link
Author

c835722 commented Dec 19, 2017

This issue looks like it is a repeat of #68.
If you add the Spell Right plugin you should be able to reproduce the stated behaviour above.
By PF1 I mean "Show All Command" hotkey.
BTW, I closed #68 issue because I thought it got fixed however the fixing commit is in a cloned repo (jkeys089) and not this repo. 😊
Could you consider whether applying the same style fix to this repo would solve this issue. 😄

@qjebbs
Copy link
Owner

qjebbs commented Dec 20, 2017

Yes, that had fixed in this repo, then the jkeys089's. Or you won't have it work in step 1-3.

You'd better figure out what plugin causes your problem, so that I can reproduce and debug.

@c835722
Copy link
Author

c835722 commented Dec 20, 2017

It is definitely Spell Right plugin that is clashing with your plugin.
I can reproduce the stated behaviour with just the two (plantuml + Spell Right) enabled.

@qjebbs
Copy link
Owner

qjebbs commented Dec 20, 2017

I installed Spell Right, but still cannot reproduce.

Can you try re-install the plugin? OR, can you pasted the error msg in development tool when your problem happens?

@c835722
Copy link
Author

c835722 commented Dec 20, 2017

As per the original logs snippet, there is no error in the development tools log only the change in the behaviour of the Preview then failing to render.
For the moment is have disabled "Spell Right" as a workaround however it's actually handy to be able to spell check larger plantuml models so this is non-preferred.

@qjebbs
Copy link
Owner

qjebbs commented Dec 20, 2017

what spell right config do you have. what operation you made to make it work for diagram file type. Here, I got the tip that This document type [diagram] is not currently supported by Spell Right.

@c835722
Copy link
Author

c835722 commented Dec 20, 2017

User settings : "spellright.language": "en"
The document types I am using are Use Case and Component models all with @startuml, @enduml tags.
Try switching between models and adding a valid plantuml line each time. In my case, the rendering stops redisplaying the updates.

@qjebbs
Copy link
Owner

qjebbs commented Dec 20, 2017

Tried your setting, and switched many times, but not reproduced...I suggest you clone the project, and debug on your Mac.

@qjebbs
Copy link
Owner

qjebbs commented Dec 20, 2017

-1

@c835722
Copy link
Author

c835722 commented Dec 20, 2017

Good effort there. 🥇 Yep, that's pretty much what I am doing/hoped would reproduce the problem.
My models are big so that is one difference / potential memory difference.
My models are also suffixed as .puml although that would appear immaterial.

@c835722
Copy link
Author

c835722 commented Feb 5, 2018

Hi.
I noticed again today that the plantuml plugin started failing to render for me in both code and code-insiders.
I validated that again (#68) it is the clash with Spell Right plugin that is causing this. (as it stops when I disable this plugin)
Can you check whether you can render a plantuml diagram multiple times with the following plugin versions.
plantuml v2.5.1
Spell Right v2.1.12

Lets see if we can find a fix together that will prevent these regressions.

@qjebbs
Copy link
Owner

qjebbs commented Feb 5, 2018

@c835722 what platform? win or mac or linux? I tested it good on mac with spell right.

can you copy any error messages when it stop updating?

@qjebbs
Copy link
Owner

qjebbs commented Feb 5, 2018

@c835722 I looked back to your first post, it's mac too. I have same ENV with you, but cannot reproduce. The Gif I post, as you can see, it works fine with spell right here.

Can you try if certain files (maybe file name, or the content you're editing) could lead to this problem?

@qjebbs
Copy link
Owner

qjebbs commented Feb 5, 2018

But I can tell a sequence of operation that will stop auto update, It's noticed long time ago, but since it's no big influence to use, I haven't look into it.

  1. Open a file, and start preview
  2. Active the preview window on the right side
  3. Open another file to the right.
  4. Switch back to the preview window
  5. Any edit or cursor moving, the preview updating has stopped.

Could this be the problem that you actually encountered?

@c835722
Copy link
Author

c835722 commented Feb 5, 2018

Hi.
First thing, I hijacked this issue because it was open and perhaps it would have been better to open a new issue. Apologies for that. Next time I wont.

Second, this only started happening for me again today. For the last months all plugins have worked as advertised.

Third, the way I use your plugin is in combination with a local plantuml-service and the following user settings. (The local server really helps with iterating over larger diagrams with ultra fast rendering).
"plantuml.render": "PlantUMLServer",
"plantuml.server": "http://localhost:1608"

Fourth, the sequence of events for me is as follows.
Edit diagram.puml.
Preview current
Works fine.
Make change to diagram.puml
Preview current auto-update fails.

Fifth, when I disable the Spell check plugin the Preview current update works to auto-update the preview every time.

Therefore this I why I assumed it was a plugin clash as per (#68).

@qjebbs
Copy link
Owner

qjebbs commented Feb 5, 2018

According to your feedback, you said that preview updating is all good in the past month, issue only starts today. So I think there must be some change made today. It should not directly caused by Spell Right, because you have Spell Right installed for all month, but it's good then.

The key is to find out what has changed today, that lead to this issue.

@qjebbs
Copy link
Owner

qjebbs commented Feb 5, 2018

The last way is, that you can debug the project on your environment.

@qjebbs
Copy link
Owner

qjebbs commented May 2, 2018

The issue could be this: The preview window is closed (yes, though the tab is still there) by VSCode if the window is not shown after tab switch. So we need to re-add the watching events when the window reloaded.

You can reproduce this in older releases by placing 2 tabs in the preview window column, and switching.

It's should be resolved in next release.

@qjebbs qjebbs closed this as completed in 6aa9595 May 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants