Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(plugin-ext): Fix instanceof check to handle VSCode URIs #13961

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/plugin-ext/src/plugin/plugin-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ import { NotebookKernelsExtImpl } from './notebook/notebook-kernels';
import { NotebookDocumentsExtImpl } from './notebook/notebook-documents';
import { NotebookEditorsExtImpl } from './notebook/notebook-editors';
import { TestingExtImpl } from './tests';
import { URI as CodeURI } from '@theia/core/shared/vscode-uri';

export function createAPIFactory(
rpc: RPCProtocol,
Expand Down Expand Up @@ -439,7 +440,7 @@ export function createAPIFactory(
preserveFocus?: boolean
): Promise<theia.TextEditor> {
let documentOptions: theia.TextDocumentShowOptions | undefined;
const uri: URI = documentArg instanceof URI ? documentArg : documentArg.uri;
const uri: URI = documentArg instanceof CodeURI ? documentArg : documentArg.uri;
if (typeof columnOrOptions === 'number') {
documentOptions = {
viewColumn: columnOrOptions
Expand Down Expand Up @@ -717,7 +718,7 @@ export function createAPIFactory(
if (typeof uriOrFileNameOrOptions === 'string') {
uri = URI.file(uriOrFileNameOrOptions);

} else if (uriOrFileNameOrOptions instanceof URI) {
} else if (uriOrFileNameOrOptions instanceof CodeURI) {
uri = uriOrFileNameOrOptions;

} else if (!options || typeof options === 'object') {
Expand Down
Loading