Skip to content

Commit

Permalink
6636-custom-editor: support for CustomEditor API
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Arad <dan.arad@sap.com>
  • Loading branch information
danarad05 committed Jan 20, 2021
1 parent 4a3e133 commit ab853ee
Show file tree
Hide file tree
Showing 62 changed files with 3,343 additions and 3,405 deletions.
6 changes: 1 addition & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# Change Log

## v1.10.0

- [plugin] added `createDeployQuickOpenItem` method to create `DeployQuickOpenItem` in order to make extension deploy command extensible [#8919] (https://github.com/eclipse-theia/theia/pull/8919)

## v1.9.0 - 16/12/2020

- [cli] updated error reporting for the `download-plugins` script [#8798](https://github.com/eclipse-theia/theia/pull/8798)
Expand Down Expand Up @@ -69,7 +65,7 @@
- [monaco] added ability to compare quick-open entries [#8185](https://github.com/eclipse-theia/theia/pull/8185)
- [output] improved extensibility of output channel commands [#8733](https://github.com/eclipse-theia/theia/pull/8733)
- [plugin] added ability to use `viewId` as a progress location [#8700](https://github.com/eclipse-theia/theia/pull/8700)
- [plugin] added logic to only store webviews when they have a corresponding serializer [#8680](https://github.com/eclipse-theia/theia/pull/8680)
- [plugin] added logic to only store webviews when they have a corresponding serializer [#8680](https://github.com/eclipse-theia/theia/pull8680)
- [plugin] added support for `activeColorTheme` and `onDidChangeActiveColorTheme` API [#8710](https://github.com/eclipse-theia/theia/pull/8710)
- [plugin] added support for semantic highlighting [#8593](https://github.com/eclipse-theia/theia/pull/8593)
- [plugin] fixed issue where problem matchers specified by task providers are not respected [#8756](https://github.com/eclipse-theia/theia/pull/8756)
Expand Down
164 changes: 13 additions & 151 deletions NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,22 @@ This program and the accompanying materials are made available under the terms
of the Eclipse Public License v. 2.0 which is available at
https://www.eclipse.org/legal/epl-2.0. This Source Code may also be made
available under the following Secondary Licenses when the conditions for such
availability set forth in the Eclipse Public License v. 2.0 are satisfied:
(secondary) GPL-2.0 with Classpath-exception-2.0 which is available at GNU
General Public License v2.0 w/Classpath exception',
'https://www.gnu.org/software/classpath/license.html.
availability set forth in the Eclipse Public License v. 2.0 are satisfied: GNU
General Public License, version 2 with the GNU Classpath Exception which is
available at https://www.gnu.org/software/classpath/license.html.

SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-with-classpath-exception
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0

## Source Code

The project maintains the following source code repositories:

* https://github.com/eclipse-theia/theia
* https://github.com/eclipse/theia-generator-plugin
* https://github.com/eclipse/theia-yeoman-plugin
* https://github.com/eclipse/theia-plugin-packager
* https://github.com/eclipse-theia/theia-cpp-extensions
* https://github.com/eclipse/theia-cpp-extension
* https://github.com/eclipse/theia-python-extension
* https://github.com/eclipse/theia-java-extension
* https://github.com/eclipse-theia/theia-example
* https://github.com/eclipse-theia/cryptodetector
* https://github.com/eclipse-theia/generator-theia-extension

## Third-party Content

Expand All @@ -66,78 +61,11 @@ Code copied from project Microsoft/vscode (1.32.3)
* Project: https://code.visualstudio.com/
* Source: https://github.com/Microsoft/vscode

Code copied from project Microsoft/vscode (1.32.3)

* License: MIT

code copied from project microsoft/vscode (1.33.1)

* License: MIT

Code copied from project Microsoft/vscode (1.33.1)

* License: MIT

Code copied from project Microsoft/vscode (1.34.0)

* License: MIT

Code copied from project microsoft/vscode (1.41.1)

* License: MIT

code copied from project vscode (1.26.0)

* License: MIT

code copied from project vscode (1.31.0)

* License: MIT

code copied from project vscode (1.33.0)

* License: MIT

code copied from project vscode (1.33.0)

* License: MIT

code copied from project vscode (1.34.0)

* License: MIT

code copied from project vscode (1.36.1)


code copied from project vscode (1.36.1)

* License: MIT

code copied from project vscode (1.37.0)

* License: MIT

code copied from project vscode (1.37.0)

* License: MIT

code copied from project vscode-browser-preview (0.4.0)

* License: MIT

Code copied from VS Code (n/a)

* License: MIT

Code copied from VSCode (n/a)

* License: MIT

Code copied from vscode (n/a)

* License: MIT

Code copied from VSCode (n/a)
code copied from project microsoft/vscode (1.33.1)

* License: MIT

Expand All @@ -163,14 +91,8 @@ Electron (3.1.7)
AND (BSD-2-Clause OR MIT OR Apache-2.0) AND ISC AND MIT AND X11 AND
BSD-2-Clause-FreeBSD AND Public-Domain AND Unlicense AND MPL-2.0 AND
(BSD-3-Clause OR MPL-2.0) AND CC-BY-3.0 AND (AFL-2.0

Electron (4.2.11)

* License: MIT AND BSD-3-Clause AND LicenseRef-Public-Domain

Electron (9.0.2)

* License: MIT AND BSD-3-Clause AND LicenseRef-Public-Domain
* Project: https://electronjs.org/
* Source: https://github.com/electron/electron

electron@2.0.14 (2.0.14)

Expand Down Expand Up @@ -204,38 +126,10 @@ Icon configure-inverse.svg (n/a)
* Source:
https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/contrib/tasks/common/media/configure-inverse.svg#L1

Icons copied from microsoft/vscode-icons version:
b73945c70f1117c4e65939dd3e10bdd623cb4ef3 (n/a)

* License: CC-BY-4.0

inversify (5.0.1)

* License: MIT

jschardet (1.6.0)

* License: (LGPL-2.1 OR LGPL-2.1+) AND (MIT OR GPL-2.0)
* Project: https://www.npmjs.com/package/jschardet
* Source:
https://github.com/aadsm/jschardet/tree/28152dd8db5904dc2cf9aa12ef4f8783f713e79a

jschardet (2.1.1)

* License: LGPL-2.1 OR LGPL-2.1+

libffmpeg (FFmpeg) Delivered with Electron (3.1.7)

* License: LGPL-2.1+

libffmpeg (FFmpeg) delivered with Electron (4.2.11)

* License: LGPG-2.1-or-later AND BSD-3-Clause AND MIT AND IJG

libffmpeg (FFmpeg) delivered with Electron (9.0.2)

* License: LGPG-2.1-or-later AND BSD-3-Clause AND MIT AND IJG

long.js (3.2.0)

* License: Apache-2.0
Expand All @@ -254,7 +148,7 @@ monaco-typescript (2.3.0)

native-keymap (1.2.5)

* License: BSD-3-Clause AND MIT
* License: Pending
* Project: https://github.com/Microsoft/node-native-keymap
* Source: https://github.com/Microsoft/node-native-keymap

Expand All @@ -270,21 +164,12 @@ node.js dependencies for Theia (n/a)
CC0-1.0 AND (BSD-3-Clause OR MPL-2.0) AND Unlicense AND (MIT OR GPL-3.0) AND
(MIT OR GPL-2.0) AND (Apache-2.0 OR

Preference code copied from vscode (n/a)


ps-list (5.0.1)

* License: MIT
* Project: https://github.com/sindresorhus/ps-list
* Source: https://github.com/sindresorhus/ps-list

react-perfect-scrollbar:1.5.3 (1.5.3)

* License: MIT
* Project: https://github.com/goldenyz/react-perfect-scrollbar
* Source: https://github.com/goldenyz/react-perfect-scrollbar

read-pkg (4.0.1)

* License: MIT
Expand Down Expand Up @@ -314,7 +199,7 @@ theia npm node (n/a)
* License: BSD-2-Clause OR (MIT OR Apache-2.0) AND (AFL-2.1 OR BSD-3-Clause)
AND Apache-2.0 AND Artistic-2.0 AND BSD-3-Clause AND (BSD-3-Clause OR MIT)
AND MPL-2.0 AND CC0-1.0 AND CC-BY-3.0 AND CC-BY-4.0 AND CC-BY-SA-2.5 AND
GPL-2.0 WITH Autoconf-exception
GPL-2.0 WITH Autoconf-ex

theia-cpp-extension npm node (n/a)

Expand Down Expand Up @@ -343,10 +228,6 @@ VS Code (1.33.0)

* License: MIT

VS Code built-in extensions (1.30.1)

* License: Apache-2.0 AND MIT AND Unicode-DFS-2016 AND CC-BY-4.0 AND W3C

vscode (1.26.0)

* License: MIT AND LicenseRef-Php_Tmbundle
Expand All @@ -363,10 +244,6 @@ vscode-debugadapter-node (n/a)

* License: MIT

vscode-icons (n/a)

* License: CC-BY-4.0 AND MIT

vscode-java (0.36.0)

* License: EPL-1.0
Expand All @@ -379,12 +256,6 @@ vscode-java-debug (0.15.0)

* License: MIT

webdriverio (n/a)

* License: MIT
* Project: http://webdriver.io/
* Source: https://github.com/webdriverio/webdriverio.git

when (3.7.8)

* License: MIT
Expand All @@ -395,24 +266,12 @@ wjordan/browser-path SHA6719d19077b1454bff8b802f9be79cb1b69ebe7e (n/a)

* License: MIT

xterm-addon-fit (0.3.0)

* License: MIT

xterm-addon-search (0.5.0)

* License: MIT

xterm.js (3.9.1)

* License: MIT
* Project: https://xtermjs.org/
* Source: https://github.com/xtermjs/xterm.js

xterm.js (4.4)

* License: MIT

yargs (12.0.1)

* License: MIT
Expand Down Expand Up @@ -452,6 +311,7 @@ please check the country's laws, regulations and policies concerning the import,
possession, or use, and re-export of encryption software, to see if this is
permitted.


## Electron

NOTICE:
Expand All @@ -471,3 +331,5 @@ We strongly recommend downstream consumers verify the type of FFmpeg support
configured and modify as required. More information on instructions to verify
can be found here
https://electronjs.org/docs/development/upgrading-chromium#verify-ffmpeg-support


56 changes: 17 additions & 39 deletions examples/api-tests/src/saveable.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ describe('Saveable', function () {
const rootUri = workspaceService.tryGetRoots()[0].resource;
const fileUri = rootUri.resolve('.test/foo.txt');

const closeOnFileDelete = 'workbench.editor.closeOnFileDelete';

/**
* @param {FileResource['shouldOverwrite']} shouldOverwrite
* @returns {Disposable}
Expand All @@ -69,7 +67,7 @@ describe('Saveable', function () {

beforeEach(async () => {
await preferences.set('editor.autoSave', 'off', undefined, rootUri.toString());
await preferences.set(closeOnFileDelete, true);
await preferences.set('editor.closeOnFileDelete', true);
await editorManager.closeAll({ save: false });
await fileService.create(fileUri, 'foo', { fromUserGesture: false, overwrite: true });
widget = /** @type {EditorWidget & SaveableWidget} */
Expand Down Expand Up @@ -230,6 +228,22 @@ describe('Saveable', function () {
assert.equal(state.value, 'foo', 'fs should NOT be updated after rejected close');
});

it('delete file for saved with editor.CloseOnFileDelete off', async () => {
await preferences.set('editor.closeOnFileDelete', false);
assert.isFalse(Saveable.isDirty(widget), 'should NOT be dirty before delete');
assert.isTrue(editor.document.valid, 'should be valid before delete');
const waitForInvalid = new Deferred();
const listener = editor.document.onDidChangeValid(() => waitForInvalid.resolve());
try {
await fileService.delete(fileUri);
await waitForInvalid.promise;
assert.isFalse(editor.document.valid, 'should be INVALID after delete');
assert.isFalse(widget.isDisposed, 'model should NOT be disposed after delete');
} finally {
listener.dispose();
}
});

it('accept save on close and reject it', async () => {
let outOfSync = false;
toTearDown.push(setShouldOverwrite(async () => {
Expand Down Expand Up @@ -449,40 +463,4 @@ describe('Saveable', function () {
}
});

it(`'${closeOnFileDelete}' should keep the editor opened when set to 'false'`, async () => {

await preferences.set(closeOnFileDelete, false);
assert.isFalse(preferences.get(closeOnFileDelete));
assert.isFalse(Saveable.isDirty(widget));

const waitForDidChangeTitle = new Deferred();
const listener = () => waitForDidChangeTitle.resolve();
widget.title.changed.connect(listener);
try {
await fileService.delete(fileUri);
await waitForDidChangeTitle.promise;
assert.isTrue(widget.title.label.endsWith('(deleted)'));
assert.isFalse(widget.isDisposed);
} finally {
widget.title.changed.disconnect(listener);
}
});

it(`'${closeOnFileDelete}' should close the editor when set to 'true'`, async () => {

await preferences.set(closeOnFileDelete, true);
assert.isTrue(preferences.get(closeOnFileDelete));
assert.isFalse(Saveable.isDirty(widget));

const waitForDisposed = new Deferred();
const listener = editor.onDispose(() => waitForDisposed.resolve());
try {
await fileService.delete(fileUri);
await waitForDisposed.promise;
assert.isTrue(widget.isDisposed);
} finally {
listener.dispose();
}
});

});
8 changes: 0 additions & 8 deletions packages/core/src/browser/common-frontend-contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1865,14 +1865,6 @@ export class CommonFrontendContribution implements FrontendApplicationContributi
dark: Color.transparent('button.background', 0.5),
light: Color.transparent('button.background', 0.5)
}, description: 'Background color of secondary buttons.'
},
{
id: 'editorGutter.commentRangeForeground',
defaults: {
dark: '#c5c5c5',
light: '#c5c5c5',
hc: '#c5c5c5'
}, description: 'Editor gutter decoration color for commenting ranges.'
}
);
}
Expand Down
Loading

0 comments on commit ab853ee

Please sign in to comment.