Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align 'ActionProvider' related entities with VS Code #6302

Merged
merged 1 commit into from
Oct 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

less exposed types, awesome!

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];
}
}