Skip to content

Commit 2cb96e9

Browse files
committed
💄 fix build.
1 parent 3093f84 commit 2cb96e9

2 files changed

Lines changed: 16 additions & 6 deletions

File tree

src/vs/workbench/contrib/notebook/browser/notebookDiffEditorInput.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import * as nls from 'vs/nls';
7+
import * as glob from 'vs/base/common/glob';
78
import { EditorInput, IEditorInput, GroupIdentifier, ISaveOptions, IMoveResult, IRevertOptions, EditorModel } from 'vs/workbench/common/editor';
89
import { INotebookService } from 'vs/workbench/contrib/notebook/common/notebookService';
910
import { URI } from 'vs/base/common/uri';
@@ -149,11 +150,15 @@ export class NotebookDiffEditorInput extends EditorInput {
149150

150151
if (!provider.matches(target)) {
151152
const patterns = provider.selectors.map(pattern => {
152-
if (pattern.excludeFileNamePattern) {
153-
return `${pattern.filenamePattern} (exclude: ${pattern.excludeFileNamePattern})`;
153+
if (typeof pattern === 'string') {
154+
return pattern;
154155
}
155156

156-
return pattern.filenamePattern;
157+
if (glob.isRelativePattern(pattern)) {
158+
return `${pattern} (base ${pattern.base})`;
159+
}
160+
161+
return `${pattern.include} (exclude: ${pattern.exclude})`;
157162
}).join(', ');
158163
throw new Error(`File name ${target} is not supported by ${provider.providerDisplayName}.
159164

src/vs/workbench/contrib/notebook/browser/notebookEditorInput.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6+
import * as glob from 'vs/base/common/glob';
67
import { EditorInput, IEditorInput, GroupIdentifier, ISaveOptions, IMoveResult, IRevertOptions } from 'vs/workbench/common/editor';
78
import { INotebookService } from 'vs/workbench/contrib/notebook/common/notebookService';
89
import { URI } from 'vs/base/common/uri';
@@ -119,11 +120,15 @@ export class NotebookEditorInput extends EditorInput {
119120

120121
if (!provider.matches(target)) {
121122
const patterns = provider.selectors.map(pattern => {
122-
if (pattern.excludeFileNamePattern) {
123-
return `${pattern.filenamePattern} (exclude: ${pattern.excludeFileNamePattern})`;
123+
if (typeof pattern === 'string') {
124+
return pattern;
124125
}
125126

126-
return pattern.filenamePattern;
127+
if (glob.isRelativePattern(pattern)) {
128+
return `${pattern} (base ${pattern.base})`;
129+
}
130+
131+
return `${pattern.include} (exclude: ${pattern.exclude})`;
127132
}).join(', ');
128133
throw new Error(`File name ${target} is not supported by ${provider.providerDisplayName}.
129134

0 commit comments

Comments
 (0)