-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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 (customLabels
) Not Escaping Properly - Backslash Doesn't Work
#223107
Comments
I believe this is a limitation we are not able to fix easily, @bpasero do you know if we have a way to escape |
I think not. vscode/src/vs/base/common/glob.ts Line 112 in 5014de6
|
@babakfp there might be another way to match the [], but it is a bit hacky. I was able to match the file You would probably use |
Thank you, @benibenj. Your solution worked perfectly! This solves the issue for this specific use case, so if needed, feel free to close the issue. This is my config for SvelteKit {
"workbench.editor.customLabels.patterns": {
"**/+*.*": "${dirname}/${filename}.${extname}",
"**/[[]*[]]/+*.*": "${dirname(1)}/${dirname(0)}/${filename}.${extname}",
"**/routes/+*.*": "${filename}.${extname}"
},
} Result:
SEO: Svelte, SvelteKit, Astro, customLabels, Bracket, Brackets, [*], [id], [slug], [...slug], React, Next, NextJS, Next.js |
related #213117 |
Hi 👋
#213117
The goal is to match a string that contains
[]
with whatever inside it. But because of the backslash (\
) limitation, this is not possible.Using something like
**/?...slug?.astro
is not a good solution because[]
may contain any words (with or without...
).This regex escape limitation is present in other places in vsCode too.
If this issue gets fixed, I can do something like this in my vsCode config:
@benibenj
The text was updated successfully, but these errors were encountered: