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

No preview of .adoc files when open remote repository in VS Code Web #805

Closed
OldKrab opened this issue Oct 22, 2023 · 3 comments · Fixed by #806
Closed

No preview of .adoc files when open remote repository in VS Code Web #805

OldKrab opened this issue Oct 22, 2023 · 3 comments · Fixed by #806
Labels

Comments

@OldKrab
Copy link

OldKrab commented Oct 22, 2023

When i open remote repository from github on vscode.dev, the preview of .adoc files is not displayed:

Screenshot

image

If refresh page at this state, we can see error message in Preview window:

Screenshot

image

When i create new empty file without saving it as a real file, preview works fine, until i save it:

Screenshot

image

Steps to reproduce:

  1. Open vscode.dev
  2. Click "Open Remote Repository" in Explorer panel
  3. Click "Open Repository from Github" and select any repo
  4. Open any .adoc file and click Preview button
@ggrossetie
Copy link
Member

I can reproduce this issue. The underlyon error seems to be:

D.P.onmessage @ webWorkerExtensionHost.ts:213
extHostFileSystemConsumer.ts:241 Uncaught (in promise) Unavailable (FileSystemError): Error: No file system handle registered (/asciidoctor)
	at p.e (../../../vs/workbench/api/worker/extensionHostWorker.js:82:27804)
	at Object.stat (../../../vs/workbench/api/worker/extensionHostWorker.js:82:24551)
e @ extHostFileSystemConsumer.ts:241
stat @ extHostFileSystemConsumer.ts:60
Promise.then (async)
step @ preview.ts:3
fulfilled @ preview.ts:3
Promise.then (async)
step @ preview.ts:3
eval @ preview.ts:3
__awaiter @ preview.ts:3
doUpdate @ preview.ts:355
update @ preview.ts:253
preview @ previewManager.ts:62
eval @ showPreview.ts:41
eval @ showPreview.ts:3
__awaiter @ showPreview.ts:3
showPreview @ showPreview.ts:22
execute @ showPreview.ts:56
h @ extHostCommands.ts:248
$executeContributedCommand @ extHostCommands.ts:313
S @ rpcProtocol.ts:456
Q @ rpcProtocol.ts:441
M @ rpcProtocol.ts:371
L @ rpcProtocol.ts:297
eval @ rpcProtocol.ts:161
z @ event.ts:1138
fire @ event.ts:1169
s.port1.onmessage @ extensionHostWorker.ts:195
commons-app~pfHelper-HttpManager.js.5254ed0a698fdcccc447.js:1 

@ggrossetie
Copy link
Member

I found the root cause, the AsciidoctorConfig feature is not compatible with VS Code Web. More precisely, this line:

await vscode.workspace.fs.stat(uri)

@ggrossetie
Copy link
Member

We should probably mimick what the Markdown extension is doing with a dedicated entry point for the web/browser extension:

https://github.com/microsoft/vscode/blob/main/extensions/markdown-language-features/src/extension.browser.ts

That way we can decide which feature we want to enable on the web/browser extension.

ggrossetie added a commit to ggrossetie/asciidoctor-vscode that referenced this issue Oct 24, 2023
ggrossetie added a commit to ggrossetie/asciidoctor-vscode that referenced this issue Oct 24, 2023
ggrossetie added a commit that referenced this issue Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants