taskConfiguration.ts ×13

Frontier kind: Joint frontier

unlabeled · c_223613d743b6

1 test · 21104 LOC · 80 files · introduces 1 test · 93 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
20 ranges93 lines · 2 files
Tests
1 test

Contains — complete concept membership

All code (extent)
2402 ranges21104 lines · 80 files · Browse complete extent
All tests (intent)
1 testBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

1 test introduced at this concept.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

2 files ranked by introduced lines: 93 introduced LOC across 20 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/workbench/contrib/tasks/common/taskConfiguration.ts 61 introduced LOC · 13 ranges

Open complete file

1383
1384 if (properties) {
1385 > for (const propertyName of Object.keys(properties)) { taskConfiguration.ts
1386 if (external[propertyName] !== undefined) {
1387 result[propertyName] = Objects.deepClone(external[propertyName]);
1388 }
1389 }
1391
1392 if (Types.isString(external.taskName)) {
1459
1460 export function from(this: void, external: IConfiguringTask, context: IParseContext, index: number, source: TaskConfigSource, registry?: Partial<ITaskDefinitionRegistry>): Tasks.ConfiguringTask | undefined {
1461 > if (!external) { taskConfiguration.ts
1462 return undefined;
1463 }
1464 > const type = external.type; taskConfiguration.ts
1465 > const customize = (external as ICustomizeShape).customize;
1466 > if (!type && !customize) {
1467 context.problemReporter.error(nls.localize('ConfigurationParser.noTaskType', 'Error: tasks configuration must have a type property. The configuration will be ignored.\n{0}\n', JSON.stringify(external, null, 4)));
1468 return undefined;
1469 }
1470 > const typeDeclaration = type ? registry?.get?.(type) || TaskDefinitionRegistry.get(type) : undefined; taskConfiguration.ts
1471 > if (!typeDeclaration) {
1472 const message = nls.localize('ConfigurationParser.noTypeDefinition', 'Error: there is no registered task type \'{0}\'. Did you miss installing an extension that provides a corresponding task provider?', type);
1473 context.problemReporter.error(message);
1474 return undefined;
1475 }
1476 > let identifier: Tasks.ITaskIdentifier | undefined; taskConfiguration.ts
1477 > if (Types.isString(customize)) {
1478 if (customize.indexOf(grunt) === 0) {
1479 identifier = { type: 'grunt', task: customize.substring(grunt.length) };
1487 identifier = { type: 'typescript', tsconfig: customize.substring(typescript.length + 6) };
1488 }
1489 > } else { taskConfiguration.ts
1490 > if (Types.isString(external.type)) {
1491 > identifier = external as Tasks.ITaskIdentifier;
1492 > }
1493 > }
1494 > if (identifier === undefined) {
1495 context.problemReporter.error(nls.localize(
1496 'ConfigurationParser.missingType',
1499 return undefined;
1500 }
1501 > const taskIdentifier: Tasks.KeyedTaskIdentifier | undefined = Tasks.TaskDefinition.createTaskIdentifier(identifier, context.problemReporter); taskConfiguration.ts
1502 > if (taskIdentifier === undefined) {
1503 context.problemReporter.error(nls.localize(
1504 'ConfigurationParser.incorrectType',
1507 return undefined;
1508 }
1509 > const configElement: Tasks.ITaskSourceConfigElement = { taskConfiguration.ts
1510 > workspaceFolder: context.workspaceFolder,
1511 > file: '.vscode/tasks.json',
1512 > index,
1513 > element: external
1514 > };
1515 > let taskSource: Tasks.FileBasedTaskSource;
1516 > switch (source) {
1517 > case TaskConfigSource.User: {
1518 taskSource = { kind: Tasks.TaskSourceKind.User, config: configElement, label };
1519 break;
1520 }
1521 > case TaskConfigSource.WorkspaceFile: { taskConfiguration.ts
1522 taskSource = { kind: Tasks.TaskSourceKind.WorkspaceFile, config: configElement, label };
1523 break;
1524 }
1525 > default: { taskConfiguration.ts
1526 > taskSource = { kind: Tasks.TaskSourceKind.Workspace, config: configElement, label };
1527 > break;
1528 > }
1529 > }
1530 > const result: Tasks.ConfiguringTask = new Tasks.ConfiguringTask(
1531 > `${typeDeclaration.extensionId}.${taskIdentifier._key}`,
1532 > taskSource,
1533 > undefined,
1534 > type,
1535 > taskIdentifier,
1536 > RunOptions.fromConfiguration(external.runOptions),
1537 > { hide: external.hide, inAgents: external.inAgents }
1538 > );
1539 > const configuration = ConfigurationProperties.from(external as IConfigurationProperties & { [key: string]: unknown }, context, true, source, typeDeclaration.properties);
1540 > result.addTaskLoadMessages(configuration.errors);
1541 > if (configuration.value) {
1542 > result.configurationProperties = Object.assign(result.configurationProperties, configuration.value);
1543 > if (result.configurationProperties.name) {
1544 > result._label = result.configurationProperties.name;
1545 > } else {
1546 let label = result.configures.type;
1547 if (typeDeclaration.required && typeDeclaration.required.length > 0) {
1556 result._label = label;
1557 }
1558 > if (!result.configurationProperties.identifier) { taskConfiguration.ts
1559 > result.configurationProperties.identifier = taskIdentifier._key;
1560 > }
1561 > }
1562 > return result;
1563 > }
1564 }
1565
1816 }
1817 } else {
1818 > const configuredTask = ConfiguringTask.from(external, context, index, source, registry); taskConfiguration.ts
1819 > if (configuredTask) {
1820 > configuredTask.addTaskLoadMessages(context.taskLoadIssues);
1821 > result.configured.push(configuredTask);
1822 > }
1823 > }
1824 context.taskLoadIssues = Objects.deepClone(baseLoadIssues);
1825 }
src/vs/workbench/contrib/tasks/common/tasks.ts 32 introduced LOC · 7 ranges

Open complete file

639 }
640 if (type) {
641 > this.type = type; tasks.ts
642 > }
643 this.runOptions = runOptions;
644 this.configurationProperties = configurationProperties;
886
887 public constructor(id: string, source: FileBasedTaskSource, label: string | undefined, type: string | undefined,
888 > configures: KeyedTaskIdentifier, runOptions: IRunOptions, configurationProperties: IConfigurationProperties) { tasks.ts
889 > super(id, label, type, runOptions, configurationProperties, source);
890 > this._source = source;
891 > this.configures = configures;
892 > }
893
894 public static is(value: unknown): value is ConfiguringTask {
1340 export namespace KeyedTaskIdentifier {
1341 function sortedStringify(literal: Record<string, unknown>): string {
1342 > const keys = Object.keys(literal).sort(); tasks.ts
1343 > let result: string = '';
1344 > for (const key of keys) {
1345 > let stringified = literal[key];
1346 > if (stringified instanceof Object) {
1347 stringified = sortedStringify(stringified as Record<string, unknown>);
1348 > } else if (typeof stringified === 'string') { tasks.ts
1349 > stringified = stringified.replace(/,/g, ',,');
1350 > }
1351 > result += key + ',' + stringified + ',';
1352 > }
1353 > return result;
1354 > }
1355 export function create(value: ITaskIdentifier): KeyedTaskIdentifier {
1356 > const resultKey = sortedStringify(value); tasks.ts
1357 > const result = { _key: resultKey, type: value.taskType as string };
1358 > Object.assign(result, value);
1359 > return result;
1360 > }
1361 }
1362
1390 export namespace TaskDefinition {
1391 export function createTaskIdentifier(external: ITaskIdentifier, reporter: { error(message: string): void }): KeyedTaskIdentifier | undefined {
1392 > const definition = TaskDefinitionRegistry.get(external.type); tasks.ts
1393 > if (definition === undefined) {
1394 > // We have no task definition so we can't sanitize the literal. Take it as is
1395 > const copy = Objects.deepClone(external);
1396 > delete copy._key;
1397 > return KeyedTaskIdentifier.create(copy);
1398 > }
1399
1400 const literal: { type: string;[name: string]: unknown } = Object.create(null);
1435 }
1436 return KeyedTaskIdentifier.create(literal);
1437 > } tasks.ts
1438 }
1439