Skip to content

hbhoyar-uber/vscode-shelf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VSCode Shelve

A VS Code extension that mimics JetBrains' shelve functionality, allowing you to temporarily save uncommitted changes without creating a commit.

Features

  • Shelve Changes: Save your current uncommitted changes to a named shelve
  • Shelve Selected Files: Shelve only specific files from your working directory
  • Unshelve Changes: Apply shelved changes back to your working directory
  • Partial Unshelve: Unshelve only selected files from a shelve
  • Shelve Management: View, rename, and delete your shelves
  • Shelve Details: View detailed information about what's in each shelve
  • Tree View: Convenient tree view in the Source Control panel

How It Works

This extension uses Git's stash functionality under the hood but provides a more user-friendly interface similar to JetBrains IDEs. Each shelve is stored as a Git stash with metadata stored in .vscode/shelves/ directory.

Usage

Creating a Shelve

  1. Shelve All Changes:

    • Click the "Create Shelve" button in the Shelves tree view
    • Or use the Command Palette: Shelve: Create Shelve
  2. Shelve Selected Files:

    • In the Source Control view, right-click on changed files
    • Select "Shelve Selected Files"

Managing Shelves

  • View Shelves: All shelves appear in the "Shelves" tree view in the Source Control panel
  • Unshelve: Right-click on a shelve and select "Unshelve All"
  • Unshelve Selected Files: Right-click on a shelve and select "Unshelve Selected Files"
  • View Details: Right-click on a shelve and select "Show Shelve Details"
  • Rename: Right-click on a shelve and select "Rename Shelve"
  • Delete: Right-click on a shelve and select "Delete Shelve"

Viewing Shelved Files

Expand any shelve in the tree view to see the list of files it contains, along with their modification status (added, modified, deleted, renamed).

Configuration

  • shelve.autoRefresh: Automatically refresh shelves when files change (default: true)
  • shelve.showFileCount: Show file count in shelve items (default: true)

Requirements

  • VS Code 1.74.0 or higher
  • Git must be installed and available in PATH
  • Workspace must be a Git repository

Installation

  1. Clone this repository
  2. Run npm install
  3. Run npm run compile
  4. Run npm run package to create the VSIX file
  5. Install the VSIX file in VS Code

Development

# Install dependencies
npm install

# Compile TypeScript
npm run compile

# Watch for changes
npm run watch

# Package extension
npm run package

Known Limitations

  • Only works with Git repositories
  • Shelves are stored locally and not synchronized across machines
  • Binary files in shelves may not be handled perfectly

Contributing

Feel free to submit issues and pull requests!

License

MIT

About

Mimics Jetbrains IDE shelf

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors