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
Markdown Open in Preview not working #41157
Comments
That information doesn't exists and won't be easy to add because most (extension) commands are unknown until their first invocation (because of lazy loading). Not yet sure that passing multiple arguments is a good idea in general, but most importantly the first argument must be the URI as we made that API'ish. Then bleeding more (explorer internal) information to extensions is questionable. So, why do we need to pass the |
Not all editors have an resource URI, and more importantly in the open editors list, a uri can be opened multiple times, so we need to pass a pair of URI and a Group to know the exact Open Editor the command should work on. |
Which in theory you can all do with an URI. But yeah understood. However it seems to be specific to Open Editors... @isidorn @bpasero what elements can appear in the explorer that don't have a URI? same question about the open editors view. And then does it makes sense to fill the gaps? Inventing some context objects and passing them to extensions is API, so care must be taken. I'd then rather opt to skip such objects... |
@jrieken a Welcome screen can show in the Open Editors which does not have a URI. As for the explorer I believe we could cover everything with a URI. Let me check if I could refactor the explorer commands to only work with a URI. |
I changed the explorer such that we only pass the @bpasero check out my changes. Now for all the explorer commands I always get the focused element from the Open Editors I have left untouched. I can change that if we decide that we want to expose it to extensions. |
We never had that because of the stop-the-world-approach of the native menus... The challenge is that they should toggle while the menu is open (see preview/preview to side in markdown). We could have a compromise and read the alt-state before building the menu. The value of the alt-key is send as event but could also be stored there |
@bpasero yes, if the alt condition was supported I could easily plug this in. I can push that right away. |
Yeah, I was not expecting the context menu label to change once |
Yeah, depends on how to integrate this... When calling There is |
@jrieken I have modified the |
@isidorn I am seeing a bug though:
=> the "Delete Permanently" sticks and never changes back |
@bpasero I also see this corner case. The issue is that the context menu stops the world, so I do not get any events at all to update my |
@isidorn hm, we use a timeout of 0 though before opening the next menu so I would assume that gives time enough to detect that the modifier key is no longer pressed? If we need the event at all cost, you could add it to the |
@bpasero I introduced the event in the |
@isidorn I hope we can take this out when we adopted async context menu. Out of curiosity, does it make any difference if we delay the menu for a longer time, e.g. 20ms for you to find out that the key is no longer pressed? |
@bpasero I would say probably not since the user can hold down the key for as long as he wants. And the most natural scenario is that he releases the key once he sees the context menu (and then the world is blocked) |
I think its good but some doc and validation updates are now required as well. See https://code.visualstudio.com/docs/extensionAPI/extension-points#_contributesmenus and https://github.com/Microsoft/vscode/blob/master/src/vs/platform/actions/electron-browser/menusExtensionPoint.ts#L359 |
@jrieken thanks. I have simply removed the check via 627d4fd Also @bpasero and me plan to update the docs more thourougly with new group names once we have them settled in endgame week. You might have feedback on group naming, so here they are:
We need the numbers for proper group sorting. Some numbers are duplicated since those groups can not appear together on an entry. |
Open in preview for markdown in explorer context menu is not working.
@bpasero found out that we try to send over the full editor context to extensions(image).
The issue is that for the context of the commands in the explorer we are seting the resource as the first argument and the
IExplorerContext
as the second. This contains theEditorInput
which can not be serialized to JSON.We should only send the first argument over to extension the resource. @jrieken Do you think it makes sense to limit sending only the first argument to extensions, and if yes could you give me a pointer?
If that is not possible we should look into replacing the
EditorInput
with something else in theIExplorerContext
since the wholeEditorInput
is probably not needed.just fyi @mattbierner in case somebody complains about markdown preview not working
The text was updated successfully, but these errors were encountered: