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

[CLOSED] [ARCH] Impossible for extensions to override Tab key behavior where code hints might be open #4304

Open
core-ai-bot opened this issue Aug 29, 2021 · 9 comments

Comments

@core-ai-bot
Copy link
Member

Issue by peterflynn
Tuesday Aug 06, 2013 at 00:10 GMT
Originally opened as adobe/brackets#4660


  1. Install the Emmet extension
  2. In a CSS selector, type "b" and press Tab
  3. Clear the line. Type "b" again, but press Escape to close code hints before pressing Tab

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 of localStorage, this is blocked by code hints 100% of the time.

This used to work, but I think it broke in Sprint 26 when fba13c23 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).

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Tuesday Aug 06, 2013 at 00:11 GMT


CC@njx since he wrote the "global keydown hook" code in question, and@RaymondLim since I know he thinks about keyboard stuff a lot.

@core-ai-bot
Copy link
Member Author

Comment by JeffryBooher
Thursday Aug 08, 2013 at 19:20 GMT


Moving this to Backlog to consider with API enhancements card.
https://trello.com/c/rnN0XwK0/876-3-research-extension-api-design

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Friday Aug 09, 2013 at 00:36 GMT


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.

@core-ai-bot
Copy link
Member Author

Comment by njx
Friday Aug 16, 2013 at 19:49 GMT


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.

@core-ai-bot
Copy link
Member Author

Comment by TomMalbran
Friday Aug 16, 2013 at 20:31 GMT


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.

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Friday Aug 23, 2013 at 22:07 GMT


#4904 would render this whole issue moot

@core-ai-bot
Copy link
Member Author

Comment by TomMalbran
Saturday Aug 24, 2013 at 01:33 GMT


The same issue could eventually appear with other keys.

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Tuesday Aug 27, 2013 at 19:39 GMT


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.

@core-ai-bot
Copy link
Member Author

Comment by pthiess
Thursday Aug 29, 2013 at 16:34 GMT


Added a card in Trello, going to close this in here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant