Skip to content

Commit

Permalink
update to latest Theia community release: v1.49.1
Browse files Browse the repository at this point in the history
Fix "Open With -> Trace Viewer" by using the new OpenWithService. The
old "Open With" implementation in Theia was changed in favor of this
new service, but it broke current behaviour.

eclipse-theia/theia#13573

Signed-off-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
  • Loading branch information
bhufmann committed Jun 28, 2024
1 parent 3bcf1b5 commit 8c979dd
Show file tree
Hide file tree
Showing 6 changed files with 604 additions and 275 deletions.
10 changes: 5 additions & 5 deletions examples/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
}
},
"dependencies": {
"@theia/core": "1.45.1",
"@theia/navigator": "1.45.1",
"@theia/preferences": "1.45.1",
"@theia/terminal": "1.45.1",
"@theia/core": "1.49.1",
"@theia/navigator": "1.49.1",
"@theia/preferences": "1.49.1",
"@theia/terminal": "1.49.1",
"theia-traceviewer": "0.2.3"
},
"devDependencies": {
"@theia/cli": "1.45.1"
"@theia/cli": "1.49.1"
},
"scripts": {
"prepare": "yarn build",
Expand Down
12 changes: 6 additions & 6 deletions examples/electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
}
},
"dependencies": {
"@theia/core": "1.45.1",
"@theia/electron": "1.45.1",
"@theia/navigator": "1.45.1",
"@theia/preferences": "1.45.1",
"@theia/terminal": "1.45.1",
"@theia/core": "1.49.1",
"@theia/electron": "1.49.1",
"@theia/navigator": "1.49.1",
"@theia/preferences": "1.49.1",
"@theia/terminal": "1.49.1",
"theia-traceviewer": "0.2.3"
},
"devDependencies": {
"@theia/cli": "1.45.1",
"@theia/cli": "1.49.1",
"electron": "^23.2.4",
"electron-builder": "~23.6.0"
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
},
"devDependencies": {
"@eclipse-dash/nodejs-wrapper": "^0.0.1",
"@theia/cli": "1.45.1",
"@theia/cli": "1.49.1",
"concurrently": "^8.2.1",
"jsonc-parser": "^3.0.0",
"lerna": "^7.0.0",
Expand Down
8 changes: 4 additions & 4 deletions theia-extensions/viewer-prototype/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
"style"
],
"dependencies": {
"@theia/core": "1.45.1",
"@theia/editor": "1.45.1",
"@theia/filesystem": "1.45.1",
"@theia/messages": "1.45.1",
"@theia/core": "1.49.1",
"@theia/editor": "1.49.1",
"@theia/filesystem": "1.49.1",
"@theia/messages": "1.49.1",
"animate.css": "^4.1.1",
"traceviewer-base": "0.2.3",
"traceviewer-react-components": "0.2.3",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { injectable, inject } from '@theia/core/shared/inversify';
import { injectable, inject, postConstruct } from '@theia/core/shared/inversify';
import { CommandRegistry, CommandContribution, MessageService } from '@theia/core';
import {
WidgetOpenerOptions,
WidgetOpenHandler,
KeybindingContribution,
KeybindingRegistry
KeybindingRegistry,
OpenWithService
} from '@theia/core/lib/browser';
import URI from '@theia/core/lib/common/uri';
import { TraceViewerWidget, TraceViewerWidgetOptions } from './trace-viewer';
Expand Down Expand Up @@ -52,6 +53,7 @@ export class TraceViewerContribution
@inject(TracePreferences) protected tracePreferences: TracePreferences;
@inject(TraceServerConfigService) protected readonly traceServerConfigService: TraceServerConfigService;
@inject(MessageService) protected readonly messageService: MessageService;
@inject(OpenWithService) protected readonly openWithService: OpenWithService;
@inject(TraceServerConnectionStatusClient)
protected readonly serverStatusService: TraceServerConnectionStatusClient;

Expand All @@ -66,6 +68,17 @@ export class TraceViewerContribution
return this.tracePreferences[TRACE_ARGS];
}

@postConstruct()
protected init(): void {
this.openWithService.registerHandler({
id: this.id + '-open-with',
label: this.label,
providerName: 'Theia Trace Viewer',
canHandle: (uri: URI) => this.canHandle(uri),
open: (uri: URI) => this.open(uri)
});
}

protected createWidgetOptions(uri: URI, options?: TraceViewerWidgetOpenerOptions): TraceViewerWidgetOptions {
return {
traceURI: uri.path.toString(),
Expand Down
Loading

0 comments on commit 8c979dd

Please sign in to comment.