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

Enable/Disable with command prompt #1406

Open
Aircross-U-Fly opened this issue Dec 11, 2024 · 1 comment
Open

Enable/Disable with command prompt #1406

Aircross-U-Fly opened this issue Dec 11, 2024 · 1 comment

Comments

@Aircross-U-Fly
Copy link

Issue Template for CSharpier


Environments

  • IDE Version: Visual Studio 2022 Professional 17.0.*
  • Extension Version: CSharpier 1.9.0
  • CSharpier Version: (Not sure how to confirm this; likely tied to the extension)
  • Operating System: Windows 11 22H2
  • .csharpierrc Settings: Default settings
  • .editorconfig Settings: Default settings (no custom configurations)

Log Output

  • No specific logs were found in the %AppData%\Microsoft\VisualStudio\... or similar directories.
  • Attempted to disable the extension using the command ExtensionManager.DisableCSharpier in Visual Studio Command Prompt, but it returned the error:

Steps to reproduce

  1. Install the CSharpier extension in Visual Studio.
  2. Attempt to open multiple solutions simultaneously using a script.
  3. Observe that Visual Studio's performance drops, likely due to CSharpier formatting during the solution loading process.
  4. Attempt to disable the extension programmatically with ExtensionManager.DisableCSharpier.

Expected behavior

  • A valid Visual Studio Command exists to disable CSharpier without manual intervention, particularly when managing large-scale solution-loading scenarios programmatically.

Actual behavior

  • The command ExtensionManager.DisableCSharpier does not exist or is not valid.
  • Visual Studio exhibits performance issues when loading multiple solutions with CSharpier active.

Additional Notes

  • Would it be possible to add a valid command for enabling/disabling CSharpier from a script or programmatically through Visual Studio commands?
  • Alternatively, documentation on how to automate disabling CSharpier for specific scenarios would be helpful.
@belav
Copy link
Owner

belav commented Dec 20, 2024

I'm not aware of any way to disable VS extensions programatically, which would be required for a command to work. You can disable the extension through VS itself using the extension manager. Ideally VS would add a CLI for doing this instead of individual extensions supporting it. It looks like VSCode has some capabilities like that.

The CSharpier extension shouldn't be formatting anything at startup. It will ensure that the proper version of csharpier is installed when a c# file is opened, and if it is not installed that will take some time in the background. I have it on my list to try to improve performance of all of the extensions at startup to make sure they don't slow down the intial sln load but it hasn't been a priority yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants