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

Snippet tree #73

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open

Snippet tree #73

wants to merge 25 commits into from

Conversation

maraf
Copy link
Member

@maraf maraf commented Apr 28, 2023

Organize snippets in tree

Example GitHub provider

  • Github
    • maraf
      • Money
        • Issues
        • Pulls
        • Find file
      • certbot-arm
        • ...
    • Neptuo
      • Framework
        • ...
      • Productivity.SnippetManager
        • ...

Searching logic

  • Use depth-first search
  • Show all ancestors on line that are between selected root and current node
  • Tokenize input (split by space or "")
  • Transition to next level is on token basis
  • Don't include ancestors when all search text is matched
    • Searching for "Money" shouldn't include "issues", "pulls", etc

Example results

  • "g" "ma" "re"
    • Github - maraf - aspnetcore
  • "g" "re"
    • Github - maraf - aspnetcore
    • Github - Neptuo - Recollections
  • "mo"
    • Github - maraf - Money
    • Web Money
  • "mo" "iss"
    • Github - maraf - Money - issues
  • "iss"
    • First X issues under Github repo

New features

  • Use "^" to search from root
  • Respect quoted text

TODO

  • Create tree based on "name path". Drop generated ids. Allow to nest inline/xml snippets under github node
  • Show appropriate portion of title in search results
  • Re-allow GitHub org repositories

Closes #47
Closes #34

@maraf maraf added enhancement New feature or request snippet-feature labels Apr 28, 2023
@maraf maraf self-assigned this Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request snippet-feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Grouping snippets Respect quoted text in seach query
1 participant