Skip to content

Commit

Permalink
make sure "Open With..." actually works..., maybe #121974 or maybe #1…
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed Apr 26, 2021
1 parent 2cfe0d7 commit 594b7b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Expand Up @@ -566,12 +566,13 @@ export class NotebookFileWorkingCopyModel implements IFileWorkingCopyModel {
export class NotebookFileWorkingCopyModelFactory implements IFileWorkingCopyModelFactory<NotebookFileWorkingCopyModel>{

constructor(
@INotebookService private readonly _notebookService: INotebookService
private readonly _viewType: string,
@INotebookService private readonly _notebookService: INotebookService,
) { }

async createModel(resource: URI, stream: VSBufferReadableStream, token: CancellationToken): Promise<NotebookFileWorkingCopyModel> {

const info = await this._notebookService.withNotebookDataProvider(resource);
const info = await this._notebookService.withNotebookDataProvider(resource, this._viewType);
if (!(info instanceof SimpleNotebookProviderInfo)) {
throw new Error('CANNOT open file notebook with this provider');
}
Expand Down
Expand Up @@ -66,7 +66,7 @@ class NotebookModelReferenceCollection extends ReferenceCollection<Promise<IReso
workingCopyManager = <IFileWorkingCopyManager<NotebookFileWorkingCopyModel>><any>this._instantiationService.createInstance(
FileWorkingCopyManager,
workingCopyTypeId,
new NotebookFileWorkingCopyModelFactory(this._notebookService)
new NotebookFileWorkingCopyModelFactory(viewType, this._notebookService)
);
this._workingCopyManagers.set(workingCopyTypeId, workingCopyManager);
}
Expand Down

0 comments on commit 594b7b0

Please sign in to comment.