-
Notifications
You must be signed in to change notification settings - Fork 7.6k
[ARCH] Impossible for extensions to override Tab key behavior where code hints might be open #4660
Comments
CC @njx since he wrote the "global keydown hook" code in question, and @RaymondLim since I know he thinks about keyboard stuff a lot. |
Moving this to Backlog to consider with API enhancements card. |
This is definitely out of scope for that story (we decided in Monday's arch meeting that no specific APIs would be considered -- only broad strokes). Reopening but leaving tagged MTB so we can find this a more suitable home on the backlog. |
Tagging [ARCH] - it's not totally obvious to me right now what the right fix is and it's probably worth discussing it at the architecture meeting. |
What about having priorities on the global keydown hooks? Emmet could then use a keydown hook with a higher priority than the keydown hook used by the Code Hints. Also, the keydown hook should receive a translated key to make it easier to distinguish between "Ctrl/Shift/Alt.. + key" from just "key". It can also receive the event, if is still required. |
#4904 would render this whole issue moot |
The same issue could eventually appear with other keys. |
Fair point -- and #4963 might eventually allow users to re-enable Tab handling for code hints, which would make even the Tab issue come back for some users. So, leaving open for now. |
Added a card in Trello, going to close this in here. |
Result:
When code hints are open, Tab selects the top item, inserting
backface-visibility:|
.When code hints not open, Tab does the Emmet behavior, inserting
bottom: |;
.Expected:
We should allow extensions to override key handling in the editor area even when code hints are (potentially) open, since code hints appear almost all the time when typing.
I have a similar case for JS snippets. E.g. I'd like to be able to type "clog"+Tab and get
console.log("|");
inserted. But because JS code hints always come up with a camelcase suggestion oflocalStorage
, this is blocked by code hints 100% of the time.This used to work, but I think it broke in Sprint 26 when fba13c2 switched code hints to a "global keydown hook" which, once installed at the time the hints open, is effectively impossible to override. I looked into many ways of getting around this hook, but afaict it is 100% impossible. (There's not even an easy way to install your own higher-precedence global hook, since there's no notification to tell you when code hints have been opened).
The text was updated successfully, but these errors were encountered: