Full regex support in lookaheads (or at least \n and \s)
See original GitHub issueSometimes, for the sake of formatting my code to look nice, I like to add a new line immediately after the template literal tick. For example:
const test = await client.query(`
select * from test
`)
Obviously this simple example does not need the new line (or I could have escaped before the tick), but larger queries often do to maintain alignment. No matter what I try, I cannot get the lookahead to match the whitespace because \s
results in a JSCustom error “invalid escape character” .
I have tried "[\n\t ]*select"
which will happily match spaces and tabs, but not the new line.
Also, your example in the config settings select\b
does not match a template string select 1 from dual
.
I find it strange that some regex works, but others don’t. Personally, whitespace matching would solve my problem, but it seems sensible to parse all valid regex.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:11 (6 by maintainers)
Top GitHub Comments
There’s an easy way: in your Package Control settings, add:
Or add
"JSCustom"
to the array if it already exists.Sorry for the slow reply and excuse my ignorance, but I’m not sure how to install the beta.
What I am doing:
.zip
and renaming the file extension to.sublime-package
Browse Packages
Installed Packages
folder.This doesn’t seem to change anything, the packages shows without a version and description if I list packages and it refuses to open the settings. Obviously I am doing something wrong here, but I am not sure what.