-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
Problem with CSharpier - Code Format (VSCode Extension) #1114
Comments
I believe the problem has to do with I'm not familiar with Linux, so I don't know if the workaround for macOS from that issue also applies. You also may be able to use this setting I added for testing the extensions as a workaround. It will keep the application running from that location but I believe that is only a problem with windows.
|
Hi @belav
It's a problem with the extension to find the global csharpier because with a local installation it also works |
Hey @evertonandrade I have ubuntu set up now and am digging into this. If you run And by chance do you have any of the following set?
|
@belav in my settings.json (ctrl + shift + p > Preferences: Open User Settings (JSON), i don't have: "dotnet.dotnetPath": "",
"dotnetAcquisitionExtension.existingDotnetPath": [ "" ],
"omnisharp.sdkPath": "" |
@evertonandrade I have these changes mostly done, I just want to do some more testing. I was going to install arch linux because I believe it may handle PATH a bit differently than ubuntu, but it didn't seem like a straightforward install. I'm hoping the new beta will find dotnet automatically for you but if not the extension now supports setting If you have a chance to try it out let me know if it is working. |
@belav , I've been investigating and found the problem. For some reason, process.env.PATH when called from running a vscode extension does not show me the full PATH of my system. However, in another testing playground for nodejs I have the complete result: Another test I did was run vscode as root user
I still have no idea why this behavior happens. |
@evertonandrade Did the c# extension continue to work? I pulled in some code from that, and they don't appear to be doing anything out of the ordinary when trying to locate Someone had mentioned that running |
The problem is not dotnet. The C# (Microsoft) extension is working fine. The problem is the installed tools that can only be called when they are in the PATH. |
Environments
Log Output
["ERROR" - 7:41:38 PM] CSharpier was not found so files may not be formatted.
["INFO" - 7:41:38 PM] 1
["INFO" - 7:41:40 PM] Formatting started for /home/everton/Dev/playgrounds/CSharpPlayground/Program.cs.
["DEBUG" - 7:41:40 PM] /home/everton/.vscode/extensions/csharpier.csharpier-vscode-1.5.2/build
["DEBUG" - 7:41:40 PM] /home/everton/.vscode/extensions/csharpier.csharpier-vscode-1.5.2/build
["DEBUG" - 7:41:40 PM] Ensure there is a csharpier process for /home/everton/Dev/playgrounds/CSharpPlayground
["DEBUG" - 7:41:40 PM] Looking for /home/everton/Dev/playgrounds/CSharpPlayground/.csproj
["DEBUG" - 7:41:40 PM] Looking at /home/everton/Dev/playgrounds/CSharpPlayground/CSharpPlayground.csproj
["DEBUG" - 7:41:40 PM] Looking for /home/everton/Dev/playgrounds/CSharpPlayground/.config/dotnet-tools.json
["DEBUG" - 7:41:40 PM] Looking for /home/everton/Dev/playgrounds/.csproj
["DEBUG" - 7:41:40 PM] Looking for /home/everton/Dev/playgrounds/.config/dotnet-tools.json
["DEBUG" - 7:41:40 PM] Looking for /home/everton/Dev/.csproj
["DEBUG" - 7:41:40 PM] Looking for /home/everton/Dev/.config/dotnet-tools.json
["DEBUG" - 7:41:40 PM] Looking for /home/everton/.csproj
["DEBUG" - 7:41:40 PM] Looking for /home/everton/.config/dotnet-tools.json
["DEBUG" - 7:41:40 PM] Looking for /home/.csproj
["DEBUG" - 7:41:40 PM] Looking for /home/.config/dotnet-tools.json
["DEBUG" - 7:41:40 PM] Looking for //.csproj
["DEBUG" - 7:41:40 PM] Looking for /.config/dotnet-tools.json
["DEBUG" - 7:41:40 PM] Unable to find dotnet-tools.json, falling back to running dotnet csharpier --version
["DEBUG" - 7:41:41 PM] dotnet csharpier --version failed with Could not execute because the specified command or file was not found.
Possible reasons for this include:
["ERROR" - 7:41:41 PM] CSharpier was not found so files may not be formatted.
["INFO" - 7:41:41 PM] 1
["DEBUG" - 7:41:41 PM] returning NullCSharpierProcess because there was no csharpierProcessesByVersion for
["DEBUG" - 7:41:41 PM] Skipping formatting because this is a NullCSharpierProcess. This generally indicates there was a problem starting the CSharpier process
["INFO" - 7:41:41 PM] Formatted in 860.4347350001335ms
["DEBUG" - 7:41:41 PM] result is empty
Steps to reproduce
Expected behavior
It was expected that with the tool installed globally, formatting would work, but this does not happen.
The extension only works with local installation
Actual behavior
![image](https://private-user-images.githubusercontent.com/43795982/294721447-13259e97-80ff-48d4-8fed-70f333e164d9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkxNDIzNDAsIm5iZiI6MTcxOTE0MjA0MCwicGF0aCI6Ii80Mzc5NTk4Mi8yOTQ3MjE0NDctMTMyNTllOTctODBmZi00OGQ0LThmZWQtNzBmMzMzZTE2NGQ5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjIzVDExMjcyMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWVhZjEyM2IxZjI4YzFlYmQ2MWVkYzIzMjU1NDc4NDcxZDViNTU4ODg0ZDJmOTIzZjljM2ZhZTIyOTM1OGJlNTMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.E4h2rxyEyW_nQManLzSa9flo-38VyXTJZ-BoizC2e8M)
With global installation it is not possible to use the extension, even passing the correct path to dotnet-csharpier
The text was updated successfully, but these errors were encountered: