Skip to content

Commit

Permalink
Merge branch 'master' into msujew/fix-proxy-support
Browse files Browse the repository at this point in the history
  • Loading branch information
thegecko authored Mar 28, 2023
2 parents e82f0ee + f3819b2 commit a2d5b5b
Show file tree
Hide file tree
Showing 47 changed files with 771 additions and 209 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
yarn lint
build:
name: Build (${{ matrix.os }}, node-${{ matrix.node }}
name: Build and Test (${{ matrix.os }}, node-${{ matrix.node }})

strategy:
fail-fast: false
Expand Down Expand Up @@ -114,6 +114,7 @@ jobs:
xvfb-run -a yarn electron test
publish:
name: Publish to NPM and GitHub pages
needs: build
if: github.ref == 'refs/heads/master' && github.event_name != 'schedule' # We still publish the manually dispatched workflows: 'workflow_dispatch'.
runs-on: ubuntu-latest
Expand Down Expand Up @@ -150,7 +151,7 @@ jobs:
run: |
yarn docs
env:
NODE_OPTIONS: --max_old_space_size=8196
NODE_OPTIONS: --max_old_space_size=9216

- name: Publish GH Pages
uses: peaceiris/actions-gh-pages@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/license-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
jobs:

License-check:
name: ${{ matrix.os }}, Node.js v${{ matrix.node }}
name: 3PP License Check

strategy:
fail-fast: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/performance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
build-and-test-performance:
name: ubuntu-latest, Node.js 16.x
name: Performance Tests

runs-on: ubuntu-latest
timeout-minutes: 30
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:

jobs:
build-and-test-playwright:
name: ubuntu-latest, Node.js 16.x
name: Playwright Tests (ubuntu-latest, Node.js 16.x)

runs-on: ubuntu-latest
timeout-minutes: 60
Expand All @@ -33,7 +33,7 @@ jobs:
with:
python-version: "3.x"

- name: Build
- name: Build Browser
shell: bash
run: |
yarn --skip-integrity-check --network-timeout 100000
Expand All @@ -42,6 +42,11 @@ jobs:
NODE_OPTIONS: --max_old_space_size=4096
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # https://github.com/microsoft/vscode-ripgrep/issues/9

- name: Build Playwright
shell: bash
run: |
yarn --cwd examples/playwright build
- name: Test (playwright)
uses: GabrielBB/xvfb-action@v1
with:
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
<a name="breaking_changes_1.36.0">[Breaking Changes:](#breaking_changes_1.36.0)</a>

- [plugin] renamed `TreeViewExtImpl#toTreeItem()` to `TreeViewExtImpl#toTreeElement()`
- [scm] Fixing 'scm' inline commands, introduces the following breaking changes: [#12295](https://github.com/eclipse-theia/theia/pull/12295)
- Interface ScmInlineAction removes 'commands: CommandRegistry'
- Interface ScmInlineActions removes 'commands: CommandRegistry'
- Interface ScmTreeWidget.Props removes 'commands: CommandRegistry'
- [terminal] removed `openTerminalFromProfile` method from `TerminalFrontendContribution` [#12322](https://github.com/eclipse-theia/theia/pull/12322)

## v1.35.0 - 02/23/2023

Expand Down
3 changes: 2 additions & 1 deletion configs/typedoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"../+(dev-packages|examples|typings|scripts)/**",
"../packages/*/lib/**",
"**/node_modules/**",
"**/*spec.ts"
"**/*spec.ts",
"../plugins/*"
],
"excludeExternals": true,
"external-modulemap": ".*\/packages\/([\\w\\-_]+)\/",
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/application-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"string-replace-loader": "^3.1.0",
"style-loader": "^2.0.0",
"umd-compat-loader": "^2.1.2",
"webpack": "^5.48.0",
"webpack": "^5.76.0",
"webpack-cli": "4.7.0",
"worker-loader": "^3.0.8",
"yargs": "^15.3.1"
Expand Down
11 changes: 11 additions & 0 deletions examples/api-samples/src/browser/menu/sample-menu-contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,17 @@ export class SampleCommandContribution implements CommandContribution {
protected readonly messageService: MessageService;

registerCommands(commands: CommandRegistry): void {
commands.registerCommand({ id: 'create-quick-pick-sample', label: 'Internal QuickPick' }, {
execute: () => {
const pick = this.quickInputService.createQuickPick();
pick.items = [{ label: '1' }, { label: '2' }, { label: '3' }];
pick.onDidAccept(() => {
console.log(`accepted: ${pick.selectedItems[0]?.label}`);
pick.hide();
});
pick.show();
}
});
commands.registerCommand(SampleCommand, {
execute: () => {
alert('This is a sample command!');
Expand Down
155 changes: 155 additions & 0 deletions examples/api-tests/src/explorer-open-close.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
// *****************************************************************************
// Copyright (C) 2023 Ericsson and others.
//
// This program and the accompanying materials are made available under the
// terms of the Eclipse Public License v. 2.0 which is available at
// http://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: 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-2.0
// *****************************************************************************

// @ts-check
describe('Explorer and Editor - open and close', function () {
this.timeout(90_000);
const { assert } = chai;

const { DisposableCollection } = require('@theia/core/lib/common/disposable');
const { EditorManager } = require('@theia/editor/lib/browser/editor-manager');
const { WorkspaceService } = require('@theia/workspace/lib/browser/workspace-service');
const { FileNavigatorContribution } = require('@theia/navigator/lib/browser/navigator-contribution');
const { ApplicationShell } = require('@theia/core/lib/browser/shell/application-shell');
const { HostedPluginSupport } = require('@theia/plugin-ext/lib/hosted/browser/hosted-plugin');
const { ProgressStatusBarItem } = require('@theia/core/lib/browser/progress-status-bar-item');
const { EXPLORER_VIEW_CONTAINER_ID } = require('@theia/navigator/lib/browser/navigator-widget-factory');
const { MonacoEditor } = require('@theia/monaco/lib/browser/monaco-editor');
const container = window.theia.container;
const editorManager = container.get(EditorManager);
const workspaceService = container.get(WorkspaceService);
const navigatorContribution = container.get(FileNavigatorContribution);
const shell = container.get(ApplicationShell);
const rootUri = workspaceService.tryGetRoots()[0].resource;
const pluginService = container.get(HostedPluginSupport);
const progressStatusBarItem = container.get(ProgressStatusBarItem);


const fileUri = rootUri.resolve('webpack.config.js');
const toTearDown = new DisposableCollection();

function pause(ms = 500) {
console.debug(`pause test for: ${ms} ms`);
return new Promise(resolve => setTimeout(resolve, ms));
}

before(async () => {
await pluginService.didStart;
await editorManager.closeAll({ save: false });
});

afterEach(async () => {
await editorManager.closeAll({ save: false });
await navigatorContribution.closeView();
});

after(async () => {
toTearDown.dispose();
});

for (var i = 0; i < 5; i++) {
let ordering = 0;
it('Open/Close explorer and editor - ordering: ' + ordering++ + ', iteration #' + i, async function () {
await openExplorer();
await openEditor();
await closeEditor();
await closeExplorer();
});

it('Open/Close explorer and editor - ordering: ' + ordering++ + ', iteration #' + i, async function () {
await openExplorer();
await openEditor();
await closeExplorer();
await closeEditor();
});

it('Open/Close editor, explorer - ordering: ' + ordering++ + ', iteration - #' + i, async function () {
await openEditor();
await openExplorer();
await closeEditor();
await closeExplorer();
});

it('Open/Close editor, explorer - ordering: ' + ordering++ + ', iteration - #' + i, async function () {
await openEditor();
await openExplorer();
await closeExplorer();
await closeEditor();
});

it('Open/Close explorer #' + i, async function () {
await openExplorer();
await closeExplorer();
});
}

it('open/close explorer in quick succession', async function () {
for (let i = 0; i < 20; i++) {
await openExplorer();
await closeExplorer();
}
});

it('open/close editor in quick succession', async function () {
await openExplorer();
for (let i = 0; i < 20; i++) {
await openEditor();
await closeEditor();
}
});

async function openExplorer() {
await navigatorContribution.openView({ activate: true });
const widget = await shell.revealWidget(EXPLORER_VIEW_CONTAINER_ID);
assert.isDefined(widget, 'Explorer widget should exist');
}
async function closeExplorer() {
await navigatorContribution.closeView();
assert.isUndefined(await shell.revealWidget(EXPLORER_VIEW_CONTAINER_ID), 'Explorer widget should not exist');
}

async function openEditor() {
await editorManager.open(fileUri, { mode: 'activate' });
await waitLanguageServerReady();
const activeEditor = /** @type {MonacoEditor} */ MonacoEditor.get(editorManager.activeEditor);
assert.isDefined(activeEditor);
assert.equal(activeEditor.uri.resolveToAbsolute().toString(), fileUri.resolveToAbsolute().toString());
}

async function closeEditor() {
await editorManager.closeAll({ save: false });
const activeEditor = /** @type {MonacoEditor} */ MonacoEditor.get(editorManager.activeEditor);
assert.isUndefined(activeEditor);
}

async function waitLanguageServerReady() {
// quite a bit of jitter in the "Initializing LS" status bar entry,
// so we want to read a few times in a row that it's done (undefined)
const MAX_N = 5
let n = MAX_N;
while (n > 0) {
await pause(1);
if (progressStatusBarItem.currentProgress) {
n = MAX_N;
} else {
n--;
}
if (n < MAX_N) {
console.debug('n = ' + n);
}
}
}
});
Loading

0 comments on commit a2d5b5b

Please sign in to comment.