-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bd1fe2d
commit 108bd8b
Showing
4 changed files
with
62 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,56 @@ | ||
# Auto Include C++ | ||
# VSCode C++ Include Helper Extension | ||
|
||
Automatically add include directives for C++ classes in your project. | ||
## Overview | ||
|
||
The **C++ Include Helper** extension for Visual Studio Code streamlines the process of adding `#include` directives to your C++ source files. As you type class names, it provides autocompletion suggestions and automatically inserts the appropriate `#include` directive at the top of your file. | ||
|
||
![Demo](gifs/demo.gif) | ||
|
||
## Features | ||
|
||
- Automatically scans the workspace for C++ header and source files. | ||
- Suggests `#include` directives for classes found in the workspace. | ||
- Updates the class map every 30 seconds and on demand. | ||
- Provides commands to trigger workspace analysis and add includes. | ||
1. **Automatic Workspace Analysis**: | ||
- The extension scans your workspace for C++ source (`.cpp`) and header files (`.h`, `.hpp`). | ||
- It identifies class names within these files and maps them to their respective file paths. | ||
- This analysis runs initially when the extension is activated and updates every 30 seconds to reflect any changes in your workspace. | ||
|
||
## Usage | ||
2. **Class Name Autocompletion**: | ||
- While you type, the extension offers autocompletion suggestions for class names found in your workspace. | ||
- Selecting a class from the suggestions inserts a corresponding `#include` directive at the top of the current file, ensuring you never miss an essential include. | ||
|
||
1. Install the extension. | ||
2. Open a C++ project in VS Code. | ||
3. Use the command `Make an analysis` to scan the workspace for C++ classes. | ||
4. Start typing a class name to see suggestions for `#include` directives. | ||
5. Select a suggestion to automatically add the `#include` directive to your file. | ||
3. **Manual Workspace Analysis Command**: | ||
- You can manually trigger workspace analysis using the command palette (`Ctrl+Shift+P` or `Cmd+Shift+P`). | ||
- The command `Make Analysis` updates the class mappings immediately, which is particularly useful after adding new files or classes. | ||
|
||
## Commands | ||
|
||
- `Make an analysis`: Manually trigger an analysis of the workspace. | ||
- `Add Include`: Add an include directive for the selected class. | ||
- **Add Include**: Registers a command (`Add Include`) which is currently set up to show a message confirming the execution (primarily for demonstration purposes in this version). | ||
- **Make Analysis**: Executes the `Make Analysis` command to scan and update the workspace class mappings on demand. | ||
|
||
## Installation | ||
## How to Use | ||
|
||
1. Clone the repository: | ||
```bash | ||
git clone https://github.com/ffoDevilSusiJ/auto-include.git | ||
cd auto-include | ||
``` | ||
1. **Install the Extension**: | ||
- Install the extension from the Visual Studio Code marketplace or from a `.vsix` file. | ||
|
||
2. Install dependencies and compile the extension: | ||
```bash | ||
npm install | ||
npm run compile | ||
``` | ||
2. **Activate the Extension**: | ||
- Open your C++ project in VSCode. The extension will automatically activate and start scanning your workspace. | ||
|
||
3. Open the project in VS Code and press `F5` to run the extension in a new VS Code window. | ||
3. **Start Typing**: | ||
- As you type a class name, the extension will suggest possible completions. | ||
- Select the appropriate class from the suggestions to insert its `#include` directive at the top of your file. | ||
|
||
## License | ||
4. **Manual Analysis**: | ||
- You can manually trigger a workspace analysis by running the `Make Analysis` command from the command palette (`Ctrl+Shift+P` or `Cmd+Shift+P`). | ||
|
||
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. | ||
## Installation | ||
|
||
1. Download and install Visual Studio Code. | ||
2. Search for "C++ Include Helper" in the VSCode marketplace and click "Install". | ||
3. Alternatively, you can download the `.vsix` file and install it via `Extensions: Install from VSIX...` in the command palette. | ||
|
||
## Contributing | ||
|
||
Feel free to submit issues and pull requests to improve the project. | ||
Contributions are welcome! Feel free to open issues or pull requests on the [GitHub repository](https://github.com/your-repo-link). | ||
|
||
## License | ||
|
||
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters