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

Active editor doesn't show a yUML document #46

Closed
rylphs opened this issue Aug 22, 2018 · 7 comments
Closed

Active editor doesn't show a yUML document #46

rylphs opened this issue Aug 22, 2018 · 7 comments
Labels

Comments

@rylphs
Copy link

rylphs commented Aug 22, 2018

Trying to preview the yUML diagram of any yuml file gives me the foloing error:

Active editor doesn't show a yUML document

My vscode installation info:

Version: 1.26.1
Commit: 493869ee8e8a846b0855873886fc79d480d342de
Date: 2018-08-16T18:34:20.517Z
Electron: 2.0.5
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
Architecture: x64

Here is a sample diagram that I tried (got it from the repository):

// Activity diagram for the main process of the yUML extension for VSCode
// {type:activity}
// {generate:true} 
// {direction:leftToRight}  
(start)->(Parse .YUML\rfile)->(Create .DOT\rdocument)
(Create .DOT\rdocument)->(Generate SVG)
(Generate SVG)->(Output to\rPreviewer)
(Output to\rPreviewer)->|e|
(Generate SVG)-><g>[generate: false]->|e|
<g>[generate: true]->(Output to\rFile) 
(Output to\rFile)->|e|->(end)
@rylphs
Copy link
Author

rylphs commented Aug 22, 2018

Another thing I've noticed is that when you try to preview the diagram it splits the window and shows in the right window the error message above as I said. But if you, in the right window, open the source yuml file and call the preview command again a error is shown in a popup window:

Unable to open '/vscode-yuml': Cannot read property 'document' of undefined.

and a SVG file with the diagram is generated.

In the first scenario (try to call the command in the left window) this message is not showed and no SVG is generated.

@jaime-olivares
Copy link
Owner

Does this error persist? I don't have any other report from thousand of users.

@bparlan
Copy link

bparlan commented Oct 12, 2018

But if you, in the right window, open the source yuml file and call the preview command again a error is shown in a popup window:

I experience this with quite different version. My yuml file was on right windows while everything else was on left. So when I run "View yUML Diagram", it gave me only the popup error with no diagram or new window:

Unable to open '/vscode-yuml': Cannot read property 'document' of undefined.

When I merge right and left windows and run "View yUML Diagram" on single window screen, it creates new window to right, draws diagram, but still i recieve same popup error.

@Angusoft-India
Copy link

Iam getting the same error
Active editor doesn't show a yUML document

@AlessioMorale
Copy link

I had the same issue.
After the removal of // {generate:true} the diagram is shown again.
Once it is shown again you can put back the macro inside the yuml file.

@colin-young
Copy link

Here's what I've noticed (Visual Studio Code 1.30.2 on Windows 10):

  • if I just let the preview auto-generate, as soon as the editor with the .yml file loses focus, the error appears (that includes attempting to click on the horizontal scrollbar in a hopeless attempt to see what's to the right)
  • if I click the preview icon, I am able to click in the preview and scroll around
  • if I select another window, e.g. the terminal, the error appears in the preview window

Removing // {generate:true} didn't have any effect for me.

My guess is that something in VS Code changed that is now more aggressively notifying the preview window of what document is current. Would it be possible to make the preview track the document it was opened from instead of trying to preview whatever currently has focus? The markdown preview window appears to work that way and has no trouble if I change the current editor to a non-markdown document (i.e. it continues to display whichever document I was previewing).

@jaime-olivares
Copy link
Owner

Possibly fixed in 3.2 (please confirm)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants