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

add content assist for input variables in tasks.json #6334

Merged
merged 1 commit into from
Oct 7, 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
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