Skip to content

Commit

Permalink
some more imporvements
Browse files Browse the repository at this point in the history
Signed-off-by: Jonah Iden <[email protected]>
  • Loading branch information
jonah-iden committed Oct 11, 2023
1 parent 921c1f9 commit 1bc6d38
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { URI as Uri } from '@theia/core/shared/vscode-uri';
import { ArrayUtils, Command, CommandService, DisposableCollection, Event, nls, QuickInputButton, QuickInputService, QuickPickInput, QuickPickItem, URI, } from '@theia/core';
import { inject, injectable } from '@theia/core/shared/inversify';
import { NotebookKernelService, NotebookKernel, NotebookKernelMatchResult, SourceCommand } from './notebook-kernel-service';
Expand Down Expand Up @@ -316,7 +315,7 @@ export class KernelPickerMRUStrategy extends NotebookKernelQuickPickServiceImpl
quickPick.onDidTriggerItemButton(async e => {

if (isKernelSourceQuickPickItem(e.item) && e.item.documentation !== undefined) {
const uri: URI | undefined = Uri.isUri(e.item.documentation) ? new URI(e.item.documentation) : await this.commandService.executeCommand(e.item.documentation);
const uri: URI | undefined = this.isUri(e.item.documentation) ? new URI(e.item.documentation) : await this.commandService.executeCommand(e.item.documentation);
if (uri) {
(await this.openerService.getOpener(uri, { openExternal: true })).open(uri, { openExternal: true });
}
Expand Down Expand Up @@ -416,6 +415,10 @@ export class KernelPickerMRUStrategy extends NotebookKernelQuickPickServiceImpl
return false;
}

private isUri(value: string): boolean {
return /^(?<scheme>\w[\w\d+.-]*):/.test(value);
}

private async calculateKernelSources(editor: NotebookModel): Promise<QuickPickInput<KernelQuickPickItem>[]> {
const notebook: NotebookModel = editor;

Expand Down
5 changes: 0 additions & 5 deletions packages/notebook/src/common/notebook-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,6 @@ export interface TransientOptions {
readonly transientDocumentMetadata: TransientDocumentMetadata;
}

export interface NotebookExtensionDescription {
readonly id: string;
readonly pluginUri: string | undefined;
}

export interface CellOutputItem {
readonly mime: string;
readonly data: BinaryBuffer;
Expand Down

0 comments on commit 1bc6d38

Please sign in to comment.