Skip to content

Commit

Permalink
Merge branch 'master' of github.com:eclipse-theia/theia into che-18742
Browse files Browse the repository at this point in the history
  • Loading branch information
vinokurig committed Feb 4, 2021
2 parents 9328275 + 9f7993d commit 0d26396
Show file tree
Hide file tree
Showing 84 changed files with 1,121 additions and 536 deletions.
36 changes: 31 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,40 @@
# 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.10.0 - 1/28/2021

- [api-samples] added example on how to contribute toggleable toolbar items [#8968](https://github.com/eclipse-theia/theia/pull/8968)
- [api-tests] fixed the `Saveable#closeOnFileDelete` integration test [#8942](https://github.com/eclipse-theia/theia/pull/8942)
- [core] added support for vscode settings schemas [#8761](https://github.com/eclipse-theia/theia/pull/8761)
- [core] added unit tests for `uri.isEqualOrParent` [#8876](https://github.com/eclipse-theia/theia/pull/8876)
- [core] fixed display issue with horizontal scrollbars in tab areas [#8898](https://github.com/eclipse-theia/theia/pull/8898)
- [core] fixed error message when a command fails to execute [#8978](https://github.com/eclipse-theia/theia/pull/8978)
- [core] fixed issue to allow late client registration [#8586](https://github.com/eclipse-theia/theia/pull/8686)
- [core] fixed issue with `TreeWidget#applyFontStyles` [#8937](https://github.com/eclipse-theia/theia/pull/8937)
- [core] fixed minor typo `mounpoint` to `mountpoint` [#8928](https://github.com/eclipse-theia/theia/pull/8928)
- [core] removed the `save without formatting` menu entry under `file` [#8877](https://github.com/eclipse-theia/theia/pull/8877)
- [core] updated rendering of toggleable toolbar items to highlight them when toggled [#8968](https://github.com/eclipse-theia/theia/pull/8968)
- [dependencies] updated to use fixed versions when publishing, `"x.y.z"` instead of `"^x.y.z"` in dependencies [#8880](https://github.com/eclipse-theia/theia/pull/8880)
- [scm] update code required to highlight nodes on search in the `ScmTreeWidget` [#8929](https://github.com/eclipse-theia/theia/pull/8929)
- [documentation] updated `NOTICE.md` [#8957](https://github.com/eclipse-theia/theia/pull/8957)
- [filesystem] added support for the `files.trimTrailingWhitespace` preference [#8742](https://github.com/eclipse-theia/theia/pull/8742)
- [filesystem] fixed the type guard for `FileStat.is` [#8986](https://github.com/eclipse-theia/theia/pull/8986)
- [navigator] update the navigator widget factory for extensibility [#8962](https://github.com/eclipse-theia/theia/pull/8962)
- [navigator] updated the menu order for `select for compare` and `compare with selected` [#8926](https://github.com/eclipse-theia/theia/pull/8926)
- [plugin] added `createDeployQuickOpenItem` method to create `DeployQuickOpenItem` in order to make extension deploy command extensible [#8919](https://github.com/eclipse-theia/theia/pull/8919)
- [plugin] added support for `viewsWelcome` in `TreeViews` [#8678](https://github.com/eclipse-theia/theia/pull/8678)
- [plugin] added support for the `CommentThread` Plugin API [#8870](https://github.com/eclipse-theia/theia/pull/8870)
- [plugin] added support for the `workbench.action.navigateBack` command [#8958](https://github.com/eclipse-theia/theia/pull/8958)
- [plugin] added support for the `workbench.action.navigateForward` command [#8958](https://github.com/eclipse-theia/theia/pull/8958)
- [plugin] added support for the `workbench.action.navigateToLastEditLocation` command [#8958](https://github.com/eclipse-theia/theia/pull/8958)
- [plugin] fixed tree-view reveal to not invalidate item command [#8922](https://github.com/eclipse-theia/theia/pull/8922)
- [plugin] updated the logging of embedded languages [#8938](https://github.com/eclipse-theia/theia/pull/8938)
- [preview] upgraded `highlight.js` from `^9.12.2` to `10.4.1` to resolve security vulnerability [#8881](https://github.com/eclipse-theia/theia/pull/8881)
- [scm] updated code required to highlight nodes on search in the `ScmTreeWidget` [#8929](https://github.com/eclipse-theia/theia/pull/8929)
- [task] fixed issue where tasks were not successfully executed without `cwd` explicitly set [#8949](https://github.com/eclipse-theia/theia/pull/8949)
- [terminal] reduced the severity of certain terminal logs [#8908](https://github.com/eclipse-theia/theia/pull/8908)

<a name="breaking_changes_1.10.0">[Breaking Changes:](#breaking_changes_1.10.0)</a>

- [scm] add `caption` field to `ScmTreeWidget.Props` interface. Remove `name` from `ScmResourceComponent.Props`, `groupLabel` from `ScmResourceGroupComponent.Props`, and `path` from `ScmResourceFolderElement.Props` interfaces. [#8929](https://github.com/eclipse-theia/theia/pull/8929)
- [scm] added the `caption` field to the `ScmTreeWidget.Props` interface. Removed `name` from `ScmResourceComponent.Props`, `groupLabel` from `ScmResourceGroupComponent.Props`, and `path` from `ScmResourceFolderElement.Props` interfaces. [#8929](https://github.com/eclipse-theia/theia/pull/8929)


## v1.9.0 - 16/12/2020
Expand Down
6 changes: 3 additions & 3 deletions dev-packages/application-manager/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@theia/application-manager",
"version": "1.9.0",
"version": "1.10.0",
"description": "Theia application manager API.",
"publishConfig": {
"access": "public"
Expand Down Expand Up @@ -32,7 +32,7 @@
"@babel/plugin-transform-classes": "^7.10.0",
"@babel/plugin-transform-runtime": "^7.10.0",
"@babel/preset-env": "^7.10.0",
"@theia/application-package": "^1.9.0",
"@theia/application-package": "1.10.0",
"@theia/compression-webpack-plugin": "^3.0.0",
"@types/fs-extra": "^4.0.2",
"@types/webpack": "^4.41.2",
Expand All @@ -56,7 +56,7 @@
"worker-loader": "^1.1.1"
},
"devDependencies": {
"@theia/ext-scripts": "^1.9.0"
"@theia/ext-scripts": "1.10.0"
},
"nyc": {
"extends": "../../configs/nyc.json"
Expand Down
4 changes: 2 additions & 2 deletions dev-packages/application-package/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@theia/application-package",
"version": "1.9.0",
"version": "1.10.0",
"description": "Theia application package API.",
"publishConfig": {
"access": "public"
Expand Down Expand Up @@ -41,7 +41,7 @@
"write-json-file": "^2.2.0"
},
"devDependencies": {
"@theia/ext-scripts": "^1.9.0"
"@theia/ext-scripts": "1.10.0"
},
"nyc": {
"extends": "../../configs/nyc.json"
Expand Down
6 changes: 3 additions & 3 deletions dev-packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@theia/cli",
"version": "1.9.0",
"version": "1.10.0",
"description": "Theia CLI.",
"publishConfig": {
"access": "public"
Expand Down Expand Up @@ -29,8 +29,8 @@
"clean": "theiaext clean"
},
"dependencies": {
"@theia/application-manager": "^1.9.0",
"@theia/application-package": "^1.9.0",
"@theia/application-manager": "1.10.0",
"@theia/application-package": "1.10.0",
"@types/chai": "^4.2.7",
"@types/mkdirp": "^0.5.2",
"@types/mocha": "^5.2.7",
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/electron/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@theia/electron",
"version": "1.9.0",
"version": "1.10.0",
"description": "Electron runtime dependencies for Theia",
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/ext-scripts/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@theia/ext-scripts",
"version": "1.9.0",
"version": "1.10.0",
"license": "EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0",
"description": "NPM scripts for Theia packages.",
"bin": {
Expand Down
80 changes: 80 additions & 0 deletions doc/Developing.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,86 @@ You should be able to see message of `[${server-name}: ${server-PID}]: IPC start
- If you want to debug the activation then enable `stopOnEntry` flag.
- Open the browser page.

---
### Debugging Plugin Sources

[click for base article](https://github.com/eclipse-theia/theia/issues/3251#issuecomment-468166533)

The following launch configuration is meant to be used when the Theia project is opened as the main project in vscode, the following launch configuration is added inside .vscode/launch.json.
- The source repository of your plugin is expected under your `${workspaceFolder}/plugins` folder
- You can start the frontend from URL: http://localhost:3030
- It's suggested to update your frontend launch configuration URL to open your favorite target project in a second launch

Launch configuration template that will start the backend process, and then attempt to connect on port 9339 to debug the plugin-host sub-process:

```jsonc
{
"name": "Launch VS Code extension as Theia plugin",
"type": "node",
"request": "launch",
"port": 9339,
"timeout": 100000,
"args": [
"${workspaceFolder}/examples/browser/src-gen/backend/main.js",
"${workspaceFolder}",
"--port=3030",
"--hosted-plugin-inspect=9339", // spawn the plugin-host in debug mode
"--plugins=local-dir:${workspaceFolder}/plugins"
],
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/**/*.js"
],
"internalConsoleOptions": "openOnSessionStart",
"outputCapture": "std"
}
```

#### Producing typescript maps for your plugin

Enable source maps in the plugin's `tsconfig.json`

```jsonc
{
"compilerOptions": {
"sourceMap": true
}
}
```

If Webpack is used you should bundle in development mode in the `package.json` scripts to avoid minification:

```sh
webpack --mode development
```

As well as enabling source map output in the **webpack.config.js**

```js
module.exports = {
devtool: 'source-map'
}
```

#### Compiling and blocking typescript from walking up parent directories [(see discussion)](https://github.com/Microsoft/TypeScript/issues/13992#issuecomment-386253983)

If you get errors while building like:

```
(parent folders)/index.d.ts: error TS2300: Duplicate identifier
```

You can fix it by modifying your `tsconfig.json`:

```jsonc
{
"compilerOptions": {
"typeRoots": ["./node_modules/@types"]
}
}
```

## Profiling

- Use Chrome devtools to profile both the frontend and backend (Node.js).
Expand Down
3 changes: 3 additions & 0 deletions examples/api-samples/compile.tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
},
{
"path": "../../packages/output/compile.tsconfig.json"
},
{
"path": "../../packages/vsx-registry/compile.tsconfig.json"
}
]
}
9 changes: 5 additions & 4 deletions examples/api-samples/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"private": true,
"name": "@theia/api-samples",
"version": "1.9.0",
"version": "1.10.0",
"description": "Theia - Example code to demonstrate Theia API",
"dependencies": {
"@theia/core": "^1.9.0",
"@theia/output": "^1.9.0"
"@theia/core": "1.10.0",
"@theia/output": "1.10.0",
"@theia/vsx-registry": "1.10.0"
},
"theiaExtensions": [
{
Expand Down Expand Up @@ -43,6 +44,6 @@
"clean": "theiaext clean"
},
"devDependencies": {
"@theia/ext-scripts": "^1.9.0"
"@theia/ext-scripts": "1.10.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { bindSampleUnclosableView } from './view/sample-unclosable-view-contribu
import { bindSampleOutputChannelWithSeverity } from './output/sample-output-channel-with-severity';
import { bindSampleMenu } from './menu/sample-menu-contribution';
import { bindSampleFileWatching } from './file-watching/sample-file-watching-contribution';
import { bindVSXCommand } from './vsx/sample-vsx-command-contribution';

import '../../src/browser/style/branding.css';

Expand All @@ -29,4 +30,5 @@ export default new ContainerModule(bind => {
bindSampleOutputChannelWithSeverity(bind);
bindSampleMenu(bind);
bindSampleFileWatching(bind);
bindVSXCommand(bind);
});
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,27 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/

import { AbstractViewContribution, bindViewContribution, WidgetFactory } from '@theia/core/lib/browser';
import { inject, injectable, interfaces } from 'inversify';
import { AbstractViewContribution, bindViewContribution } from '@theia/core/lib/browser/shell/view-contribution';
import { TabBarToolbarContribution, TabBarToolbarRegistry } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
import { Command, CommandRegistry, MessageService } from '@theia/core/lib/common';
import { Widget, WidgetFactory } from '@theia/core/lib/browser';
import { SampleViewUnclosableView } from './sample-unclosable-view';
import { injectable, interfaces } from 'inversify';

export const SampleToolBarCommand: Command = {
id: 'sample.toggle.toolbarCommand',
iconClass: 'theia-add-icon'
};

@injectable()
export class SampleUnclosableViewContribution extends AbstractViewContribution<SampleViewUnclosableView> {
export class SampleUnclosableViewContribution extends AbstractViewContribution<SampleViewUnclosableView> implements TabBarToolbarContribution {

static readonly SAMPLE_UNCLOSABLE_VIEW_TOGGLE_COMMAND_ID = 'sampleUnclosableView:toggle';

protected toolbarItemState = false;

@inject(MessageService) protected readonly messageService: MessageService;

constructor() {
super({
widgetId: SampleViewUnclosableView.ID,
Expand All @@ -33,10 +45,40 @@ export class SampleUnclosableViewContribution extends AbstractViewContribution<S
}
});
}

registerCommands(registry: CommandRegistry): void {
super.registerCommands(registry);
registry.registerCommand(SampleToolBarCommand, {
execute: () => {
this.toolbarItemState = !this.toolbarItemState;
this.messageService.info(`Sample Toolbar Command is toggled = ${this.toolbarItemState}`);
},
isEnabled: widget => this.withWidget(widget, () => true),
isVisible: widget => this.withWidget(widget, () => true),
isToggled: () => this.toolbarItemState
});
}

async registerToolbarItems(toolbarRegistry: TabBarToolbarRegistry): Promise<void> {
toolbarRegistry.registerItem({
id: SampleToolBarCommand.id,
command: SampleToolBarCommand.id,
tooltip: 'Click to Toggle Toolbar Item',
priority: 0
});
}

protected withWidget<T>(widget: Widget | undefined = this.tryGetWidget(), cb: (sampleView: SampleViewUnclosableView) => T): T | false {
if (widget instanceof SampleViewUnclosableView && widget.id === SampleViewUnclosableView.ID) {
return cb(widget);
}
return false;
}
}

export const bindSampleUnclosableView = (bind: interfaces.Bind) => {
bindViewContribution(bind, SampleUnclosableViewContribution);
bind(TabBarToolbarContribution).to(SampleUnclosableViewContribution).inSingletonScope();
bind(SampleViewUnclosableView).toSelf();
bind(WidgetFactory).toDynamicValue(ctx => ({
id: SampleViewUnclosableView.ID,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/********************************************************************************
* Copyright (C) 2020 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
********************************************************************************/

import { inject, injectable, interfaces } from 'inversify';
import { VSXEnvironment } from '@theia/vsx-registry/lib/common/vsx-environment';
import { Command, CommandContribution, CommandRegistry, MessageService } from '@theia/core/lib/common';

@injectable()
export class VSXCommandContribution implements CommandContribution {

@inject(MessageService)
protected readonly messageService: MessageService;

@inject(VSXEnvironment)
protected readonly environment: VSXEnvironment;

protected readonly command: Command = {
id: 'vsx.echo-api-version',
label: 'VS Code API Version'
};

registerCommands(commands: CommandRegistry): void {
commands.registerCommand(this.command, {
execute: async () => {
const version = await this.environment.getVscodeApiVersion();
this.messageService.info(`Supported VS Code API Version: ${version}`);
}
});
}

}

export const bindVSXCommand = (bind: interfaces.Bind) => {
bind(CommandContribution).to(VSXCommandContribution).inSingletonScope();
};
4 changes: 2 additions & 2 deletions examples/api-tests/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "@theia/api-tests",
"version": "1.9.0",
"version": "1.10.0",
"description": "Theia API tests",
"dependencies": {
"@theia/core": "^1.9.0"
"@theia/core": "1.10.0"
},
"license": "EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0",
"repository": {
Expand Down
Loading

0 comments on commit 0d26396

Please sign in to comment.