You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using this extension with a few simple custom regular expressions in settings.json, e.g. for checking variable names when declaring them for the first time, and those work great and as expected. Today however, I encountered something unexpected when trying to match only the second argument of i18next's t(key, defaultValue) function if it is a string literal:
Instead of just spellchecking what's inside the capture group ([^']*), the whole regex is used for spellchecking, so t(key, gets spellchecked, too. I expected cSpell to only spellcheck what is matched by a capture group, at least if one is present. As a workaround, I now use a lookbehind and a lookahead:
Hey there and thanks for the great extension! 👋
I am using this extension with a few simple custom regular expressions in
settings.json
, e.g. for checking variable names when declaring them for the first time, and those work great and as expected. Today however, I encountered something unexpected when trying to match only the second argument of i18next'st(key, defaultValue)
function if it is a string literal:Instead of just spellchecking what's inside the capture group
([^']*)
, the whole regex is used for spellchecking, sot(key,
gets spellchecked, too. I expected cSpell to only spellcheck what is matched by a capture group, at least if one is present. As a workaround, I now use a lookbehind and a lookahead:I'd appreciate if you'd consider matching only capture groups if present. 🙏
The text was updated successfully, but these errors were encountered: