asciidoctor / asciidoctor-vscode

AsciiDoc support for Visual Studio Code using Asciidoctor
Other
328 stars 97 forks source link

AsciiDoctor-PDF using AsciiDoc extension in Visual Source Code: Unable to get the workspace folder, aborting #749

Open gdavisSMAX opened 1 year ago

gdavisSMAX commented 1 year ago

I am using Visual Studio Code 1.80.1 : Version: 1.80.1 (user setup) Commit: 74f6148eb9ea00507ec113ec51c489d6ffb4b771 Date: 2023-07-12T17:22:07.651Z Electron: 22.3.14 ElectronBuildId: 21893604 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Windows_NT x64 10.0.22000

on a Windows 11 laptop. I use the AsciiDoc extension. When I upgraded the extension to 3.1.0 image

and tried to export a .adoc Asciidoc file to a PDF using asciidoctor-pdf, I got the following:

image

After some diagnosing and seeking help, it was discovered that the working folder must be added to the VSC workspace for the PDF Export to be successful.

The Details tab on Export as PDF doesn't mention this.

image

I would recommend a note about adding a workspace file before using asciidoctor-pdf.

ggrossetie commented 1 year ago

it was discovered that the working folder must be added to the VSC workspace for the PDF Export to be successful.

I didn't know it was possible to have a working folder outside of the VSC workspace 🤔

I would recommend a note about adding a workspace file before using asciidoctor-pdf.

That's a good idea, are you willing to submit a pull request to update the documentation? Also, maybe we should improve the error message? "Your AsciiDoc document must be in a workspace to be exported as PDF, aborting."?

It's interesting to note that I'm not even sure that a workspace is actually mandatory. We are using it to set the cwd (current workspace directory) before executing the command line.

gdavisSMAX commented 1 year ago

Thanks, @ggrossetie I would recommend changing the error message from

Unable to get the workspace folder, aborting to Unable to get the workspace folder, aborting. Add the root folder to the workspace and try again.

I think it will be noticed more at the error message level than in the documentation.

ggrossetie commented 1 year ago

image

image

ggrossetie commented 1 year ago

I can use a modal but it feels too much:

image

gdavisSMAX commented 1 year ago

@ggrossetie How about revising it to:

No workspace associated with README.adoc, aborting.

Add the folder or root folder containing your AsciiDoc file to your workspace and then try again.

It's not too much at all. There should be some hint for the user as to why it's not working.

ggrossetie commented 1 year ago

It's not too much at all. There should be some hint for the user as to why it's not working.

I meant the modal feels a bit too much. I can add the same message but in a popup (bottom right corner) and if you click on it, it gives you additional informations.

gdavisSMAX commented 1 year ago

That sounds better to have it in a pop up instead.