vscode-codeFragments icon indicating copy to clipboard operation
vscode-codeFragments copied to clipboard

Code Fragments Comments and Native support ?

Open SheepDomination opened this issue 7 years ago • 4 comments

Out of Curiosity can you do what this extension does native in Visual Studio Code ?

I'd like to see support for comments of code fragments as well as custom code fragment names rather then what the extension supplies for the name. And finally support for OneDrive backup of code fragments.

SheepDomination avatar Apr 29 '18 18:04 SheepDomination

Out of Curiosity can you do what this extension does native in Visual Studio Code?

Not as far as I know. The only kinda similar feature is Code Snippets, but that's less convenient for this specific purpose.

  • Comments for fragments: I'll think about this one.
  • Custom names: you can already rename a fragment by right-clicking, and selecting "Rename Code Fragment". And in #5 it might happen that you'll be asked to give it a name immediately after creation.
  • OneDrive backup: this would be a larger piece of work, I created a separate issue for it: #10
    (btw, you've seen that you can already backup the fragments to a json file, right?)

markvincze avatar Apr 29 '18 18:04 markvincze

Comments for fragments: I'll think about this one.

This would be extremely helpful, since I tend to save code snippets from various sources online and to be able to add comments as to why I saved the code snippet would save me from having to remember everything, which I already try to do 👍 :)

OneDrive backup: this would be a larger piece of work, I created a separate issue for it: #10 (btw, you've seen that you can already backup the fragments to a json file, right?)

I'm not the familiar with JSON at this point, therefore I don't know how to backup the fragments to a JSON file ?

SheepDomination avatar Apr 29 '18 21:04 SheepDomination

@SheepDomination,

I'm not the familiar with JSON at this point, therefore I don't know how to backup the fragments to a JSON file?

That's not a problem, you can simply export all the fragments with this button to a file:

image

And you can import it back with the other button.

markvincze avatar Apr 29 '18 22:04 markvincze

This is excellent; the only thing missing is to add a comment below the name of the code snippet within explorer > code fragments. 👍

SheepDomination avatar Apr 29 '18 23:04 SheepDomination