Skip to content

✨ Snippets #167

Closed
Closed

Description

@nanashili

Describe the solution you'd like
Do we want to add something like the Snippets action from Xcode where users can save snippets of their code and use it later or in the future.

Additional context
Screenshot 2022-03-22 at 17 41 13

Activity

  1. austincondiff commented on Mar 22, 2022

    @austincondiff
    Collaborator

    Absolutely! Here are a few considerations...

    • We need to figure out how we will create and store user defined snippets.
    • Extensions will also be able to add snippets.
    • Users should also be able to type a string of characters in the editor and auto suggest should suggest the associated snippet.
    • When pressing tab it is inserted with the first wildcard highlighted if applicable.
    • Snippets should also be aware of the file it is in so it can be auto-populated.
  2. nanashili commented on Mar 22, 2022

    @nanashili
    ContributorAuthor

    We can use a local database maybe or something similar.

    When highlighting the code we can right click to add to snippets

  3. jasonplatts commented on Mar 22, 2022

    @jasonplatts
    Collaborator

    I might suggest storing them in a JSON file like VS Code, https://code.visualstudio.com/docs/editor/userdefinedsnippets. The same code can then also be used by snippet extensions written by developers and shared on the "marketplace".

    It's important that these files can be easily backed up automatically by CodeEdit or that they are in a straightforward location so that they can easily be added to other computers and shared.

  4. nanashili commented on Mar 22, 2022

    @nanashili
    ContributorAuthor

    I might suggest storing them in a JSON file like VS Code, https://code.visualstudio.com/docs/editor/userdefinedsnippets. The same code can then also be used by snippet extensions written by developers and shared on the "marketplace".

    It's important that these files can be easily backed up automatically by CodeEdit or that they are in a straightforward location so that they can easily be added to other computers and shared.

    I was thinking json too but wasn't to sure if it would work but since it does it would suggest json because it can provide a lot of performance enchantments

  5. austincondiff commented on Mar 22, 2022

    @austincondiff
    Collaborator

    @jasonplatts that is a good resource! We might be able to find code that will help us to parse the json and process the variables specified in that documentation link.

  6. jasonplatts commented on Mar 22, 2022

    @jasonplatts
    Collaborator

    Lots of good stuff there to help with the extensions API too @austincondiff. If we can keep the process of extension development similar, we should be able to port a lot over and encourage devs to contribute.

  7. austincondiff commented on Mar 22, 2022

    @austincondiff
    Collaborator

    @jasonplatts We should at some point reach out to extension developers of other platforms and see if they can A) help us with the extension API, and B) help us write extensions.

  8. nanashili commented on Mar 22, 2022

    @nanashili
    ContributorAuthor

    I'm currently working on the design of it.

  9. jasonplatts commented on Mar 22, 2022

    @jasonplatts
    Collaborator

    For sure! I've reached out to some already and I have a few others in mind too. If anyone is able to themselves contribute or knows of anyone else who might be interested, please spread the word! This issue, #76, provides a general overview.

  10. nanashili commented on Mar 22, 2022

    @nanashili
    ContributorAuthor

    We can have a basis of it already by select code in the editor and then saving it. Will most like push it once we have a custom editor

  11. jasonplatts commented on Mar 22, 2022

    @jasonplatts
    Collaborator

    I'm currently working on the design of it.

    Thanks for your contributions and hard work! I am also trying to get into the details of the API. It's work in progress, but please feel free to add to the list that is started here, #76.

  12. added
    extensionsIssues related to the extension architecture in CodeEdit
    on Mar 22, 2022
  13. nanashili commented on Mar 23, 2022

    @nanashili
    ContributorAuthor

    Here is a template of the Snippets View

    Screen.Recording.2022-03-23.at.13.21.48.mov
  14. nanashili commented on Mar 23, 2022

    @nanashili
    ContributorAuthor

    @jasonplatts Why don't we save the basic information of the snippets in the json like name, description, method, platform and completion then the code we add it to it's respective file so if the code is java it would be snippet_name.java and then add the path of the file in the json?

  15. 2 remaining items

  16. jasonplatts commented on Mar 23, 2022

    @jasonplatts
    Collaborator

    I agree. That is definitely a valid concern.

  17. changed the title [-][FEAT] - Snippets[/-] [+][FEAT] Snippets[/+] on Mar 23, 2022
  18. changed the title [-][FEAT] Snippets[/-] [+]✨ Snippets[/+] on Mar 31, 2022
  19. stale commented on May 30, 2022

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

  20. moved this from 🆕 New to 🏁 Complete in CodeEdit Projecton Feb 14, 2023
  21. moved this from 🏁 Complete to 📋 Todo in CodeEdit Projecton Dec 11, 2024
  22. moved this from 📋 Todo to 🏁 Complete in CodeEdit Projecton Dec 11, 2024
  23. austincondiff commented on Dec 11, 2024

    @austincondiff
    Collaborator

    Closed in favor of #1623

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestextensionsIssues related to the extension architecture in CodeEditwontfixThis will not be worked on

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions