Closed aeschli closed 8 years ago
@aeschli you seem to be using a character which is not the slash character in the glob pattern but rather this one: http://www.marathon-studios.com/unicode/U2215/Division_Slash
Works for me if I replace it with the proper '/'
@bpasero Hm, very strange. I wonder how I ended up with that character. Sorry, I didn't realize this while debugging.
@aeschli no worries, I found some spare slashes on my desktop, attaching here: / / / /
:]
BTW, the regex is now ^(?:[\/\\]|[^\/\\]+[\/\\]|[\/\\][^\/\\]+)*?bower\.json$
which looks rather complicated.
It seems to work but runs in a timeout on a long content (I tried with the default content of http://regexr.com/)
So its a ('separator' or 'everything but a separator followed by a separator' or a 'separator followed by a everything but a separator') repeated and optional. A very complicated way of saying /bower\.json$/
I created #5438 for the complicated regex.
Steps to Reproduce:
In my extension I have a completionItemProvider that is registered like that:
The LanguageFeatureRegistry uses base/common/glob.ts:
glob.match(filter.pattern, uri.fsPath)
globToRegExp
creates the following regex for this:^[^/\\]*?[^/\\]*?∕bower\.json$
which doesn't match a path like "/home/abc/workspaces/samples/languages/json/bower.json"From debugging it seems the bug is in
splitGlobAware
:splitChar is "/", but the case clause is never reached, also not for the
/
characterI also wonder if this works on Windows as uri.fsPath returns a path with
\