瀏覽代碼

DocRegistry FileType pattern matching doesn't work

The pattern matching for discovering a filetype in the docregistry
has the match call inversed. This feature seems to have always been
broken since being added 4 years ago, it was probably missed since
the feature is not used in core.
Alex Bozarth 4 年之前
父節點
當前提交
74811ad7a8
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      packages/docregistry/src/registry.ts

+ 1 - 1
packages/docregistry/src/registry.ts

@@ -663,7 +663,7 @@ export class DocumentRegistry implements IDisposable {
 
     // Look for a pattern match first.
     let ft = find(this._fileTypes, ft => {
-      return !!(ft.pattern && ft.pattern.match(name) !== null);
+      return !!(ft.pattern && name.match(ft.pattern) !== null);
     });
     if (ft) {
       fts.push(ft);