Skip to content

Commit 5738482

Browse files
committed
use theia editor preview
# Conflicts: # arduino-ide-extension/package.json # browser-app/package.json # electron-app/package.json # yarn.lock
1 parent 03acb58 commit 5738482

File tree

7 files changed

+420
-398
lines changed

7 files changed

+420
-398
lines changed

Diff for: arduino-ide-extension/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"@theia/application-package": "1.17.1",
2323
"@theia/core": "1.17.1",
2424
"@theia/editor": "1.17.1",
25+
"@theia/editor-preview": "1.17.1",
2526
"@theia/filesystem": "1.17.1",
2627
"@theia/git": "1.17.1",
2728
"@theia/keymaps": "1.17.1",

Diff for: arduino-ide-extension/src/browser/arduino-ide-frontend-module.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ import { FileNavigatorContribution as TheiaFileNavigatorContribution } from '@th
4242
import { KeymapsFrontendContribution } from './theia/keymaps/keymaps-frontend-contribution';
4343
import { KeymapsFrontendContribution as TheiaKeymapsFrontendContribution } from '@theia/keymaps/lib/browser/keymaps-frontend-contribution';
4444
import { ArduinoToolbarContribution } from './toolbar/arduino-toolbar-contribution';
45-
import { EditorContribution as TheiaEditorContribution } from '@theia/editor/lib/browser/editor-contribution';
46-
import { EditorContribution } from './theia/editor/editor-contribution';
45+
import { EditorPreviewContribution as TheiaEditorPreviewContribution } from '@theia/editor-preview/lib/browser/editor-preview-contribution';
46+
import { EditorPreviewContribution } from './theia/editor/editor-contribution';
4747
import { MonacoStatusBarContribution as TheiaMonacoStatusBarContribution } from '@theia/monaco/lib/browser/monaco-status-bar-contribution';
4848
import { MonacoStatusBarContribution } from './theia/monaco/monaco-status-bar-contribution';
4949
import {
@@ -438,7 +438,9 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
438438
rebind(TheiaKeymapsFrontendContribution)
439439
.to(KeymapsFrontendContribution)
440440
.inSingletonScope();
441-
rebind(TheiaEditorContribution).to(EditorContribution).inSingletonScope();
441+
rebind(TheiaEditorPreviewContribution)
442+
.to(EditorPreviewContribution)
443+
.inSingletonScope();
442444
rebind(TheiaMonacoStatusBarContribution)
443445
.to(MonacoStatusBarContribution)
444446
.inSingletonScope();
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
import { injectable } from 'inversify';
2-
import { EditorContribution as TheiaEditorContribution } from '@theia/editor/lib/browser/editor-contribution';
2+
import { EditorPreviewContribution as TheiaEditorPreviewContribution } from '@theia/editor-preview/lib/browser/editor-preview-contribution';
33
import { TextEditor } from '@theia/editor/lib/browser';
4-
import { StatusBarAlignment } from '@theia/core/lib/browser';
54

65
@injectable()
7-
export class EditorContribution extends TheiaEditorContribution {
6+
export class EditorPreviewContribution extends TheiaEditorPreviewContribution {
87
protected updateLanguageStatus(editor: TextEditor | undefined): void {}
98

10-
protected setCursorPositionStatus(editor: TextEditor | undefined): void {
11-
if (!editor) {
12-
this.statusBar.removeElement('editor-status-cursor-position');
13-
return;
14-
}
15-
const { cursor } = editor;
16-
this.statusBar.setElement('editor-status-cursor-position', {
17-
text: `${cursor.line + 1}`,
18-
alignment: StatusBarAlignment.LEFT,
19-
priority: 100,
20-
});
21-
}
9+
// protected setCursorPositionStatus(editor: TextEditor | undefined): void {
10+
// if (!editor) {
11+
// this.statusBar.removeElement('editor-status-cursor-position');
12+
// return;
13+
// }
14+
// const { cursor } = editor;
15+
// this.statusBar.setElement('editor-status-cursor-position', {
16+
// text: `${cursor.line + 1}`,
17+
// alignment: StatusBarAlignment.LEFT,
18+
// priority: 100,
19+
// });
20+
// }
2221
}

Diff for: arduino-ide-extension/src/browser/widgets/sketchbook/sketchbook-tree-model.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,10 @@ export class SketchbookTreeModel extends FileTreeModel {
258258
}
259259

260260
public open(uri: URI): void {
261-
open(this.openerService, uri);
261+
open(this.openerService, uri, {
262+
mode: 'reveal',
263+
preview: false,
264+
});
262265
}
263266

264267
protected async doOpenNode(node: TreeNode): Promise<void> {

Diff for: browser-app/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"@theia/core": "1.17.1",
88
"@theia/debug": "1.17.1",
99
"@theia/editor": "1.17.1",
10+
"@theia/editor-preview": "1.17.1",
1011
"@theia/file-search": "1.17.1",
1112
"@theia/filesystem": "1.17.1",
1213
"@theia/keymaps": "1.17.1",

Diff for: electron-app/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"@theia/core": "1.17.1",
99
"@theia/debug": "1.17.1",
1010
"@theia/editor": "1.17.1",
11+
"@theia/editor-preview": "1.17.1",
1112
"@theia/electron": "1.17.1",
1213
"@theia/file-search": "1.17.1",
1314
"@theia/filesystem": "1.17.1",

0 commit comments

Comments
 (0)