Closed richarddavenport closed 4 years ago
Very nice, I like it.
But since you're already touching this: why not make it "list of characters" or go straight to "configurable regular expression"?
For most cases going with /\W/
would work nicely I think...
It actually does work that way. It's just using the split method, which can handle those cases: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split I think the documentation could just be updated.
While the split
method of String
does take a RegExp
as first parameter, your groupSeparator
constant seems to be of type string.
Hmm, good point. The vscode api doesn't look like it supports regex out of the box. We would need to detect if it was a regex. Do you think that you have a use case for that? I think it would be nice if @spmeesseman could approve this first and then could enhance it later.
hi, sorry for the delay, ill get to this PR as soon as I have a chance
oh and thank you btw
@richarddavenport detecting whether or not to use a regex should not be hard.
If groupSeparator
is not a single char, make it a regexp.
If it starts and ends with /
use the part in between as is, otherwise use it as character selection:
rx = new RegExp(`[${groupSeparator}]`)
Or add another checkbox for any non-word char
as setting, since I suspect the most probably usecase will be /\W/
.
@ray007 I completely understand, but I'd really like to get this in now, as it stand now, and then enhance it. My personal use case is to just need to it to split on a colon, which seems like your original request on 102.
@ray007 - and of course, when i finallly get a chance to pull your change in that ive been wanting to do for awhile, the Azure Pipelines is down and theres an Advisory that they had an "accident" and to watch the advisory boards for more info. Figures. In any case, finally got this in. Pipeline will run at some point today i assume... thanks for your contrib!!!
@spmeesseman thanks for merging!
:tada: This PR is included in version 1.27.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
I love the dashed groups, but some of my projects use a color (":").
This PR: