kufii / codesnap Goto Github PK
View Code? Open in Web Editor NEW📸 Take beautiful screenshots of your code in VS Code!
Home Page: https://marketplace.visualstudio.com/items?itemName=adpyke.codesnap
📸 Take beautiful screenshots of your code in VS Code!
Home Page: https://marketplace.visualstudio.com/items?itemName=adpyke.codesnap
Hey, great extension! Thanks for all the good work.
Is there a way for copying the image to the clipboard instead of saving it to a file?
Thanks!
First off, really appreciate your work and effort on this extension. Perfect for snagging decent-looking screenshots of code snippets in a pinch.
Issue
I'm running VS Code Insiders v1.50.0-insider (full system info below) and there does not appear to be any syntax highlighting being applied in CodeSnap, as per the screenshot below.
Top: Actual code snippet. Bottom: CodeSnap image.
Configuration
{
"codesnap.boxShadow": "none",
"codesnap.containerPadding": "0",
"codesnap.showWindowControls": false,
"codesnap.transparentBackground": true
}
System
Version: 1.50.0-insider (user setup)
Commit: 403a6895f401c397933ec5c4f7d89432a33509b6
Date: 2020-09-18T05:31:09.978Z
Electron: 9.3.0
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Windows_NT x64 10.0.19041
Doing CTRL + C does not copy the image to the clipboard, neither does clicking on the shutter button.
System Specs:
版本: 1.49.0 (user setup)
提交: e790b931385d72cf5669fcefc51cdf65990efa5d
日期: 2020-09-10T13:22:08.892Z
Electron: 9.2.1
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Windows_NT x64 10.0.19041
When snapping a screenshot of code, the window title (if codesnap.showWindowTitle
is turned on) is: {folder} - {file}
But if the parent folder has subfolders, they're not shown in the window title.
For example, this is my folder path: timesheet/logs/create.php
If I take a screenshot in create.php, I would like the window title to be: timesheet/logs/create.php. (or somethings similar)
An even better solution would be to grab the window.title
variable from VSCode settings.
Selected 600 lines of code and image only contains 300 lines of that with the rest empty. Image looks like it would contain the 600 lines but only half shows, the other half is empty.
VS Code v1.39.2
CodeSnap v1.0.15
As you can see, only variable angka
is colored as light blue. Other variables such as kol
, bar
, baris
, kolom
, etc. are colored as white on the generated image. cout
and cin
are also colored as white.
Original code: https://pastebin.com/tuLaWuEP
Simple C++ code (without 2D array) works fine, no color issue so far.
Issue Type: Bug
As title, code snap takes content from the system clip board instead of vscode. The snapped image is not from selected text in vscode edit window.
Extension version: 1.2.0
VS Code version: Code 1.52.1 (ea3859d4ba2f3e577a159bc91e3074c5d85c0523, 2020-12-16T16:34:46.910Z)
OS version: Windows_NT x64 10.0.19041
Item | Value |
---|---|
CPUs | Intel(R) Core(TM) i5-8350U CPU @ 1.70GHz (8 x 1896) |
GPU Status | 2d_canvas: enabled flash_3d: enabled flash_stage3d: enabled flash_stage3d_baseline: enabled gpu_compositing: enabled multiple_raster_threads: enabled_on oop_rasterization: disabled_off opengl: enabled_on protected_video_decode: enabled rasterization: enabled skia_renderer: disabled_off_ok video_decode: enabled vulkan: disabled_off webgl: enabled webgl2: enabled |
Load (avg) | undefined |
Memory (System) | 15.85GB (5.61GB free) |
Process Argv | --crash-reporter-id ffd39a9b-3af7-4188-ba19-d2e6963bbef3 |
Screen Reader | no |
VM | 0% |
vsliv368cf:30146710
vsreu685:30147344
openlogontheside:30221877
python763:30178808
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
python504:30227505
vswsl492cf:30211402
wsl2prompt:30224612
unusedprompt:30224610
folderexplorer:30224614
openfilemenucf:30224648
pythonvsded773:30236629
vsjup459cf:30237188
Hi , i use this for colorize comments :
https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments
please add support for this extension.
thank you.
Just installed this plugin. Looks awesome, but there's no instructions on how to use it.
Loving your extension - it's come in very useful for me with presentations & documentation.
I was wondering whether it would be possible to use Codesnap on text selected in the integrated terminal, as I presume that has a similar structure to an editor window - that would let me get the same level of fidelity with command-lines & their related output as I can get for my code...
If window title is shown, make it easily renamable by (single/double) clicking it. Current version will automatically take workspace name + full file name as window title with no option to modify it.
VS Codium and other VS Code Fork (Code OSS and Eclipse Theia) now use Open VSX Registry instead VS Code Marketplace.
https://open-vsx.org/ .
https://github.com/VSCodium/vscodium/blob/master/DOCS.md
Open VSX is open source marketplace for VS Code fork that made by Eclipse Foundation.
https://www.gitpod.io/blog/open-vsx/
And i checking your Codesnap extension is still not available in this open marketplace extension. You can read this easy guide, how to publish your extension to Open VSX Marketplace.
https://github.com/eclipse/openvsx/wiki/Publishing-Extensions
Provide in extension usage tips
I'm trying to use the extension and it seems working well, but when selecting code and right clicking and selecting CodeSnap, I get this:
It also happens when I bind a keyboard shortcut and use it. If the keyboard shortcut persist, the error arises even when using the Ctrl+Shift+P method and selecting code. I have to delete the keyboard shortcut to get it back to work.
I think it's a useful feature, but I couldn't get it to work, hope that this could help, thank you for the extension anyway!
Just like screenshot system on other applications, I think it would be good to copy the screenshot of code to clipboard, and ask user whether to save it or not. Is this possible?
Currently the image is being created in the same directory of the file into which I am pasting the image from clipboard.
But it would be great if we can set a directory, e.g. /assets/ where the created image will be pasted.
When running on Mac, the command seems to do nothing. No error notification and there's no error in the dev tools too.
Worth noting that I'm using the Settings Sync extension to sync my settings/extensions across my Mac/Linux environments. The CodeSnap extension has been installed under Linux first (and everything worked well) then it has been synced to my Mac environment.
VSCode version: 1.47.3
OSX version: Catalina 10.15.4
Hi,
First off, this is an incredibly handy extension and quite simply ticks all the boxes that Polacode does not! Really grateful for you having shared this.
Looking at the screenshot above, compare the number 0
within the 0_0
s between the editor and CodeSnap tabs. Notice it's slashed in the editor but dotted in CodeSnap.
By default, JetBrains Mono has dotted zeros, which appears to be rendered in CodeSnap despite "editor.fontLigatures": "'zero'"
having being set. I'd have assumed this would be preemptively resolved by #12 but that doesn't seem to be the case here.
Please feel free to let me know if you need any more information to help troubleshooting. Thanks once again for your time, much appreciated!
Best setup would be to save to a preset Code Screenshots folder and then put in clipboard. How can we get this working on OSX
I'm working with code run in WSL, and when I did a CodeSnap, I told it to save on my desktop. After selecting the desktop, hitting save, nothing is actually saved. I closed the opened panel, re-opened and selected $wsl in the file ui, tried to save it under wsl and still no go.
You can already copy with a keyboard shortcut, but not everyone is finding this clear
A better file name would be {file_name_from_where_code_is_taken}_{selected_line_range}.png
A better default save location would be the current directory.
Obviously, I know that I can manually write a name while saving, or later rename it. But some default setting would be great.
Version: 1.47.2 (user setup)
Commit: 17299e413d5590b14ab0340ea477cdd86ff13daf
Date: 2020-07-15T18:22:06.216Z
Electron: 7.3.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.19041
right now dom-to-image breaks when font ligatures are disabled
Hi! I'm running your extension on Windows 7 and the "copy to clipboard" feature doesn't seem to be working. It just opens a "Save" dialog but nothing gets copied into the clipboard.
Thank you for being part of the Open VSX community by adding your extensions to the Open VSX Registry. Please note that the service was recently transferred to the Eclipse Foundation and urgent action on your part is needed so we can continue to list your extensions. To ensure uninterrupted service, please sign the Eclipse Publisher Agreement on or before January 8, 2021. If not signed by that date, your extensions will be delisted and will no longer appear on the site nor be available via the API. If you sign at a later date, your extensions will then be re-activated. The signing process is explained in the Wiki (steps 1 and 2).
Please also note that all extensions MUST have a license in order to be listed.
More details are in these recent blog posts:
https://blogs.eclipse.org/post/brian-king/open-vsx-registry-under-new-management
https://blogs.eclipse.org/post/brian-king/new-era-open-vsx-registry
Today, there’s growing momentum around open source tools and technologies that support Visual Studio (VS) Code extensions. Leading global organizations are adopting these tools and technologies. This momentum has spurred demand for a marketplace without restrictions and limitations. Thanks for joining us on this journey as we continue to build the Open VSX community. We look forward to continued innovation from you in 2021!
Hi there,
I mentioned in #25 that I need to make huge screenshots for video production. It is entirely possible that this problem only occurs when going really large.
I have one example where I am creating a screenshot of a 328 line file. It works fine except for the width issue mentioned in #25, and in addition CodeSnap seems to calculate way too much vertical space for the screenshot.
When I select the whole file and save the PNG, it comes in at 2778 x 27684. Yeah, I know, way too big for most normal people. However, there is a lot of "dead" space at the bottom of the file. If I crop it right after line 328, I have a file of 2778 x 16342. So that means the "pixel height" of each line is approximately 50 pixels - it seems like CodeSnap makes room for some 226 lines more than are actually in there.
If it matters, my line height in Visual Studio Code is set to 0, meaning it should be computed from the font size.
Let me know if this can't be reproduced, or if anything else is needed from my side.
Nothing happend, only error "Can't open display". Tested on linux and windows. Whats wrong?
It would be nice to have a option to fix the width.
This would greatly enhance readability and design for documentations.
CodeSnap: /bin/sh: ./scripts/osx-copy-image: Permission denied
This is a great tool, thank you!
Unfortunately, every time I use it, I have to move the split pane to the bottom instead of the right. I have a small screen laptop, and it results in my code having to fit in 40 line length characters. It seems like it would make more sense to split to the bottom so the screenshot actually looks like the code rather than being squished, and/or adding an option to do this.
What do you think?
Current behavior:
Ideal behavior:
Issue is simple. Happening on Windows 10.
I've noticed this in other cases too where the image just doesn't load until I switch away and back to the tab.
Select a piece of code, and I run codesnap and it gives me an error like this
The command "CodeSnap 📸" resulted in an error (command 'codesnap.start' not found)
and it doesn't run at all, remove, reinstall, erase settings completely in vscode and nothing worked, I always get the same error
Hi, im tried to take shots with codesnap because polacode did me a bad formating while I took a shot, but occurs the same error.
This is before I took the shot
This is the result of the shot
This is the info of my vscode
Version: 1.40.2
Commit: f359dd69833dd8800b54d458f6d37ab7c78df520
Date: 2019-11-25T14:54:40.719Z
Electron: 6.1.5
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Linux x64 5.3.12-200.fc30.x86_64
My SO is fedora 30
I think this is a better extension than polacode, luck in solving this bug.
When I hit the aperture, it prompts me to save the screenshot to disk. That's a tedious way to move a screenshot over to a program that supports pasting in an image from the clipboard.
Can you please copy the screenshot itself to the clipboard when the aperture button is pressed? And make it an option whether or not to prompt to save to disk? I for one, never save something to disk, because all programs I use to share any screenshot, support pasting an image from the clipboard.
In short, I want to:
That would be litterally all there is to it, ideally.
Version: 1.49.0-insider
Commit: b6d4fec3714ff897f72c1dab8cc02b7421a8f131
Date: 2020-09-01T05:54:42.740Z
Electron: 9.2.1
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Windows_NT x64 10.0.19041
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.