Skip to content

Commit

Permalink
Align 'ActionProvider' related entities with VS Code
Browse files Browse the repository at this point in the history
Signed-off-by: Roman Nikitenko <[email protected]>
  • Loading branch information
RomanNikitenko committed Oct 4, 2019
1 parent 5e8c3d8 commit 2186ccb
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 20 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Breaking changes:
- `PluginDebugAdapterContribution.languages`, `PluginDebugAdapterContribution.getSchemaAttributes` and `PluginDebugAdapterContribution.getConfigurationSnippets` are removed to prevent sending the contributions second time to the frontend. Debug contributions are loaded statically from the deployed plugin metadata instead. The same for corresponding methods in `DebugExtImpl`.
- [task] removed `watchedConfigFileUris`, `watchersMap` `watcherServer`, `fileSystem`, `configFileUris`, `watchConfigurationFile()` and `unwatchConfigurationFile()` from `TaskConfigurations` class. [6268](https://github.com/eclipse-theia/theia/pull/6268)
- [task] removed `configurationFileFound` from `TaskService` class. [6268](https://github.com/eclipse-theia/theia/pull/6268)
- [core][monaco][task] aligh `ActionProvider` related entities with VS Code. [6302](https://github.com/eclipse-theia/theia/pull/6302)

## v0.11.0

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/common/quick-open-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export interface QuickOpenModel {

export interface QuickOpenActionProvider {
hasActions(item: QuickOpenItem): boolean;
getActions(item: QuickOpenItem): Promise<QuickOpenAction[]>;
getActions(item: QuickOpenItem): ReadonlyArray<QuickOpenAction>;
}

export interface QuickOpenActionOptions {
Expand Down
16 changes: 2 additions & 14 deletions packages/monaco/src/browser/monaco-quick-open-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -531,22 +531,10 @@ export class MonacoQuickOpenActionProvider implements monaco.quickOpen.IActionPr
}

// tslint:disable-next-line:no-any
async getActions(element: any, entry: QuickOpenEntry | QuickOpenEntryGroup): Promise<monaco.quickOpen.IAction[]> {
const actions = await this.provider.getActions(entry.item);
getActions(element: any, entry: QuickOpenEntry | QuickOpenEntryGroup): ReadonlyArray<monaco.quickOpen.IAction> {
const actions = this.provider.getActions(entry.item);
return actions.map(action => new MonacoQuickOpenAction(action));
}

hasSecondaryActions(): boolean {
return false;
}

async getSecondaryActions(): Promise<monaco.quickOpen.IAction[]> {
return [];
}

getActionItem(): undefined {
return undefined;
}
}

interface TheiaKeybindingService {
Expand Down
5 changes: 1 addition & 4 deletions packages/monaco/src/typings/monaco/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -747,10 +747,7 @@ declare module monaco.quickOpen {

export interface IActionProvider {
hasActions(element: any, item: any): boolean;
getActions(element: any, item: any): Promise<IAction[]>;
hasSecondaryActions(element: any, item: any): boolean;
getSecondaryActions(element: any, item: any): Promise<IAction[]>;
getActionItem(element: any, item: any, action: IAction): any;
getActions(element: any, item: any): ReadonlyArray<IAction>;
}

export class QuickOpenModel implements IModel<QuickOpenEntry>, IDataSource<QuickOpenEntry>, IFilter<QuickOpenEntry>, IRunner<QuickOpenEntry> {
Expand Down
2 changes: 1 addition & 1 deletion packages/task/src/browser/task-action-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class TaskActionProvider implements QuickOpenActionProvider {
return true;
}

async getActions(): Promise<QuickOpenAction[]> {
getActions(): ReadonlyArray<QuickOpenAction> {
return [this.configureTaskAction];
}
}

0 comments on commit 2186ccb

Please sign in to comment.