Kaynağa Gözat

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 yıl önce
ebeveyn
işleme
74811ad7a8
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  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);