nobuhito / vscode.printcode

PrintCode added printing function to VS Code!!
https://marketplace.visualstudio.com/items?itemName=nobuhito.printcode
MIT License
73 stars 26 forks source link

Feature Request: Reflect code folding on printout #15

Closed strider72 closed 5 years ago

strider72 commented 6 years ago

I have an ASP file with a whole bunch of functions defined. I display the file as function names only, by using the Code Folding feature of VSCode.

When printing out, I would like it if the printout reflected the way I have the code folded. If it's not visible on screen, don't print it. (Maybe add a little "+" icon in the left margin to show that something is folded here, just as it does on screen.)

Thank you so much for this plugin. I laughed out loud when I realized VSCode doesn't have a print function!

janilahti commented 5 years ago

I'm not aware if this has moved forward, but the situation may still be that there's no easy way to get information on folding: "Exposing folding regions (or any view regions) to the extensions is not helpful because they are based on internals." (From https://github.com/Microsoft/vscode/issues/9786#issuecomment-237191844 )

But... if it helps a bit, I have a modification which gives user a possibility to add optional tags in code (for example inside a comment) that mark cut regions for printing.

I'll make a PR soon.

nobuhito commented 5 years ago

It is difficult to display line numbers in folding.

 1 <html>
 2 <head> +
13 <body>
14   <div class="hogehoge"></div>
15 </body>
16 </html>
nobuhito commented 5 years ago

There is no plan to respond now. I am sorry I can not follow your expectations.

nobuhito commented 5 years ago

Codemirror has a folding function, but I think that it is impractical to collapse each time you print.

https://codemirror.net/demo/folding.html