Skip to content

Commit

Permalink
custom-editor: remove 'editor-preview` coupling
Browse files Browse the repository at this point in the history
The following commit removes the unnecessary coupling to
`@theia/editor-preview` from `custom-editor` functionality contributed
by the plugin-system.

Adding the coupling was a breaking change for downstream applications
who were not expecting `@theia/editor-preview` from being contributed,
and meant it was difficult to opt-out.

The coupling was introduced to add unused typing so it is safe to
remove.

Signed-off-by: vince-fugnitto <[email protected]>
  • Loading branch information
vince-fugnitto committed Apr 8, 2021
1 parent 85bffae commit b0ed2ac
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 6 deletions.
3 changes: 0 additions & 3 deletions packages/plugin-ext/compile.tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@
},
{
"path": "../workspace/compile.tsconfig.json"
},
{
"path": "../editor-preview/compile.tsconfig.json"
}
]
}
1 change: 0 additions & 1 deletion packages/plugin-ext/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"@theia/core": "1.12.0",
"@theia/debug": "1.12.0",
"@theia/editor": "1.12.0",
"@theia/editor-preview": "1.12.0",
"@theia/file-search": "1.12.0",
"@theia/filesystem": "1.12.0",
"@theia/markers": "1.12.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
********************************************************************************/

import { inject } from '@theia/core/shared/inversify';
import { PreviewEditorOpenerOptions } from '@theia/editor-preview/lib/browser';
import URI from '@theia/core/lib/common/uri';
import { ApplicationShell, OpenerOptions, OpenHandler, Widget, WidgetManager } from '@theia/core/lib/browser';
import { CustomEditorPriority, CustomEditorSelector } from '../../../common';
Expand All @@ -42,7 +41,7 @@ export class CustomEditorOpener implements OpenHandler {
this.label = this.editor.displayName;
}

canHandle(uri: URI, options?: PreviewEditorOpenerOptions): number {
canHandle(uri: URI): number {
if (this.matches(this.editor.selector, uri)) {
return this.getPriority();
}
Expand Down

0 comments on commit b0ed2ac

Please sign in to comment.