feat(developer): kmc-convert add line numbers to the err when using reportMessage() 😎
- Dominant language
- Pascal
- Stars
- 534
- Forks
- 143
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 113
Description
At present kmc-convert writes out an Error message while finding an Error during validation.
This is done in the `validate() `function of `developer/src/kmc-convert/src/keylayout-to-kmn/keylayout-file-reader.ts` :
```
public validate(source: KeylayoutXMLSourceFile): boolean {
if (!SchemaValidators.default.keylayout(source)) {
for (const err of (SchemaValidators.default.keylayout).errors) {
this.callbacks.reportMessage(DeveloperUtilsMessages.Error_SchemaValidationError({
instancePath: err.instancePath,
keyword: err.keyword,
message: err.message || 'Unknown AJV Error', // docs say 'message' is optional if 'messages:false' in options
params: Object.entries(err.params || {}).sort().map(([k, v]) => `${k}="${v}"`).join(' '),
}));
}
return false;
}
return true;
}
```
**For the future we need to write out line numbers as well. This can be done similar to the solution in kmc-ldml.**
see [comment ](https://github.com/keymanapp/keyman/pull/14013#discussion_r2211593294) in PR #14013
Contributor guide
Assessment
This issue has not been assessed yet.