oleg-shilo / Favorites.vscode

VSCode extension for managing Favorites
MIT License
23 stars 6 forks source link

Allow ~ for C:\Users\<username> #2

Closed Memphizzz closed 6 years ago

Memphizzz commented 6 years ago

Hi,

first of all thanks for this great extension! I would like to know it if would be possible to have a variable like ~ to be resolved to the users home folder for example. This way I could change the entries in my favorites.txt to look like this ~\Documents\whatever.txt and use them accros multiple computers.

Keep up the great work!

oleg-shilo commented 6 years ago

Thank you. I am happy that you liked the extension.

As for your suggestion I thing the better approach would be to use expandable environment variables:

%userprofile%\Documents\whatever.txt

Just to be more consistent with traditional user experiences with FS.

Will be done in the next release.

Memphizzz commented 6 years ago

Would these work on Linux as well? Folders like Dropbox usually located in the user's home directory would work then as well..

oleg-shilo commented 6 years ago

Yes. Though Linux has it's own set of envars.

Memphizzz commented 6 years ago

Yeah, maybe if the extension had its own variables for specific folders (eg \<home>) and handles those accordingly to the operating system?

oleg-shilo commented 6 years ago

It does not feel right though. What you are proposing is the design when the extension becomes a File System and OS aware solution. And this is a truly wrong role for an extension. The scope of responsibilities of any extension ends at the boundaries of the extension host.

You can achieve the desired behavior by simply defining your own variables and then freely using them as you want:

OS settings:
set home=c:\users\user

Favorites file:
$home\Documents\whatever.txt
Memphizzz commented 6 years ago

I see, sounds great. Looking forward to the update.

Memphizzz commented 6 years ago

Awesome, works like a charm! Thanks!