fix: validate and quick-fix duplicate languages in CHECKCFG#1376
Draft
joaodinissf wants to merge 1 commit into
Draft
fix: validate and quick-fix duplicate languages in CHECKCFG#1376joaodinissf wants to merge 1 commit into
joaodinissf wants to merge 1 commit into
Conversation
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>
133312f to
c89159f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
CheckCfgValidator.checkConfiguredLanguageUnique): reports an error on each duplicateConfiguredLanguageValidatorthat shares a language name. Mirrors the existing catalog/check/parameter uniqueness validators and reuses thegetDuplicates()helper.CheckCfgQuickfixProvider.removeDuplicateLanguageConfiguration): merges every later block's parameter and catalog configurations into the first occurrence and deletes the duplicates.CheckCfgTest; the surroundingcheckcfg.core.testvalidation 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