korypostma / BlackSpace

3 stars 3 forks source link

No Settings for BlackSpace 2019 #5

Closed nurbles closed 1 year ago

nurbles commented 1 year ago

I've been using the "new" BlackSpace 2019 and it appears to work great, except for one thing: I cannot find any settings to control it. Before it needed to be split from the original package, I was able to choose the color of trailing spaces and tabs and enable an option to trim trailing whitespace when a file was saved. I'm not especially fond of the default colors and I must manually remove trailing spaces, since I cannot find the settings. Is there now an INI file or some registry settings that I can tweak or something?

korypostma commented 1 year ago

I have been looking at this for the past 7 hours and trying to actually fix both 2019 and 2022 versions. I'm about at my wit's end. The old settings used to be saved in the Registry and that no longer seems to be the case. In addition, the colors are no longer being properly loaded because I had an old workaround in there to fix the loading of colors and that seems to no longer be necessary, at least with 2022. I have learned a lot but still running into an issue where the extension loads in VS2019, but nothing works and there is no Options DialogPage. I have no idea what is going on with VS2019, but it is just plain not working and not even trying to load the extension.

If you want you can try looking for the settings here, this is where they used to be stored:

HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\16.0

Source: https://learn.microsoft.com/en-us/dotnet/api/microsoft.visualstudio.shell.dialogpage.savesettingstostorage?view=visualstudiosdk-2022

nurbles commented 1 year ago

FWIW, the VSColorOutput extension author has figured out a way to save his settings in a text file in the %AppData% folder. Perhaps that might be a viable workaround. Also, I don't see anything that could be BlackSpace settings at that registry location, but perhaps I didn't look in the correct branch? (The 16.0 top branch had nothing but the (Default) item.) Here's what I see in the ExtensionManager branch, which seemed like the only likely place to look: 16 0 I wish I could offer to help, but I know nothing at all about creating/writing/maintaining VS extensions, sorry. Your work is appreciated... is there any way to make a donation or something to show my appreciation?

korypostma commented 1 year ago

Yes, I have been struggling with finding out where the settings are stored and I really cannot find them or anything online for where they are stored. They keep referring to the above but there is nothing. Also, thanks for the info about the VSColorOutput, I love that extension and use it myself. I have been working on this all last night and this morning as well and have basically rewritten large parts of it. I'm using this now to save and load the settings, but still have no idea where they are saved: var settingsManager = new ShellSettingsManager(ServiceProvider.GlobalProvider); userSettingsStore = settingsManager.GetWritableSettingsStore(SettingsScope.UserSettings);

A buddy of mine also pointed me out to this as another way of storing settings and I'm thinking of having both options, 'Internal' (the above method) and 'External' (save to file method): https://github.com/madskristensen/ThemeSwitcher/blob/master/src/ThemeStore.cs

I also went back to the 1.2.0 codebase and started fresh from there because I know it used to work (although colors are still not saving properly, so I'm now saving all of the settings myself).

Thanks for the offer of a donation, I personally do not need the money and I donate here, they can use it more than I can: https://www.unbound.org/

korypostma commented 1 year ago

Please see here for the latest 1.3.3 release, plus it should be updated now on the VS Marketplace: https://github.com/korypostma/BlackSpace/releases/tag/VS2019_1.3.3