Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Give more detail on key with missing id (KM02099) #12505

Open
1 of 8 tasks
DavidLRowe opened this issue Oct 4, 2024 · 1 comment · May be fixed by #12588
Open
1 of 8 tasks

feat: Give more detail on key with missing id (KM02099) #12505

DavidLRowe opened this issue Oct 4, 2024 · 1 comment · May be fixed by #12588

Comments

@DavidLRowe
Copy link
Contributor

Is your feature request related to a problem? Please describe.

I was moving a longpress key and cut (rather than copied) the id field from the existing location to the new longpress key, then neglected to delete the old longpress key. When I tried compiling I got:

manga_ajami.kmn - info KM05002: Building manga_ajami.kmn
manga_ajami.kmn - warn KM02099: A key on layer "default" has no identifier.
manga_ajami.kmn - info KM05010: The build failed because option "treat warnings as errors" is enabled and there are one or more warnings.
manga_ajami.kmn - info KM05007: manga_ajami.kmn failed to build.

I switched to "Code" view to see if I could identify the problem. When I tried to switch back to "Design" view I got:
manga_ajami.keyman-touch-layout - error KM04000: Exception ETouchLayoutValidate reading JSON data: Validation failure: Member id is required
I eventually found the problem by deleting information from the .keyman-touch-layout file until Developer would load the file.

Describe the solution you'd like

It'd be super nice if that warning could tell me what row number had the problem and even count the key items on the row!

Could the IDE give some visual indication (red border or background on the ID field, perhaps?) when the ID is missing or invalid? That might be annoying in practice, though.

Comment from @mcdurdin:
Unfortunately, the JSON parser and validator doesn't give us much detail (an XPath would be nice!)

Describe alternatives you've considered

Manual search through the .keyman-touch-layout file. (But I didn't find it when I tried this and had to resort to deleting layers, rows and keys until Developer loaded the file.)

If the JSON were always written out with the "id" first, followed by the "text", it might have been easier to spot. I know it's a dictionary/map and order doesn't matter, but a consistent order of keys does make a visual comparison easier.

Related issues

No response

Keyman apps

  • Keyman for Android
  • Keyman for iPhone and iPad
  • Keyman for Linux
  • Keyman for macOS
  • Keyman for Windows
  • Keyman Developer
  • KeymanWeb
  • Other - give details at bottom of form

Keyman version

17.0.330

Operating system

Windows 11

Device

No response

Target application

No response

Browser

No response

Keyboard name

No response

Keyboard version

No response

Language name

No response

Additional context

No response

@mcdurdin mcdurdin self-assigned this Oct 7, 2024
@mcdurdin mcdurdin added this to the A18S19 milestone Oct 7, 2024
@mcdurdin
Copy link
Member

image

All key validation messages in the layout compiler now include an 'address'. This should hopefully be sufficient to locate the key more quickly!

mcdurdin added a commit that referenced this issue Oct 30, 2024
…t compiler

All messages that reference keys in the touch layout will now give the
row+column index of the key with the issue (and longpress/flick/multitap
index as well if relevant).

Fixes: #12505
@mcdurdin mcdurdin modified the milestones: A18S19, A18S14 Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

2 participants