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

[RFC]: add support for bookmarking directories in REPL #2062

Open
3 tasks done
kgryte opened this issue Mar 27, 2024 · 0 comments
Open
3 tasks done

[RFC]: add support for bookmarking directories in REPL #2062

kgryte opened this issue Mar 27, 2024 · 0 comments
Labels
difficulty: 3 Likely to be challenging but manageable. Enhancement Issue or pull request for enhancing existing functionality. JavaScript Issue involves or relates to JavaScript. Needs Discussion Needs further discussion. priority: Normal Normal priority concern or feature request. REPL Issue or pull request specific to the project REPL. RFC Request for comments. Feature requests and proposed changes.

Comments

@kgryte
Copy link
Member

kgryte commented Mar 27, 2024

Description

This RFC proposes adding support in the REPL for bookmarking directories. Currently, in order to move around the file system, one needs to manually set the current working directory. This can be tedious, as one needs to manually type file paths, either relative or absolute, in order to walk to the desired directory.

This RFC proposes alleviating that tedium by adding support for "bookmarking" directories. E.g.,

In [1]: saveBookmark( 'home_dir', '/home/foo/bar/beep/boop' );

// ...

In [n]: loadBookmark( 'home_dir' );

We'd want to add a set of complementary APIs:

  • saveBookmark( name[, path ] ): path default is the current working directory
  • loadBookmark( name ): set current working directory to the path associated with name
  • deleteBookmark( name ): delete the bookmark associated with name
  • renameBookmark( prev, name ): renames a bookmark specified by prev to the name specified by name
  • isBookmark( [path] ): returns a boolean indicating if a specified path has been bookmarked (if no path provided, uses the current working directory as the path)

By default, bookmarks would only last for the REPL session. To support persisting benchmarks and loading previously persisted benchmarks, we could add the following APIs:

  • loadBookmarks( file ): loads bookmarks found in the file specified by file
  • saveBookmarks( file ): saves the current set of bookmarks to a file specified by file
  • clearBookmarks(): clears all current bookmarks in the current REPL session
  • bookmarks(): list all bookmarks in the current REPL session

The ability to dynamically load and remove bookmarks would allow users to quickly switch development contexts, similar to how the REPL's concept of workspaces allows for moving being variable contexts.

Related Issues

No.

Questions

  • Are there other APIs which would be useful for working with bookmarks?

Other

  • It is worth ensuring that the APIs and conventions are consistent with how the REPL's concept of workspace APIs are designed (e.g., argument order, naming conventions, etc).
  • We should ensure that, similar to workspaces, TAB completions support bookmark names.

Checklist

  • I have read and understood the Code of Conduct.
  • Searched for existing issues and pull requests.
  • The issue name begins with RFC:.
@kgryte kgryte added Enhancement Issue or pull request for enhancing existing functionality. RFC Request for comments. Feature requests and proposed changes. Needs Discussion Needs further discussion. difficulty: 3 Likely to be challenging but manageable. REPL Issue or pull request specific to the project REPL. priority: Normal Normal priority concern or feature request. JavaScript Issue involves or relates to JavaScript. labels Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: 3 Likely to be challenging but manageable. Enhancement Issue or pull request for enhancing existing functionality. JavaScript Issue involves or relates to JavaScript. Needs Discussion Needs further discussion. priority: Normal Normal priority concern or feature request. REPL Issue or pull request specific to the project REPL. RFC Request for comments. Feature requests and proposed changes.
Projects
None yet
Development

No branches or pull requests

1 participant