Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>copyFunction.YHForkNew to Visual Studio Code? Get it now.
copyFunction.YHFork

copyFunction.YHFork

btownkk

|
1 install
| (0) | Free
copyFunction.description
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Copy Function Extension

VS Code Marketplace License: MIT

This VS Code extension allows you to copy, select, or cut the entire function (or method) to facilitate code extraction, reuse, or modification.

Note: This is a fork of the original Copy Function Extension by mml.

alt text


Description

The Copy Function extension enables you to copy, select, or cut the entire function where the cursor is located. The functionalities are triggered via the context menu command in the editor or by using the following keyboard shortcuts:

  • Copy: Ctrl+Shift+C
  • Select: Ctrl+Shift+S
  • Cut: Ctrl+Shift+X

Reason for Creation

I often had to manually select, copy, or cut the entire function, which required multiple clicks and manual scrolling to capture the whole code snippet. I searched the Marketplace for a solution that met this specific need, and when I couldn't find one, I decided to create this extension. If there is an easier or native way to do this in VS Code, I apologize. If you encounter any issues, please let me know so I can address them. The source code is available in the repository for contributions and forks.


Features

  • Function Copy: Copies the entire function or method code to the clipboard.
  • Function Selection: Selects the entire function in the editor, making it easier to review, modify, or extract the code.
  • Function Cut: Cuts the entire function or method code to the clipboard and removes it from the editor.
  • Internationalization Support: Messages and descriptions available in English using vscode-nls.
  • Keyboard Shortcuts and Context Menu:
    • Ctrl+Shift+C to copy
    • Ctrl+Shift+S to select
    • Ctrl+Shift+X to cut
    • Commands available in the editor context menu.
  • Debug Logging: Detailed console logging to assist in debugging and monitoring extension activation.

Where It Was Tested

I have only tested the extension using C and TypeScript, but I believe it should work with many other programming languages.


Requirements

  • VS Code: Version ^1.75.0 or higher.
  • Node.js: Node.js version 18 or higher is recommended.
  • TypeScript: Used for extension development.

Installation

  1. Clone the repository:

    git clone https://github.com/hongyx11/vscode-copy-function-extension.git
    
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft