parent
cf6c74f026
commit
05f97f5dbf
1 changed files with 4 additions and 1 deletions
|
@ -7,6 +7,7 @@ import { distinct, mergeSort } from 'vs/base/common/arrays';
|
|||
import { Event } from 'vs/base/common/event';
|
||||
import * as glob from 'vs/base/common/glob';
|
||||
import { IDisposable, IReference } from 'vs/base/common/lifecycle';
|
||||
import { posix } from 'vs/base/common/path';
|
||||
import { basename } from 'vs/base/common/resources';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { RawContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||
|
@ -96,7 +97,9 @@ export class CustomEditorInfo {
|
|||
|
||||
static selectorMatches(selector: CustomEditorSelector, resource: URI): boolean {
|
||||
if (selector.filenamePattern) {
|
||||
if (glob.match(selector.filenamePattern.toLowerCase(), basename(resource).toLowerCase())) {
|
||||
const matchOnPath = selector.filenamePattern.indexOf(posix.sep) >= 0;
|
||||
const target = matchOnPath ? resource.path : basename(resource);
|
||||
if (glob.match(selector.filenamePattern.toLowerCase(), target.toLowerCase())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue