feat(core): add km_core_state_context_debug API 🌱#10377
feat(core): add km_core_state_context_debug API 🌱#10377mcdurdin merged 8 commits intoepic/core/9999-normalizationfrom
km_core_state_context_debug API 🌱#10377Conversation
Fixes #10365. Adds a `km_core_state_context_debug` function that returns a km_core_cp string containing the current cached or intermediate context. The function must be used only for debug logging purposes -- the string is not intended to parsed for other purposes and the format may change in the future. This commit adds the function and corresponding unit tests. Subsequent commits will update existing context debug functions in various engines to use this API endpoint instead.
User Test ResultsTest specification and instructions User tests are not required Test Artifacts
|
|
@ermshiperete I see an error with the libkeymancore.symbols file in the Debian Packaging which I don't really understand: https://github.com/keymanapp/keyman/actions/runs/7523138690/job/20476241685 Can you explain? Also, should I be adding the new API symbols to that file? |
|
#10386 should fix the packaging failure. |
linux/debian/libkeymancore.symbols
Outdated
| km_core_context_length@Base 17.0.195 | ||
| km_core_context_set@Base 17.0.195 | ||
| km_core_context_shrink@Base 17.0.195 | ||
| km_core_cp_dispose@Base 17.0.241 |
There was a problem hiding this comment.
You should use the version number that is current when it gets merged otherwise the API check will flag it.
| As of version 17, the cached context is an internal property of the | ||
| state, not exposed to the consumer of the API -- apart from the | ||
| Keyman Developer Keyboard Debugger. However, for other debug | ||
| purposes, it is helpful to be able to examine the cached context, so |
There was a problem hiding this comment.
| purposes, it is helpful to be able to examine the cached context, so | |
| purposes, it is helpful for keyboard authors to be able to examine the cached context, so |
or maybe "users of the debugger"? trying to capture the nuance here, that this is exposed to third party users?
There was a problem hiding this comment.
This is for use by consumers of the API -- i.e. Keyman Engine. So not really useful to keyboard authors or users of the Keyman Developer debugger. It's useful for us.
| buffer << " U+" << std::hex << std::setfill('0') << std::setw(4) << std::hex << cp->character; | ||
| } else { | ||
| // A marker | ||
| buffer << " M(" << cp->marker << ")"; |
There was a problem hiding this comment.
Is this format used anywhere else? I have used \m(1) but only because it matches LDML. Are there prior debugging strings which look similar to these, out of curiosity.
There was a problem hiding this comment.
No, because we used to call markers 'deadkeys', so most other log statements have something like dk(1).
Note: resolved merge conflict with action_api.cpp by shifting new code into state_context_api.cpp.
Co-authored-by: Steven R. Loomis <srl295@gmail.com>
km_core_state_context_debugkm_core_state_context_debug API
km_core_state_context_debug APIkm_core_state_context_debug API 🌱
Fixes #10365.
Adds a
km_core_state_context_debugfunction that returns a km_core_cp string containing the current cached or intermediate context. The function must be used only for debug logging purposes -- the string is not intended to parsed for other purposes and the format may change in the future.This commit adds the function and corresponding unit tests. Subsequent commits will update existing context debug functions in various engines to use this API endpoint instead.
@keymanapp-test-bot skip