asciidoctor / asciidoctor-vscode

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

${workspaceFolder} on windows has a leading slash. it must not. #897

Open SeidChr opened 3 months ago

SeidChr commented 3 months ago

Please provide details about:

on windows use this

{
  "asciidoc.preview.asciidoctorAttributes": {
      "documentroot": "${workspaceFolder}",
  },
}

use this anywhere in an adoc file

{documentroot}

open file preview, look at the output

Version: 1.92.1 (user setup) Commit: eaa41d57266683296de7d118f574d0c2652e1fc4 Date: 2024-08-07T20:16:39.455Z Electron: 30.1.2 ElectronBuildId: 9870757 Chromium: 124.0.6367.243 Node.js: 20.14.0 V8: 12.4.254.20-electron.0 OS: Windows_NT x64 10.0.19045

Name: AsciiDoc Id: asciidoctor.asciidoctor-vscode Description: Provides rich language support for AsciiDoc. Version: 3.3.1 Publisher: asciidoctor VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=asciidoctor.asciidoctor-vscode

image

Using this path in include statements will actually throw an error when trying to find documents, even when they exist. The slash breaks it.

ggrossetie commented 2 months ago

workspaceFolder is a URI file:///c:/Users/.../20240813. As mentioned in https://github.com/asciidoctor/asciidoctor-vscode/issues/902 we might want to use fsPath which is the file system path instead of path which is the URI.