ZIm/crates/language_tools/src
张小白 f0ef3110d3
gpui: Introduce PlatformKeyboardLayout trait for human-friendly keyboard layout names (#29049)
This PR adds a new `PlatformKeyboardLayout` trait with two methods:
`id(&self) -> &str` and `name(&self) -> &str`. The `id()` method returns
a unique identifier for the keyboard layout, while `name()` provides a
human-readable name. This distinction is especially important on
Windows, where the `id` and `name` can be quite different. For example,
the French layout has an `id` of `0000040C`, which is not
human-readable, whereas the `name` would simply be `French`. Currently,
the existing `keyboard_layout()` method returns what's essentially the
same as `id()` in this new design.

This PR implements the `name()` method for both Windows and macOS. On
Linux, for now, `name()` still returns the same value as `id()`.

Release Notes:

- N/A
2025-04-19 22:23:03 +08:00
..
key_context_view.rs gpui: Introduce PlatformKeyboardLayout trait for human-friendly keyboard layout names (#29049) 2025-04-19 22:23:03 +08:00
language_tools.rs Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
lsp_log.rs debugger_ui: Preview thread state when using the dropdown (#28778) 2025-04-15 12:10:32 -04:00
lsp_log_tests.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
syntax_tree_view.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00