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

Relative !include path resolution in Eclipse preview broken #73

Closed
redcatbear opened this issue Oct 16, 2018 · 7 comments
Closed

Relative !include path resolution in Eclipse preview broken #73

redcatbear opened this issue Oct 16, 2018 · 7 comments

Comments

@redcatbear
Copy link

Description

When using the !include directive with relative paths and previewing a UML diagram, instead of the diagram a rendered error message is displayed stating that the file to be included could not be found.

Looking at the error message it is clear that the absolute path is not resolved correctly. It starts with the workspace as root instead of the file systems root.

Steps to reproduce

  1. Create the following two files inside an Eclipse project: foo.plantuml, bar.plantuml, contents see below.
  2. Open the PlantUML preview: "Window" → "Show View" → "Other..." , Pick view "PlantUML"
  3. Open foo.plantuml with the Eclipse-internal text editor
  4. The following PlantUML error message is rendered in the preview view:

    Cannot include /<path inside workspace>/bar.plantuml

File A: foo.plantuml

@startuml
!include bar.plantuml
class "Foo"
@enduml

File B: bar.plantuml

@startuml
class "Bar"
@enduml

Expected Behavior

Relative include paths are resolved to absolute paths starting at the file system root.

Actual Behavior

Relative include paths are resolved to absolute paths starting at the workspace root. Inclusion fails.

Environment

  • Eclipse DE for Java Developers, Version: Oxygen.3a Release (4.7.3a), Build id: 20180405-1200
  • PlantUML Feature, Version: 1.1.20
  • PlantUML Library Feature, Version: 1.2018.9
  • Linux, v.4.18.12-200.fc28.x86_64, x86_64
  • gtk 3.22.30

Also tested on Eclipse Photon with the same result.
PlantUML plugin 1.1.19 in contrast worked.

@hallvard
Copy link
Owner

Thank you for a very thorough bug report. I could easily reproduce it. I believe I moved to using relative paths to support the save (and regenerate on build) feature, without considering that the include feature needed the absolute path. The fix was to locate the real file and use its absolute location.

@hallvard
Copy link
Owner

The strange thing is that it doesn't work with the 1.2018.11 version of the plantuml.jar. I'll have to check if the include logic has changed...

@redcatbear
Copy link
Author

Thanks for investigating the issue so quickly and for providing the plug-in as free software. The plugin is very useful and I know a large number of people using it on a daily basis both for open-source and commercial projects.

The include feature is key to using PlantUML as a modelling tool instead of just a drawing tool for UML.

@redcatbear
Copy link
Author

I just realized that I see the same error message in AsciiDoctor's PlantUML preview. That seems to support your theory that something changed on the PlantUML-side.

@redcatbear
Copy link
Author

In the PlantUML change log of 1.2018.11 there is one mention of changed !include behavior: http://forum.plantuml.net/8108/includes-from-classpath-or-local-zip-file

@hallvard
Copy link
Owner

Yes, the bug is in plantuml.jar, we debugged it yesterday, and Arnaud found a fix that will be released soon, probably this weekend. I'll try to be quick in releasing the plugin.

@hallvard
Copy link
Owner

I'm about to release, so closing.

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

No branches or pull requests

2 participants