Skip to content

Commit

Permalink
add content assist for input variables in tasks.json
Browse files Browse the repository at this point in the history
- content assist is added to help the users of tasks.json input variables.
- changes made to VariableResolverService and CommonVariableContribution
in #6331 are reverted.

Signed-off-by: Liang Huang <liang.huang@ericsson.com>
  • Loading branch information
Liang Huang authored and vince-fugnitto committed Oct 7, 2019
1 parent 0f7fc56 commit f73e224
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion packages/task/src/browser/task-schema-updater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { injectable, inject } from 'inversify';
import { JsonSchemaStore } from '@theia/core/lib/browser/json-schema-store';
import { InMemoryResources, deepClone } from '@theia/core/lib/common';
import { IJSONSchema } from '@theia/core/lib/common/json-schema';
import { inputsSchema } from '@theia/variable-resolver/lib/browser/variable-input-schema';
import URI from '@theia/core/lib/common/uri';
import { TaskService } from './task-service';

Expand All @@ -42,7 +43,8 @@ export class TaskSchemaUpdater {
items: {
...deepClone(taskConfigurationSchema)
}
}
},
inputs: inputsSchema.definitions!.inputs
}
};
const taskTypes = await this.taskService.getRegisteredTaskTypes();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export class CommonVariableContribution implements VariableContribution {
const inputs = !!configuration && 'inputs' in configuration ? configuration.inputs : undefined;
const input = Array.isArray(inputs) && inputs.find(item => !!item && item.id === variable);
if (!input) {
throw new Error(`Undefined input variable "${variable}" encountered. Remove or define "${variable}" to continue.`);
return undefined;
}
if (input.type === 'promptString') {
if (typeof input.description !== 'string') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ export namespace VariableResolverService {
} catch (e) {
console.error(`Failed to resolved '${name}' variable`, e);
this.resolved.set(name, undefined);
throw e;
}
}

Expand Down

0 comments on commit f73e224

Please sign in to comment.