construct::ui::DefinitionRecordValidator

Validates a definition record text, and gives each finding the editor tab and the line where it shows.

Declared in src/libs/libconstruct/construct/ui/DefinitionRecordValidator.hpp

Detailed description

construct-definition-editor §DUD-6a. One run makes one list of diagnostics, from these sources, in this order:

  1. The text parses (Registry::definitionFromYaml()): the Source tab, on the line of the parse error. Nothing else runs on a text that does not parse, because there is no definition to check.
  2. Definition::validationIssues(): the Source tab, on the line of the key that the finding names.
  3. Registry::problemWithDefinitionData(), the check that OPAL `construct.definition.add` and `update` run. A primary function with no known prefix goes to the Shader tab, on the first line of a function. The slot limit goes to the Source tab, on the `parameters` line. A compile failure goes to the Shader tab, on the line of the primary function, but only when the next source has not already reported it line by line.
  4. ShaderValidator on `shaderCode`, wrapped by ShaderValidator::wrapDefinitionFunctions(): the Shader tab, on the line of the GLSL less the wrapper's header.
  5. ShaderValidator on `blend`, through the blend wrapper of the renderer (ShaderDispatchGenerator::wrapBlendBody()): the Blend tab, on the line of the blend body.
  6. The errors of stageDefinitionPreview() for the operands of the `preview` block: the Preview tab, on the line of the operand.
  7. The `lipschitz` formula (§DW-8, evaluateBoundExpression()): the Source tab, on the `lipschitz` line.
  8. The parameter rule of §DUD-6d: a parameter that the record declares and the shader signature does not is a warning on its line. A parameter of the signature that the record does not declare is no diagnostic, because the load path adds it.

A Shader or Blend line is a line of the text of that block, as the tab shows it. A Preview line is a line of the `preview` block, dedented. A Source line is a line of the whole record.

It has no widget, so the unit suite testDefinitionEditorLogic runs it without a screen (§DUE-3e).