-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Load all key bindings that parse and use markdown in error notifications #23113
Merged
Conversation
This file contains 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
cla-bot
bot
added
the
cla-signed
The user has signed the Contributor License Agreement
label
Jan 14, 2025
mgsloan
force-pushed
the
load-all-keybindings-that-parse
branch
5 times, most recently
from
January 14, 2025 10:22
3c1b6be
to
2cc12d5
Compare
mgsloan
added a commit
that referenced
this pull request
Jan 16, 2025
Motivation for this change is #23113, but this will also be the state of it after the gpui refactor.
mgsloan
added a commit
that referenced
this pull request
Jan 16, 2025
Motivation for this is using markdown for keymap error notifications in #23113
This was referenced Jan 16, 2025
mgsloan
added a commit
that referenced
this pull request
Jan 16, 2025
Falls back on notifying all workspaces if there isn't an active one. This is to support notifying the user about keymap file errors in #23113. It will also be useful for notifying about settings file errors.
mgsloan
added a commit
that referenced
this pull request
Jan 16, 2025
Motivation for this is using markdown for keymap error notifications in #23113 Release Notes: - N/A
mgsloan
added a commit
that referenced
this pull request
Jan 16, 2025
Motivation for this is using markdown for keymap error notifications in #23113, but it also benefits the copied text of repl tables. Release Notes: - N/A
mgsloan
added a commit
that referenced
this pull request
Jan 16, 2025
* Collects and reports all parse errors * Shares parsed `KeyBindingContextPredicate` among the actions. * Renames "block" to "section" to match the docs, as types like `KeymapSection` are shown in `json-language-server` hovers. * Removes wrapping of `context` and `use_key_equivalents` fields so that `json-language-server` auto-inserts `""` and `false` instead of `null`. * Updates `add_to_cx` to take `&self`, so that the user keymap doesn't get unnecessarily cloned. Use structured error types for keybinding load Motivation for this is so that #23113 can instead render these as markdown for display.
mgsloan
force-pushed
the
load-all-keybindings-that-parse
branch
2 times, most recently
from
January 16, 2025 13:04
048a826
to
773ea9e
Compare
mgsloan
changed the title
Load all keybindings that parse instead of omitting them all on error
Load all key bindings that parse and use markdown in error notifications
Jan 16, 2025
mgsloan
force-pushed
the
load-all-keybindings-that-parse
branch
6 times, most recently
from
January 17, 2025 23:46
66fe0f9
to
4f3c863
Compare
mgsloan
force-pushed
the
load-all-keybindings-that-parse
branch
from
January 18, 2025 20:14
4f3c863
to
3feb51b
Compare
Open
1 task
mgsloan
force-pushed
the
load-all-keybindings-that-parse
branch
from
January 18, 2025 20:44
3feb51b
to
21410b8
Compare
mgsloan
force-pushed
the
load-all-keybindings-that-parse
branch
2 times, most recently
from
January 18, 2025 21:49
2a78114
to
6b51a1b
Compare
* Collects and reports all parse errors * Shares parsed `KeyBindingContextPredicate` among the actions. * Removes use of callback for `handle_keymap_file_changes` to send notification, instead uses `show_app_notification` added in #23226 * Renames "block" to "section" to match the docs, as types like `KeymapSection` are shown in `json-language-server` hovers. * Removes wrapping of `context` and `use_key_equivalents` fields so that `json-language-server` auto-inserts `""` and `false` instead of `null`. * Updates `add_to_cx` to take `&self`, so that the user keymap doesn't get unnecessarily cloned.
Good suggestion from Conrad!
mgsloan
force-pushed
the
load-all-keybindings-that-parse
branch
from
January 18, 2025 22:17
6b51a1b
to
e7a07fa
Compare
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.
Collects and reports all parse errors
Shares parsed
KeyBindingContextPredicate
among the actions.Updates gpui keybinding and action parsing to return structured errors.
Renames "block" to "section" to match the docs, as types like
KeymapSection
are shown injson-language-server
hovers.Removes wrapping of
context
anduse_key_equivalents
fields so thatjson-language-server
auto-inserts""
andfalse
instead ofnull
.Updates
add_to_cx
to take&self
, so that the user keymap doesn't get unnecessarily cloned.In retrospect I wish I'd just switched to using TreeSitter to do the parsing and provide proper diagnostics. This is tracked in #23333
Release Notes: