-
Notifications
You must be signed in to change notification settings - Fork 329
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
Add custom context key for onTabKey/onShiftTabKey key binding. #1075
Conversation
Thanks @takumisoft68. It looks good to me (although I haven't tested how reliable it is). Will try it out soon. cc @Lemmingh. |
Could we have an Editor Context ServiceJust like the Configuration Service and the Localization Service, I'd like to have a clear and dedicated module that manages our "when clause contexts". Moreover, having a proper service layer will make migration convenient if VS Code's Context API (microsoft/vscode#10471) comes true. Could we name the keys neatlyCurrently, our keys are all prefixed by
Then, I wonder if we can name our context keys as:
Could we short-circuit the process cleverlyWe should analyze the events first to avoid unnecessary computation. Could we use the Markdown engineFull document parsing is the only way to always get correct information, and usually takes only tens of milliseconds. Handling asynchronous behavior is a tricky part. |
@yzhang-gh @Lemmingh
But I don't know what is the Markdown engine.
|
…tension.editor.cursor.inList
@yzhang-gh @Lemmingh |
Thanks a lot!
I prefer to merge them.
It is to use a Markdown syntax parser (e.g. |
Wow, an impressive change. I'm afraid I don't have much time to carefully review it now. Just a few thoughts about code style: Prefer
|
@yzhang-gh @Lemmingh
However the "use strict" is stay. I can't find strict flag in main.yml. I'm not sure that remove is ok. |
Nice overall, though I'm not sure whether the The I'm going to fix the build system this weekend. 😂 A comment I missed:
I agree, at least for now. These contexts are connected with the parsing result. Then in principle, they should be managed by the same service backed by one parsing engine. |
@yzhang-gh @Lemmingh |
Thanks for the effort! Looks like there are still three context services (list, fenced code, and math)? We can have one service for all three contexts, and that is what @Lemmingh means by "one parsing engine" (although we can just keep the regexp-based approach for now). |
@yzhang-gh @Lemmingh Unfortunately, So, would you leave it for further PR, as you say. |
We don't have to stick to the poor Anyway, I'll tackle it later. Would you like me to rebase or three-way-merge when syncing this branch with |
@Lemmingh
Can I leave it to you? |
@Lemmingh @yzhang-gh |
Perhaps you can write some verification procedures? We're updating the build system (#1119), so I'm afraid here is not much substantial work to do now. Thank you. |
@takumisoft68 Hi, long time no update. Finally I got some time to deal with this. I've resolved the merge conflicts and created a new branch https://github.com/yzhang-gh/vscode-markdown/tree/dev/context |
@yzhang-gh Hi, thank you. I'm glad to your update. I have updated my branch to catch up to dev/context branch. By rebase. |
Purpose
What's done