Skip to content

Commit 4d1b95c

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 4d1b95c

File tree

7 files changed

+38
-64
lines changed

7 files changed

+38
-64
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",

Diff for: yarn.lock

+12-45
Original file line numberDiff line numberDiff line change
@@ -2327,6 +2327,15 @@
23272327
unzip-stream "^0.3.0"
23282328
vscode-debugprotocol "^1.32.0"
23292329

2330+
2331+
version "1.17.1"
2332+
resolved "https://registry.yarnpkg.com/@theia/editor-preview/-/editor-preview-1.17.1.tgz#2c802cc71fe62d1a9d6c16078d888b3b5c8d84ec"
2333+
integrity sha512-Stvc0Rxj+Y3MUSryF7G976JUbRxkwKtFnBv0pTw2573pWvxAsyNxhKKbEGnsHJ8NYPtiviwjIeA3lj8zolHdTA==
2334+
dependencies:
2335+
"@theia/core" "1.17.1"
2336+
"@theia/editor" "1.17.1"
2337+
"@theia/navigator" "1.17.1"
2338+
23302339
23312340
version "1.17.1"
23322341
resolved "https://registry.yarnpkg.com/@theia/editor/-/editor-1.17.1.tgz#cf8a0e971f22c5b05b10f73f109236385126f98e"
@@ -9866,40 +9875,6 @@ node-fetch@^2.5.0, node-fetch@^2.6.0, node-fetch@^2.6.1:
98669875
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052"
98679876
integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==
98689877

9869-
node-gyp@^5.0.2:
9870-
version "5.1.1"
9871-
resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-5.1.1.tgz#eb915f7b631c937d282e33aed44cb7a025f62a3e"
9872-
integrity sha512-WH0WKGi+a4i4DUt2mHnvocex/xPLp9pYt5R6M2JdFB7pJ7Z34hveZ4nDTGTiLXCkitA9T8HFZjhinBCiVHYcWw==
9873-
dependencies:
9874-
env-paths "^2.2.0"
9875-
glob "^7.1.4"
9876-
graceful-fs "^4.2.2"
9877-
mkdirp "^0.5.1"
9878-
nopt "^4.0.1"
9879-
npmlog "^4.1.2"
9880-
request "^2.88.0"
9881-
rimraf "^2.6.3"
9882-
semver "^5.7.1"
9883-
tar "^4.4.12"
9884-
which "^1.3.1"
9885-
9886-
node-gyp@^6.0.1:
9887-
version "6.1.0"
9888-
resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-6.1.0.tgz#64e31c61a4695ad304c1d5b82cf6b7c79cc79f3f"
9889-
integrity sha512-h4A2zDlOujeeaaTx06r4Vy+8MZ1679lU+wbCKDS4ZtvY2A37DESo37oejIw0mtmR3+rvNwts5B6Kpt1KrNYdNw==
9890-
dependencies:
9891-
env-paths "^2.2.0"
9892-
glob "^7.1.4"
9893-
graceful-fs "^4.2.2"
9894-
mkdirp "^0.5.1"
9895-
nopt "^4.0.1"
9896-
npmlog "^4.1.2"
9897-
request "^2.88.0"
9898-
rimraf "^2.6.3"
9899-
semver "^5.7.1"
9900-
tar "^4.4.12"
9901-
which "^1.3.1"
9902-
99039878
node-gyp@^7.0.0:
99049879
version "7.1.2"
99059880
resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-7.1.2.tgz#21a810aebb187120251c3bcec979af1587b188ae"
@@ -9931,14 +9906,6 @@ noop-logger@^0.1.1:
99319906
resolved "https://registry.yarnpkg.com/noop-logger/-/noop-logger-0.1.1.tgz#94a2b1633c4f1317553007d8966fd0e841b6a4c2"
99329907
integrity sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI=
99339908

9934-
nopt@^4.0.1:
9935-
version "4.0.3"
9936-
resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.3.tgz#a375cad9d02fd921278d954c2254d5aa57e15e48"
9937-
integrity sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==
9938-
dependencies:
9939-
abbrev "1"
9940-
osenv "^0.1.4"
9941-
99429909
nopt@^5.0.0:
99439910
version "5.0.0"
99449911
resolved "https://registry.yarnpkg.com/nopt/-/nopt-5.0.0.tgz#530942bb58a512fccafe53fe210f13a25355dc88"
@@ -10336,7 +10303,7 @@ os-tmpdir@^1.0.0, os-tmpdir@~1.0.2:
1033610303
resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
1033710304
integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=
1033810305

10339-
osenv@^0.1.4, osenv@^0.1.5:
10306+
osenv@^0.1.5:
1034010307
version "0.1.5"
1034110308
resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410"
1034210309
integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==
@@ -12148,7 +12115,7 @@ semver-compare@^1.0.0:
1214812115
resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc"
1214912116
integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w=
1215012117

12151-
"semver@2 || 3 || 4 || 5", "[email protected] || 3.x || 4 || 5", semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0, semver@^5.7.0, semver@^5.7.1:
12118+
"semver@2 || 3 || 4 || 5", "[email protected] || 3.x || 4 || 5", semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0, semver@^5.7.0:
1215212119
version "5.7.1"
1215312120
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
1215412121
integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
@@ -13054,7 +13021,7 @@ tar-stream@^2.1.4:
1305413021
inherits "^2.0.3"
1305513022
readable-stream "^3.1.1"
1305613023

13057-
tar@^4.0.0, tar@^4.0.2, tar@^4.4.10, tar@^4.4.12, tar@^4.4.8:
13024+
tar@^4.0.0, tar@^4.0.2, tar@^4.4.10, tar@^4.4.8:
1305813025
version "4.4.19"
1305913026
resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.19.tgz#2e4d7263df26f2b914dee10c825ab132123742f3"
1306013027
integrity sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA==

0 commit comments

Comments
 (0)