ability to 'bookmark' code #726

Closed
banister opened this Issue Oct 11, 2012 · 4 comments

Comments

Projects
None yet
3 participants
Owner

banister commented Oct 11, 2012

This should probably exist as a pry-bookmark plugin.

when you come across code that needs a second-look (say you are trying to grok a complicated library), it would be nice to 'bookmark' certain methods or classes with notes or keywords for future reference. you can then view the list of bookmarked methods/classes with show-bookmarks and view the notes associated with a particular method/class with show-note or some such

bookmarks would have to be persisted to disk. We could use either just the method/class name or the file name + method/class name to identify bookmarked items.

bookmarks can also be used to identify code that needs refactoring, replacing the current # FIXME comment often used in codebases.

cc @rking

@ghost

ghost commented Oct 11, 2012

Cool idea. +1 from me.

Contributor

rking commented Oct 12, 2012

So you're picturing this as a separate file? Stored in the project dir or ~/.pry/ or what?

I'm not instantly + or - yet. I agree for sure that there is metadata that we don't have a good way of hanging on lines of code (actually, I wonder if any of the Ruby parsers retain comments?), but I don't know if I picture enough details to call it the right thing or not.

@banister banister closed this Oct 12, 2012

@banister banister reopened this Oct 12, 2012

Owner

banister commented Nov 20, 2012

@sent-hil i wrote the following code: https://gist.github.com/4115151

I guess this is really a 'notes' system than 'bookmarks' so perhaps should rename it to 'notes'

and the following 'showterm' to give an idea of what you should do. ALl that's missing (IMO) is persisting to disk, and removal of bookmarks, there's also room for a few other original ideas.

Also consider just displaying the notes outright when doing show-source or show-doc, rather than just displaying number of notes & how to display them.

showterm demo: http://showterm.io/fdd277d43d36fe199dc8a#fast

@kyrylo kyrylo closed this Dec 2, 2012

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