File tree Expand file tree Collapse file tree 6 files changed +8
-14
lines changed
services/extensions/common Expand file tree Collapse file tree 6 files changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -89,15 +89,12 @@ export class InteractiveDocumentContribution extends Disposable implements IWork
89
89
const info = notebookService . getContributedNotebookType ( 'interactive' ) ;
90
90
91
91
// We need to contribute a notebook type for the Interactive Window to provide notebook models.
92
- // Don't add a file selector for the notebook type to avoid having the notebook Service create an editor for it.
93
- // The IW editor is registered below, and we don't want it overwritten by the notebook Service.
94
92
if ( ! info ) {
95
93
this . _register ( notebookService . registerContributedNotebookType ( 'interactive' , {
96
94
providerDisplayName : 'Interactive Notebook' ,
97
95
displayName : 'Interactive' ,
98
96
filenamePattern : [ '*.interactive' ] ,
99
- exclusive : true ,
100
- externalEditor : true
97
+ exclusive : true
101
98
} ) ) ;
102
99
}
103
100
Original file line number Diff line number Diff line change @@ -279,8 +279,9 @@ export class NotebookProviderInfoStore extends Disposable {
279
279
}
280
280
this . _contributedEditors . set ( info . id , info ) ;
281
281
let editorRegistration : IDisposable | undefined ;
282
- // Don't overwrite editor contributions if they come from elsewhere
283
- if ( ! info . externalEditor ) {
282
+
283
+ // built-in notebook providers contribute their own editors
284
+ if ( info . extension ) {
284
285
editorRegistration = this . _registerContributionPoint ( info ) ;
285
286
this . _contributedEditorDisposables . add ( editorRegistration ) ;
286
287
}
@@ -640,8 +641,7 @@ export class NotebookService extends Disposable implements INotebookService {
640
641
providerDisplayName : data . providerDisplayName ,
641
642
exclusive : data . exclusive ,
642
643
priority : RegisteredEditorPriority . default ,
643
- selectors : [ ] ,
644
- externalEditor : ! ! data . externalEditor
644
+ selectors : [ ]
645
645
} ) ;
646
646
647
647
info . update ( { selectors : data . filenamePattern } ) ;
Original file line number Diff line number Diff line change @@ -533,8 +533,6 @@ export interface INotebookContributionData {
533
533
displayName : string ;
534
534
filenamePattern : ( string | glob . IRelativePattern | INotebookExclusiveDocumentFilter ) [ ] ;
535
535
exclusive : boolean ;
536
- /// Editor contribution is handled elswhere e.g. interactive
537
- externalEditor ?: boolean ;
538
536
}
539
537
540
538
Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ export interface NotebookEditorDescriptor {
20
20
readonly priority : RegisteredEditorPriority ;
21
21
readonly providerDisplayName : string ;
22
22
readonly exclusive : boolean ;
23
- readonly externalEditor ?: boolean ;
24
23
}
25
24
26
25
export class NotebookProviderInfo {
@@ -31,7 +30,6 @@ export class NotebookProviderInfo {
31
30
readonly priority : RegisteredEditorPriority ;
32
31
readonly providerDisplayName : string ;
33
32
readonly exclusive : boolean ;
34
- readonly externalEditor : boolean ;
35
33
36
34
private _selectors : NotebookSelector [ ] ;
37
35
get selectors ( ) {
@@ -59,7 +57,6 @@ export class NotebookProviderInfo {
59
57
transientOutputs : false ,
60
58
cellContentMetadata : { }
61
59
} ;
62
- this . externalEditor = ! ! descriptor . externalEditor ;
63
60
}
64
61
65
62
update ( args : { selectors ?: NotebookSelector [ ] ; options ?: TransientOptions } ) {
Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ export interface INotebookService {
79
79
getNotebookTextModels ( ) : Iterable < NotebookTextModel > ;
80
80
listNotebookDocuments ( ) : readonly NotebookTextModel [ ] ;
81
81
82
+ /** Register a notebook type that we will handle. The notebook editor will be registered for notebook types contributed by extensions */
82
83
registerContributedNotebookType ( viewType : string , data : INotebookContributionData ) : IDisposable ;
83
84
getContributedNotebookType ( viewType : string ) : NotebookProviderInfo | undefined ;
84
85
getContributedNotebookTypes ( resource ?: URI ) : readonly NotebookProviderInfo [ ] ;
Original file line number Diff line number Diff line change @@ -260,7 +260,8 @@ function extensionDescriptionArrayToMap(extensions: IExtensionDescription[]): Ex
260
260
}
261
261
262
262
export function isProposedApiEnabled ( extension : IExtensionDescription , proposal : ApiProposalName ) : boolean {
263
- if ( ! extension . enabledApiProposals ) {
263
+ if ( ! extension .
264
+ enabledApiProposals ) {
264
265
return false ;
265
266
}
266
267
return extension . enabledApiProposals . includes ( proposal ) ;
You can’t perform that action at this time.
0 commit comments