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

Previewer is not available after successful build of project on Linux #117

Open
Apisteftos opened this issue Feb 22, 2024 · 3 comments
Open
Labels
bug Something isn't working

Comments

@Apisteftos
Copy link

Bug

Hello I am trying to preview just a simple welcome to Avalonia project but it seems that preview button doesn't work.

To Reproduce

Steps to reproduce the behavior:

  1. Build the project dotnet build
  2. Go to MainWindow.axaml or App.axaml
  3. Click on the Show Preview
  4. Throws an error: Previewer is not available. Build the project first.
  5. Type dotnet run works fine.
  6. Restart the VScode same issue
  7. Re-open folder does't work

Expected behavior

Working Show Preview

Environment

  • OS: Linux (Ubuntu 22.04.1 LTS)
  • Avalonia-Version: [0.0.31]
@Apisteftos Apisteftos added the bug Something isn't working label Feb 22, 2024
@MikeCodesDotNET MikeCodesDotNET transferred this issue from AvaloniaUI/Avalonia Feb 22, 2024
@tofferteves
Copy link

@Apisteftos would you like to try a workaround? I had a similar issue in MacOS. you can edit directly the extension inside the .vscode folder

Previewer is not available

@lukewire129
Copy link

I updated the post at the end
Check it out!

@wl2776
Copy link

wl2776 commented Dec 27, 2024

Same here.

  • OS: Linux Ubuntu 24.04
  • Avalonia for VSCode version: 0.0.31

I have tried a workaround suggested by @tofferteves, and it doesn't work.

I have added a line, calling previewerAssetCommand, to out/commands/ShowPreviewToSideCommand.js:

    async execute(mainUri, allUris) {
        const activeFile = mainUri ?? vscode.window.activeTextEditor?.document.uri;
        await vscode.commands.executeCommand(Utilities_1.AppConstants.previewerAssetsCommand);   // <<-- test to force update the workspace

I had to add Utilities_1., because AppConstants was undefined.

After adding this line, on the first attempt, there was a rotating indicator on the status line of VSCode in the bottom.

However, no preview has appeared, and the Command palette now doesn't show Avalonia: Show preview

image

log
2024-12-27 17:14:52.185 [info] Creating language service
2024-12-27 17:14:53.123 [info] Starting Avalonia Language Server...
2024-12-27 17:14:53.139 [info] [Trace - 5:14:53 PM] Sending request 'initialize - (0)'.
2024-12-27 17:14:54.165 [info] [Trace - 5:14:54 PM] Received response 'initialize - (0)' in 1026ms.
2024-12-27 17:14:54.165 [info] [Trace - 5:14:54 PM] Sending notification 'initialized'.
2024-12-27 17:14:54.168 [info] [Trace - 5:14:54 PM] Sending notification 'workspace/didChangeConfiguration'.
2024-12-27 17:14:54.510 [info] [Trace - 5:14:54 PM] Received request 'client/registerCapability - (1)'.
2024-12-27 17:14:54.510 [info] [Trace - 5:14:54 PM] Sending response 'client/registerCapability - (1)'. Processing request took 1ms
2024-12-27 17:14:54.556 [info] [Trace - 5:14:54 PM] Received request 'workspace/configuration - (2)'.
2024-12-27 17:14:54.556 [info] [Trace - 5:14:54 PM] Sending response 'workspace/configuration - (2)'. Processing request took 1ms
2024-12-27 17:14:54.681 [info] [Trace - 5:14:54 PM] Received request 'workspace/configuration - (3)'.
2024-12-27 17:14:54.681 [info] [Trace - 5:14:54 PM] Sending response 'workspace/configuration - (3)'. Processing request took 1ms
2024-12-27 17:15:00.160 [info] [Trace - 5:15:00 PM] Sending notification 'textDocument/didOpen'.
2024-12-27 17:15:00.223 [info] [Trace - 5:15:00 PM] Received request 'workspace/configuration - (4)'.
2024-12-27 17:15:00.223 [info] [Trace - 5:15:00 PM] Sending response 'workspace/configuration - (4)'. Processing request took 0ms
2024-12-27 17:15:00.281 [info] [Trace - 5:15:00 PM] Received notification 'window/logMessage'.
2024-12-27 17:15:00.281 [info] [Info  - 5:15:00 PM] AvaloniaLanguageServer.Handlers.TextDocumentSyncHandler: ** DidOpenText: file:///home/wl2776/util/sourcegit/src/Views/DiffView.axaml | Uri='file:///home/wl2776/util/sourcegit/src/Views/DiffView.axaml'
2024-12-27 17:15:01.806 [info] Command avalonia.previewProcess, file:///home/wl2776/util/sourcegit/src/Views/DiffView.axaml
2024-12-27 17:15:09.026 [info] Command avalonia.previewProcess, file:///home/wl2776/util/sourcegit/src/Views/DiffView.axaml
2024-12-27 17:15:12.149 [info] [EXT - INFO] Solution data path path: /tmp/SourceGit.sln.json
2024-12-27 17:15:12.180 [info] parser process args: /bin/sh,-c,dotnet "/home/wl2776/.vscode/extensions/avaloniateam.vscode-avalonia-0.0.31/solutionParserTool/SolutionParser.dll" "/home/wl2776/util/sourcegit/SourceGit.sln"
2024-12-27 17:15:28.690 [info] Command avalonia.previewProcess, file:///home/wl2776/util/sourcegit/src/Views/DiffView.axaml
2024-12-27 17:15:34.682 [info] [EXT - INFO] Solution data path path: /tmp/SourceGit.sln.json
2024-12-27 17:15:34.721 [info] parser process args: /bin/sh,-c,dotnet "/home/wl2776/.vscode/extensions/avaloniateam.vscode-avalonia-0.0.31/solutionParserTool/SolutionParser.dll" "/home/wl2776/util/sourcegit/SourceGit.sln"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants