Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Icon does not appear when using Markdown preview. #283

Closed
2 tasks done
RokeJulianLockhart opened this issue Dec 2, 2023 · 3 comments
Closed
2 tasks done

Icon does not appear when using Markdown preview. #283

RokeJulianLockhart opened this issue Dec 2, 2023 · 3 comments

Comments

@RokeJulianLockhart
Copy link

RokeJulianLockhart commented Dec 2, 2023

To reproduce:

  1. Create .MD file.
  2. Invoke Control+Shift+V

If I instead use Ctrl+Shift+P to invoke the Command Menu and manually invoke the

Printing: Print

command, I see

TypeError: Cannot read properties of undefined (reading 'build')
    at m.<anonymous> (/home/RokeJulianLockhart/.vscode-insiders/extensions/pdconsec.vscode-print-0.11.18/dist/extension.js:2:1294617)
    at Generator.next (<anonymous>)
    at i (/home/RokeJulianLockhart/.vscode-insiders/extensions/pdconsec.vscode-print-0.11.18/dist/extension.js:2:1290301)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
@PeterWone
Copy link
Collaborator

PeterWone commented Dec 3, 2023

That's because you don't have an active editor. As clearly stated in the documentation, you can print

  • the content of the active editor by using the toolbar icon
  • the content of a file by using a context menu

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.

@RokeJulianLockhart
Copy link
Author

RokeJulianLockhart commented Dec 3, 2023

#283 (comment)

This absence of an icon is not a bug. The unhandled exception is, I suppose.

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.

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.

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.

@PeterWone
Copy link
Collaborator

PeterWone commented Dec 4, 2023

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

image

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.

@PDConSec PDConSec locked and limited conversation to collaborators Dec 4, 2023
@PeterWone PeterWone converted this issue into discussion #284 Dec 4, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants