Closed Mrcubix closed 9 months ago
is it possible to share a sample project to reproduce this issue?
Does the Avalonia Client log print the path of the solution data JSON file? Search for "Solution data path" and–if you're comfortable with sharing some of your solution and project info–attach the JSON file here.
Chances are it's incomplete or incorrectly formatted.
Here is the json filer in question after building once. As for the repo i'm using to achieve this error, it's currently private for now, would me sending an invite be fine?
The JSON file is in perfect condition. Completely valid for Node's JSON.parse() function (which is oddly picky when it comes to stuff like trailing commas).
However, I do know where exactly the exception is coming from.
https://github.com/AvaloniaUI/AvaloniaVSCode/blob/main/src/vscode-avalonia/src/services/solutionParser.ts#L113:~:text=const%20jsonContent%20=%20data.toString();
https://github.com/AvaloniaUI/AvaloniaVSCode/blob/24f11444d5e3065717154c2cfda3fd942520edfb/src/vscode-avalonia/src/services/solutionParser.ts#L112-L116
And it's a race condition.
The dotnet process hosting the SolutionParser DLL begins writing the solution data JSON to stdout
. The extension notices the new data and immediately begins parsing it...without checking if it's finished yet. Smaller solutions yield less data so their JSON data is completely written to stdout
before the extension begins parsing the data.
Duplicate of #75, btw
@Mrcubix could you invite me to the repo. I can see the JSON is all good It's probably the race condition like @BinToss mentioned
Done, should be able to access https://github.com/Mrcubix/Touch-Gestures, i have provided an ISSUES.md file there containing files you can reproduce the issue for
@Mrcubix thanks for share the repo. I think I have fixed it, could you give this a try and let me know please? https://www.dropbox.com/scl/fi/w64l2d80kqa9dsbnn2sh1/vscode-avalonia-0.0.31.vsix?rlkey=9d2vh4ugukro39gktljkywqgu&dl=1
Will start testing nlw in this project and a couple more and i will let you know
It seem like previews work in simple cases.
Although i have found a couple issues:
For instance, while i was trying to preview BindingsOverview, GestureSelectionScreen, TapSetup & SwipeSetup, i was missing a parameterless constructor.
<Design.PreviewWith>
<views:BindingsOverview Background="{StaticResource BodyColorBrush}" />
</Design.PreviewWith>
This seems to silently fail with a long stacktrace looking at avalonia's logs.
https://github.com/AvaloniaUI/AvaloniaVSCode/assets/39861216/31906777-a1b0-4237-91a6-9cbbe5868f11
Other than those, as of right now, work about as expected when sticking to simple previews:
GestureTile :
BindingsOverview :
BindingSlectionScreen :
TapSetup :
Swipe Setup :
Thanks for trying it out. I will close this issue. You can file a new one issue for
Currently, it seems like the extension will fail silently if the compilation fail or an unhandled error occur.
Describe the bug
The previewer refuses to work in a more complex project, this has been the same since 11.0.4
No errors appear in the output section of vscode, and you have to check the developer console to find these errors:
Sometimes, it's stuck at the 127 character like this, sometimes at the 12680th character, or around something like that.
To Reproduce
Avalonia for VS Code
v0.0.27
Avalonia version
11.0.4 - 11.0.7
VS Code version
1.85.2
Relevant log output
Additional context