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

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

Closed
Memphizzz opened this issue Feb 13, 2018 · 7 comments
Closed

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

Memphizzz opened this issue Feb 13, 2018 · 7 comments

Comments

@Memphizzz
Copy link

Memphizzz commented Feb 13, 2018

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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

@Memphizzz
Copy link
Author

Memphizzz commented Feb 13, 2018

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

@oleg-shilo
Copy link
Owner

oleg-shilo commented Feb 13, 2018

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
Copy link
Author

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

oleg-shilo added a commit that referenced this issue Feb 13, 2018
- Implemented extending envars in the path of the item definition (Issue #2).
- Implemented 'command-node' for opening parent folder node. To address usability problems caused by VSCode TreeView item defect (microsoft/vscode/issues/34130 and patrys/vscode-code-outline/issues/24)
@Memphizzz
Copy link
Author

Awesome, works like a charm! Thanks!

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

No branches or pull requests

2 participants