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

Custom Labels: improve ${extname} when file includes multiple extensions #210166

Open
kylepg opened this issue Apr 11, 2024 · 3 comments · May be fixed by #213033
Open

Custom Labels: improve ${extname} when file includes multiple extensions #210166

kylepg opened this issue Apr 11, 2024 · 3 comments · May be fixed by #213033
Assignees
Labels
feature-request Request for new features or functionality workbench-custom-labels Issues related to Workbench Editor Custom Labels
Milestone

Comments

@kylepg
Copy link

kylepg commented Apr 11, 2024

Workbench › Editor › Custom Labels: Patterns

Currently, ${filename} only drops everything after the last ., but it would be nice if you could drop everything after the first . when needed.

For example, I would like foo.blade.php to be displayed as foo rather than foo.blade.

@benibenj
Copy link
Contributor

benibenj commented Apr 12, 2024

One option could be to have ${filename} only include the name until the first . and ${extname} could include everything after.
So for foo.blade.php:

  • ${filename}: foo
  • ${extname}: blade.php

Another option could be to have ${filename} only include the name until the first . and ${extname} include only the last extension. This would still allow users to add rules to cover the cases with the double extensions and I would assume users do not have many different combinations of double extensions that they work with so it wouldn't be to cumbersome to add.
So for foo.blade.php:

  • ${filename}: foo
  • ${extname}: php

@benibenj benibenj added workbench-tabs VS Code editor tab issues feature-request Request for new features or functionality labels Apr 18, 2024
@VSCodeTriageBot VSCodeTriageBot added this to the Backlog Candidates milestone Apr 18, 2024
@VSCodeTriageBot
Copy link
Collaborator

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@bsShoham
Copy link
Contributor

It might be a little unconventional, but I made a pull request for it, before it has been voted in, in which I added a template variable called filenamePart which accepts a number and returns the nth part of the filename including the extension separated by ., for example a.b.c.d with the pattern "${filenamePart(1)}-${filenamePart(2)}-${filenamePart(3)}-${filenamePart(4)}" would become a-b-c-d
#213033

@benibenj benibenj modified the milestones: Backlog Candidates, Backlog May 22, 2024
@benibenj benibenj changed the title Custom Labels: add option for double extensions in ${filename} Custom Labels: improve ${extname} when file includes multiple extensions May 24, 2024
@benibenj benibenj added workbench-custom-labels Issues related to Workbench Editor Custom Labels and removed workbench-tabs VS Code editor tab issues labels May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality workbench-custom-labels Issues related to Workbench Editor Custom Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants