Icon does not appear when using Markdown preview. #284
Replies: 4 comments 1 reply
-
That's because you don't have an active editor. As clearly stated in the documentation, you can print
Display of toolbar icons is decided by VS Code, not by extensions. Extensions declare an interest in language identifiers. When VS code makes an editor active, it assesses the language identifier for the content of the editor. Then it displays whatever icons have been contributed by extensions associated with that language identifier. When you put the focus on a window contributed by VS Code's built-in Markdown preview extension, you don't have an active editor so no extension contributed icons are displayed. This absence of an icon is not a bug. The unhandled exception is, I suppose. If you want to be able to print from the built-in preview editor (which is a built-in extension and could proxy the icon) take it up with Matt Bierner. He's responsible for the built-in preview extension. You won't see it on his personal repositories because it's in a Microsoft repo. |
Beta Was this translation helpful? Give feedback.
-
Yes, @PeterWone, I don't dispute this. I believe I have phrased this as an FR. Consequently, do you mean to imply that this is impossible to provide per VSCode's current extension architecture? If so, I'm happy to file an issue with VSCode itself. Alternatively, are FRs not accepted as issues in this repository? I'm happy to separate the BR regarding the exception and the FR regarding my desire for this functionality if that's assistive in triage.
Regardless, I'll contact @mjbvz. Thanks for that. I'll file it formally as an issue at VSCode's public repository, considering that it's in-built by default into the editor. |
Beta Was this translation helpful? Give feedback.
-
Feature requests are certainly accepted. I was in the middle of an explanation of why it can't be done when I noticed that these guys have done it! Most of the information in extension authoring docs and stack overflow says what I said earlier. But look at this That blue icon remains visible when the preview pane is active (ie no active editor). I will move this feature request to the correct place and investigate. You should get a notification from github about where I moved it. Please raise future feature requests there. Also please remember to revise the review score you gave when the issue has been resolved. |
Beta Was this translation helpful? Give feedback.
-
Looks like they did it by registering an activity panel. That's not really a meaningful thing for Print to do but I could register one and hide it. That's a bit hacky but it might work. Then I'd have to figure out how to determine the file being shown in the Markdown preview. This may not be possible, because it's not possible to listen to messages addressed to another extension, but I'll see what I can come up with. Right now I'm supposed to be working so I'll shelve this till this evening. Although this is a fascinating technical problem, to be honest a better solution would be to turn off Hot update in browser preview is something I'm looking into. It's not trivial but I think I can probably do it using CRDP (Chrome remote debug protocol). If I get that to work it would also be possible to implement scroll synchronization like what the built-in preview does. |
Beta Was this translation helpful? Give feedback.
-
To reproduce:
.MD
file.If I instead use Ctrl+Shift+P to invoke the Command Menu and manually invoke the
command, I see
Beta Was this translation helpful? Give feedback.
All reactions