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

When using registerTextDocumentContentProvider, the view blocks Copy command #6984

Closed
cfjedimaster opened this issue May 27, 2016 · 6 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s)

Comments

@cfjedimaster
Copy link

  • VSCode Version: 1.1.1
  • OS Version: OSX

I'm the author of a plugin (https://github.com/cfjedimaster/htmlescape-vscode) that takes code in the editor (or a selection), and creates a view of an escaped version of it. (This is so the code could be used in an HTML blog post.) Recently I noticed that while my extension works, selecting text in the view and trying to copy it to the clipboard no longer works.
Steps to Reproduce:

  1. Install the extension (it is available in the market place).
  2. Open any file, and execute the command ("Show Escaped HTML").
  3. In the new view that opens up, select some of the escaped HTML, do Command-C, then paste in some other editor. Nothing will show up.
@jrieken jrieken self-assigned this May 30, 2016
@jrieken
Copy link
Member

jrieken commented May 30, 2016

do you use previewHtml?

@cfjedimaster
Copy link
Author

No. From https://github.com/cfjedimaster/htmlescape-vscode/blob/master/src/extension.ts - I've implemented vscode.TextDocumentContentProvider. I'm using provideTextDocumentContent to get the text from the editor and create a new HTML document from it.

@jrieken
Copy link
Member

jrieken commented May 31, 2016

well, you do this which is previewing the document as html. I wonder, if in your case and as a workaround, you could just openTextDocument and showTextDocument - then the editor will be used to display the virtual document.

@cfjedimaster
Copy link
Author

Are you saying it would take over the default editor pane? If so, that's not what I want.

@jrieken
Copy link
Member

jrieken commented May 31, 2016

default editor pane

Well, like previewHtml it open where editors open but you can define the column in which it shows and also if it should take focus or not: https://github.com/Microsoft/vscode/blob/master/src/vs/vscode.d.ts#L3018

@jrieken
Copy link
Member

jrieken commented May 31, 2016

despite alternative implementations/workarounds to the problem, I believe this is #6924.

@jrieken jrieken added the *duplicate Issue identified as a duplicate of another issue(s) label May 31, 2016
@jrieken jrieken closed this as completed May 31, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s)
Projects
None yet
Development

No branches or pull requests

2 participants