Goal
Add a study validation report to VSCode-Aster, inspired by the AsterStudy validity view.
The report should check the consistency of the current code_aster study at two levels:
- Command / concept validity inside the
.comm file.
- I/O validity between
UNITE values used in the .comm file and file units declared in the .export file.
This feature is not intended to prove that the model is physically correct or that the computation will converge. It should detect common structural issues before running the case.
User Story
As a code_aster user, I want to validate my input study before running it, so that I can quickly detect missing concepts, unused definitions, naming issues, and mismatches between UNITE values in the .comm file and file declarations in the .export file.
Expected UX
Add a VSCode command:
VSCode-Aster: Validate Current Study
This command should generate a validation report for the active study.
The active study can be resolved from:
- the currently opened
.comm file;
- the associated
.export file, if it can be found automatically;
- or a user-selected
.export file if automatic resolution is ambiguous.
The result should be visible in two places:
- VSCode Problems panel for actionable diagnostics.
- A dedicated Validation Report view or WebView for a global overview.
1. Command / Concept Validity
The report should display one line per detected command/concept, with a layout similar to AsterStudy:
| Concept |
Command |
Syntactic |
Dependency |
Naming |
Used |
| mesh |
LIRE_MAILLAGE |
✅ |
✅ |
✅ |
✅ |
| model |
AFFE_MODELE |
✅ |
✅ |
✅ |
✅ |
| mater |
DEFI_MATERIAU |
✅ |
✅ |
✅ |
✅ |
| fieldmat |
AFFE_MATERIAU |
✅ |
✅ |
✅ |
✅ |
| bc |
AFFE_CHAR_MECA |
✅ |
✅ |
✅ |
✅ |
| res |
MECA_STATIQUE |
✅ |
✅ |
✅ |
✅ |
[noname] |
IMPR_RESU |
✅ |
✅ |
✅ |
— |
[noname] |
FIN |
✅ |
✅ |
✅ |
— |
Checks
Syntactic
Check that the command is recognized and has a minimally valid structure.
Examples:
- balanced parentheses;
- valid concept assignment;
- recognized code_aster command;
- parsable keyword blocks.
Dependency
Check that concepts used by a command have been previously defined or can be resolved.
Example diagnostic:
Undefined concept: mesh
Used in keyword: MAILLAGE
Command: AFFE_MODELE
Naming
Check basic naming consistency.
Initial rules can be simple:
- concept name is a valid identifier;
- concept is not accidentally redefined;
- command producing a concept is not unnamed.
This check should mostly produce warnings, not blocking errors.
Used
Check whether a concept produced by a command is used later in the study.
Example diagnostic:
Concept 'mater' is defined by DEFI_MATERIAU but never used.
Commands that do not produce concepts, such as DEBUT, FIN, IMPR_RESU, can be marked as not applicable.
2. I/O Validity: .comm / .export Unit Consistency
The report should verify that logical units used in the .comm file are properly declared in the associated .export file.
Example .comm:
mesh = LIRE_MAILLAGE(UNITE=20, FORMAT="MED")
IMPR_RESU(UNITE=80, FORMAT="MED", RESU=_F(RESULTAT=res))
Example .export:
F comm case.comm D 1
F mmed mesh.med D 20
F mess case.mess R 6
F rmed result.rmed R 80
Expected I/O Table
| Unit |
Direction |
File |
Export Type |
Used In .comm |
Status |
| 1 |
Input |
case.comm |
comm |
implicit |
✅ |
| 6 |
Output |
case.mess |
mess |
implicit |
✅ |
| 20 |
Input |
mesh.med |
mmed |
LIRE_MAILLAGE |
✅ |
| 80 |
Output |
result.rmed |
rmed |
IMPR_RESU |
✅ |
| 33 |
Unknown |
— |
— |
LIRE_TABLE |
❌ |
| 90 |
Output |
unused.med |
rmed |
— |
⚠️ |
I/O Checks
Unit used in .comm but missing from .export
Example diagnostic:
UNITE=20 is used in LIRE_MAILLAGE but no matching file is declared in the export file.
Suggested severity: Error.
Unit declared in .export but not used in .comm
Example diagnostic:
Unit 21 is declared in the export file but is not explicitly used in the command file.
Suggested severity: Information or Warning.
Input/output direction mismatch
Example:
mesh = LIRE_MAILLAGE(UNITE=20, FORMAT="MED")
with:
Expected diagnostic:
UNITE=20 is used as input by LIRE_MAILLAGE but is declared as output in the export file.
Suggested severity: Error.
Definition of Done
This issue is complete when:
- A command
VSCode-Aster: Validate Current Study is available.
- The active
.comm file is parsed.
- Concepts produced by common commands are listed in a report.
- The report includes the columns:
- Concept
- Command
- Syntactic
- Dependency
- Naming
- Used
- Simple concept dependencies are checked.
- Unused concepts are detected.
- The associated
.export file is parsed when available.
- Literal
UNITE=<integer> values are extracted from the .comm file.
- File units are extracted from the
.export file.
- Units used in
.comm but missing from .export are reported.
- Units declared in
.export but unused in .comm are reported.
- Input/output direction mismatches are reported for supported commands.
- Diagnostics are visible in the VSCode Problems panel.
- A global validation report is visible in a dedicated view or WebView.
- Unit tests cover at least:
- a valid study;
- an undefined concept;
- an unused concept;
- a unit used in
.comm but missing from .export;
- a unit declared in
.export but unused in .comm;
- an input/output direction mismatch.
Goal
Add a study validation report to VSCode-Aster, inspired by the AsterStudy validity view.
The report should check the consistency of the current code_aster study at two levels:
.commfile.UNITEvalues used in the.commfile and file units declared in the.exportfile.This feature is not intended to prove that the model is physically correct or that the computation will converge. It should detect common structural issues before running the case.
User Story
As a code_aster user, I want to validate my input study before running it, so that I can quickly detect missing concepts, unused definitions, naming issues, and mismatches between
UNITEvalues in the.commfile and file declarations in the.exportfile.Expected UX
Add a VSCode command:
This command should generate a validation report for the active study.
The active study can be resolved from:
.commfile;.exportfile, if it can be found automatically;.exportfile if automatic resolution is ambiguous.The result should be visible in two places:
1. Command / Concept Validity
The report should display one line per detected command/concept, with a layout similar to AsterStudy:
LIRE_MAILLAGEAFFE_MODELEDEFI_MATERIAUAFFE_MATERIAUAFFE_CHAR_MECAMECA_STATIQUE[noname]IMPR_RESU[noname]FINChecks
Syntactic
Check that the command is recognized and has a minimally valid structure.
Examples:
Dependency
Check that concepts used by a command have been previously defined or can be resolved.
Example diagnostic:
Naming
Check basic naming consistency.
Initial rules can be simple:
This check should mostly produce warnings, not blocking errors.
Used
Check whether a concept produced by a command is used later in the study.
Example diagnostic:
Commands that do not produce concepts, such as
DEBUT,FIN,IMPR_RESU, can be marked as not applicable.2. I/O Validity:
.comm/.exportUnit ConsistencyThe report should verify that logical units used in the
.commfile are properly declared in the associated.exportfile.Example
.comm:Example
.export:Expected I/O Table
.commcase.commcommcase.messmessmesh.medmmedLIRE_MAILLAGEresult.rmedrmedIMPR_RESULIRE_TABLEunused.medrmedI/O Checks
Unit used in
.commbut missing from.exportExample diagnostic:
Suggested severity: Error.
Unit declared in
.exportbut not used in.commExample diagnostic:
Suggested severity: Information or Warning.
Input/output direction mismatch
Example:
with:
Expected diagnostic:
Suggested severity: Error.
Definition of Done
This issue is complete when:
VSCode-Aster: Validate Current Studyis available..commfile is parsed..exportfile is parsed when available.UNITE=<integer>values are extracted from the.commfile..exportfile..commbut missing from.exportare reported..exportbut unused in.commare reported..commbut missing from.export;.exportbut unused in.comm;