Skip to content

zsb00000/Code-Completion

Repository files navigation

Code-Completion

This is a code completion plugin developed for OIer and ACMer, designed to quickly complete template code, enhance competition speed, and help you score faster in online open contests!

Features

  • Save template code
  • Quickly insert templates via code completion
  • View all saved templates
  • Delete saved templates
  • Modify saved templates
  • Import or export templates in JSON format

Usage

All features can be accessed via the Command Palette (Ctrl+Shift+P) by entering the corresponding command. Below are the shortcuts and command names for each function:

Function Shortcut (Windows/Linux) Shortcut (macOS) Command Palette Input
Add Template Ctrl+Alt+T A Cmd+Alt+T A C++: Save Code Template
View List Ctrl+Alt+T W Cmd+Alt+T W C++: List Saved Templates
Delete Template Ctrl+Alt+T D Cmd+Alt+T D C++: Delete Template
Export Templates Ctrl+Alt+T E Cmd+Alt+T E C++: Export Templates
Import Templates Ctrl+Alt+T I Cmd+Alt+T I C++: Import Templates
Edit Template Ctrl+Alt+T M Cmd+Alt+T M C++: Edit Template

Detailed Instructions:

  • Add Template: Open the save interface, enter a keyword and code, then click Save.
    Add Template Interface

  • Insert Template: No shortcut needed. Simply type the keyword in a C++ file, find it in the completion suggestions, and press Enter to insert the template code.
    Insert Template Example

  • View List: Open the template list and click the "View" button to open the template code in a new document.
    View Template List

  • Delete Template: Click the red button next to the template in the list to delete it.
    Delete Template Interface

  • Edit Template: Select the template you want to modify in the list. The editing interface will then open, allowing you to modify the keyword or code and save it.
    Edit Template Interface

  • Export Templates: Choose a save location and filename (default is cpp-templates.json). All templates will be exported as a JSON file.

  • Import Templates: Select the JSON file to import. If keywords in the file conflict with existing templates, you can choose to overwrite conflicting templates or skip them.

Release Notes

0.0.1

Basic version supporting saving, inserting, querying, and deleting templates.

1.0.0

  • Added template editing, import, and export features
  • Added shortcuts for all commands: Ctrl+Alt+T + corresponding letter
  • Optimized the list interface, removed the insert button, retaining only the view function (insertion is still done via code completion)
  • Improved Webview interaction and data security

Requirements

  • Visual Studio Code version 1.109.0 or higher

License

MIT

About

This is a code completion plugin developed for OIer and ACMer, designed to quickly complete template code, enhance competition speed, and help you score faster in online open contests!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors