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

Add TM_FILEPATH_RELATIVE snippet variable #34592

Closed
volosovich opened this issue Sep 18, 2017 · 3 comments
Closed

Add TM_FILEPATH_RELATIVE snippet variable #34592

volosovich opened this issue Sep 18, 2017 · 3 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) snippets

Comments

@volosovich
Copy link

  • VSCode Version: all
  • OS Version: all

I have a lot of snippets for my projects and I often use variables.
TM_FILEPATH - it's good, but sometimes project has very long path, something like:
/home/user/Documents/work/project1/frontEnd/bestUi/src/component/modal/utils/view.js
My root folder in vsCode is bestUi I don't need to print or use all path, just path from root-folder to file:
/bestUi/src/component/modal/utils/view.js,
My proposal is to add new variable, called TM_FILEPATH_RELATIVE, which return, only path from root-folder to file.
If this proposal is being interesting for community, I can implement it, added test for that, add support for multi root-folders and so on,
Just one question, I cannot understand - Where is vsCode saving information about root folder of project?
Thanks a lot for all discussions.

@jrieken
Copy link
Member

jrieken commented Sep 19, 2017

We will add snippet variable transformations in September. That will enable you do insert paths as you wish

@jrieken
Copy link
Member

jrieken commented Sep 19, 2017

closing as dupe of #6920

@jrieken jrieken closed this as completed Sep 19, 2017
@jrieken jrieken added the *duplicate Issue identified as a duplicate of another issue(s) label Sep 19, 2017
@volosovich
Copy link
Author

hello @jrieken I read about Variable Transforms, but I cannot understand how I can implement idea about FILEPATH_RELATIVE
Ok, I can get full path to file and use regexp with hardcoded name of root folder. But what if I load new project (or vscode with multi root). I would need to change my snippet and hardcode new root folder name. And do it every day.
Maybe implement FILEPATH_RELATIVE it's not bad idea.
Thank you for your support and patience.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) snippets
Projects
None yet
Development

No branches or pull requests

3 participants