antfu / vscode-file-nesting-config

Config of File Nesting for VS Code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Extension] Respect existing choice for "fileNesting.expand" or make it a setting to respect it

andrewbrey opened this issue · comments

First of all, thank you very much for the extension, the idea, and all of your work generally in the JS ecosystem!

In 11f3dc5 the code which checked for the presence of an existing settings for explorer.experimental.fileNesting.expand was removed in favor of always setting it to false.

I may be in the minority given the reason this extension exists in the first place, but I actually prefer to see all of the files by default (i.e. explorer.experimental.fileNesting.expand=true) with the ability to collapse the nesting trees down if I feel overwhelmed.

An ideal outcome to me would be to make "respect existing explorer.experimental.fileNesting.expand selection" an extension setting for File Nesting Updater so that the extension does not override how I have this nesting setting set (also, personally fine if my preference here is not the default, because as I said, I suspect I'm in the minority here).

Alternatively, one could argue that the extension just shouldn't touch this user setting - if a user has it set, or not, it's up to them. This leads to a solution which deletes code and introduces no added maintenance burden. Could also just note that this is a setting users might want to check on in the README and call that good?

For reference, here is a video demonstration of how invocation of the File Nesting Updater update command changes the value of explorer.experimental.fileNesting.expand:

2022-03-15_21-16-21.mp4

Yeah, I totally agree with that. However, I am not sure how to do it, since the get config will return the default value if it's not set, which means we don't know whether the value is from the default or users' explicit config. The solution I could come up with currently is that we only set the value on the first update, and leave it untouched for the future. Or, do you have any better idea? Either way, PR welcome!

Either way, PR welcome!

Thanks @antfu - I've opened #75 to address this. Cheers!