Skip to content

fix: validate and quick-fix duplicate languages in CHECKCFG#1376

Draft
joaodinissf wants to merge 1 commit into
dsldevkit:masterfrom
joaodinissf:fix/checkcfg-duplicate-language-validation
Draft

fix: validate and quick-fix duplicate languages in CHECKCFG#1376
joaodinissf wants to merge 1 commit into
dsldevkit:masterfrom
joaodinissf:fix/checkcfg-duplicate-language-validation

Conversation

@joaodinissf
Copy link
Copy Markdown
Collaborator

What

Adds an error-severity validation and a quick-fix for duplicate language configurations in a CHECKCFG file, closing a gap that has existed since 2018.

The CHECKCFG grammar accepts multiple for <Language> { ... } blocks in a single configuration. There was no validation against the same language appearing twice, so duplicates were silently accepted with no defined semantics for how their configurations combine.

Changes

  • Validation (CheckCfgValidator.checkConfiguredLanguageUnique): reports an error on each duplicate ConfiguredLanguageValidator that shares a language name. Mirrors the existing catalog/check/parameter uniqueness validators and reuses the getDuplicates() helper.
  • Quick-fix (CheckCfgQuickfixProvider.removeDuplicateLanguageConfiguration): merges every later block's parameter and catalog configurations into the first occurrence and deletes the duplicates.
  • Tests in CheckCfgTest; the surrounding checkcfg.core.test validation files are migrated Xtend → Java to add them.

Notes

Revives the approach from the long-closed #104 (validation + merge quick-fix), reimplemented against the current Java validator/quick-fix code, which was renamed and migrated off Xtend since 2018.

Verified locally: mvn -pl :com.avaloq.tools.ddk.checkcfg.ui,:com.avaloq.tools.ddk.checkcfg.core -am clean verify → BUILD SUCCESS.

Closes #103

🤖 Generated with Claude Code

The CHECKCFG grammar accepts multiple `for <Language> { ... }` blocks in one
configuration. Nothing validated against the same language appearing twice, so
duplicate blocks were silently allowed with no defined semantics for how their
configurations combine.

Add an error-severity validation plus a quick-fix:

  - checkConfiguredLanguageUnique on CheckConfiguration reports an error on each
    duplicate ConfiguredLanguageValidator sharing a language name. Mirrors the
    existing catalog/check/parameter uniqueness validators and reuses the
    getDuplicates() helper. Simpler than the catalog case: getLanguage() returns
    a String, so no proxy check is needed.
  - removeDuplicateLanguageConfiguration quick-fix merges every later block's
    parameter and catalog configurations into the first occurrence and deletes
    the duplicates.

Tests live in CheckCfgTest; the surrounding checkcfg.core.test validation files
are migrated Xtend -> Java to add them.

This revives the approach from the long-closed dsldevkit#104 (validation + merge
quick-fix), reimplemented against the current Java validator/quick-fix code,
which was renamed and migrated off Xtend since 2018.

Closes dsldevkit#103

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@joaodinissf joaodinissf force-pushed the fix/checkcfg-duplicate-language-validation branch from 133312f to c89159f Compare May 30, 2026 10:58
@joaodinissf joaodinissf marked this pull request as draft May 30, 2026 17:14
@joaodinissf joaodinissf changed the title fix: validate and quick-fix duplicate languages in CHECKCFG (closes #103) fix: validate and quick-fix duplicate languages in CHECKCFG May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CHECKCFG allows duplicate languages

1 participant