Open HrvojeJuric opened 1 year ago
I grabbed your repo + used the settings file and formatting is working for me. Does the output - CSharpier window provide any clues on why it takes so long? And does it eventually finish?
I'm guessing the problem is either a conflict with another extension, or perhaps the extension is unhappy if you are doing remote ssh work. I did make some changes to detect when devcontainers, it could be a similar problem with remote ssh - https://github.com/belav/csharpier/commit/0a58405baf1070cfb387ddfa60d96eda68d4b17b
If it is a conflict with an extension, then hopefully the output window provides some useful information.
@belav I guess the author used WSL 2 to code. May you have a try with WSL 2? I encountered the same problem with it, and by the way, running dotnet csharpier
directly in WSL terminal seems fine.
Edit:
I got this output while initialization:
Exception while running 'dotnet csharpier --version' in /home/akiravoid/.cache/csharpier/0.25.0
"You must install .NET to run this application.
App: /home/akiravoid/.cache/csharpier/0.25.0/dotnet-csharpier
Architecture: x64
App host version: 8.0.0-rc.2.23479.6
.NET location: Not found
Learn more:
https://aka.ms/dotnet/app-launch-failed
Download the .NET runtime:
https://aka.ms/dotnet-core-applaunch?missing_runtime=true&arch=x64&rid=linux-x64&os=ubuntu.20.04&apphost_version=8.0.0-rc.2.23479.6
"
I guess that this may be caused by wrong .NET version. But I have installed 7.0 and 6.0 on my Linux distro, and it still get this exception.
And this command is executed here: https://github.com/belav/csharpier/blob/4e4bb4dd425f9d2b8b94c34b0593289b9b11c05c/Src/CSharpier.VSCode/src/CustomPathInstaller.ts#L13-L47
Edit:
I got a full debug log:
["INFO" - 5:47:42 PM] Initializing csharpier-vscode
["INFO" - 5:47:53 PM] Formatting started for /home/akiravoid/projects/animaid-core/lib/AkiraVoid.Animaid.Core/Enums/ActorType.cs.
["DEBUG" - 5:47:53 PM] Ensure there is a csharpier process for /home/akiravoid/projects/animaid-core/lib/AkiraVoid.Animaid.Core/Enums
["DEBUG" - 5:47:53 PM] Looking for /home/akiravoid/projects/animaid-core/lib/AkiraVoid.Animaid.Core/Enums/*.csproj
["DEBUG" - 5:47:53 PM] Looking for /home/akiravoid/projects/animaid-core/lib/AkiraVoid.Animaid.Core/Enums/.config/dotnet-tools.json
["DEBUG" - 5:47:53 PM] Looking for /home/akiravoid/projects/animaid-core/lib/AkiraVoid.Animaid.Core/*.csproj
["DEBUG" - 5:47:53 PM] Looking at /home/akiravoid/projects/animaid-core/lib/AkiraVoid.Animaid.Core/AkiraVoid.Animaid.Core.csproj
["DEBUG" - 5:47:53 PM] Looking for /home/akiravoid/projects/animaid-core/lib/AkiraVoid.Animaid.Core/.config/dotnet-tools.json
["DEBUG" - 5:47:53 PM] Looking for /home/akiravoid/projects/animaid-core/lib/*.csproj
["DEBUG" - 5:47:53 PM] Looking for /home/akiravoid/projects/animaid-core/lib/.config/dotnet-tools.json
["DEBUG" - 5:47:53 PM] Looking for /home/akiravoid/projects/animaid-core/*.csproj
["DEBUG" - 5:47:53 PM] Looking for /home/akiravoid/projects/animaid-core/.config/dotnet-tools.json
["DEBUG" - 5:47:53 PM] Found version 0.25.0 in /home/akiravoid/projects/animaid-core/.config/dotnet-tools.json
["WARN" - 5:47:53 PM] Exception while running 'dotnet csharpier --version' in /home/akiravoid/.cache/csharpier/0.25.0
"You must install .NET to run this application.\n\nApp: /home/akiravoid/.cache/csharpier/0.25.0/dotnet-csharpier\nArchitecture: x64\nApp host version: 8.0.0-rc.2.23479.6\n.NET location: Not found\n\nLearn more:\nhttps://aka.ms/dotnet/app-launch-failed\n\nDownload the .NET runtime:\nhttps://aka.ms/dotnet-core-applaunch?missing_runtime=true&arch=x64&rid=linux-x64&os=ubuntu.20.04&apphost_version=8.0.0-rc.2.23479.6\n"
["DEBUG" - 5:47:53 PM] Removing directory at /home/akiravoid/.cache/csharpier/0.25.0 because it appears to be corrupted
["DEBUG" - 5:47:57 PM] Adding new version 0.25.0 process for /home/akiravoid/projects/animaid-core/lib/AkiraVoid.Animaid.Core/Enums
["DEBUG" - 5:47:57 PM] Warm CSharpier with initial format
Output of dotnet --info
on my WSL distro:
.NET SDK:
Version: 8.0.100-rc.2.23502.2
Commit: 0abacfc2b6
Runtime Environment:
OS Name: ubuntu
OS Version: 20.04
OS Platform: Linux
RID: linux-x64
Base Path: /home/akiravoid/.dotnet/sdk/8.0.100-rc.2.23502.2/
.NET workloads installed:
There are no installed workloads to display.
Host:
Version: 8.0.0-rc.2.23479.6
Architecture: x64
Commit: 0b25e38ad3
.NET SDKs installed:
6.0.415 [/home/akiravoid/.dotnet/sdk]
7.0.402 [/home/akiravoid/.dotnet/sdk]
8.0.100-rc.2.23502.2 [/home/akiravoid/.dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.23 [/home/akiravoid/.dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.12 [/home/akiravoid/.dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.0-rc.2.23480.2 [/home/akiravoid/.dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.23 [/home/akiravoid/.dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.12 [/home/akiravoid/.dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.0-rc.2.23479.6 [/home/akiravoid/.dotnet/shared/Microsoft.NETCore.App]
Other architectures found:
None
Environment variables:
Not set
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
I made a startup vscode extension project with yo code
, added these lines:
let dotnet: Buffer;
try {
dotnet = execSync("dotnet csharpier --version", {
cwd: "/home/akiravoid/projects/animaid-core",
env: process.env,
});
} catch (error) {
console.error(error);
throw error;
}
console.log(dotnet.toString("utf-8"));
It prints 0.25.0, which is expected.
Been experiencing this on a work repo but I've been getting this:
on this repro.
I have these extensions installed:
And these settings:
.csharpier.yaml
:Other formatters like
prettier
work just fine (ie. on.csharpier.yaml
).EDIT: fix repro link EDIT2: add other formatter clarification