├── .github └── ISSUE_TEMPLATE │ └── custom.md ├── .gitignore ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── SECURITY.md ├── STRUCTUE.md ├── images └── icon.png ├── package-lock.json ├── package.json └── src ├── codeComments.js └── extension.js /.github/ISSUE_TEMPLATE/custom.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Custom issue template 3 | about: Describe this issue template's purpose here. 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # CodeScribe - Changelog 2 | 3 | All notable changes to this Visual Studio Code extension will be documented in this file. 4 | 5 | ## [1.0.0] - 2023-10-14 6 | 7 | - Initial release of CodeScribe. 8 | - Added the ability to parse code comments from JavaScript files. 9 | - Supported generation of code documentation from comments. 10 | 11 | 12 | Please follow the [Semantic Versioning](https://semver.org/) guidelines for version numbering. 13 | 14 | For older versions and detailed information about each release, refer to the [GitHub repository](https://github.com/PB2204/CodeScribe). 15 | 16 | This changelog follows the [Keep a Changelog](https://keepachangelog.com/) format. -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, religion, or sexual identity 10 | and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | * Demonstrating empathy and kindness toward other people 21 | * Being respectful of differing opinions, viewpoints, and experiences 22 | * Giving and gracefully accepting constructive feedback 23 | * Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | * Focusing on what is best not just for us as individuals, but for the 26 | overall community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | * The use of sexualized language or imagery, and sexual attention or 31 | advances of any kind 32 | * Trolling, insulting or derogatory comments, and personal or political attacks 33 | * Public or private harassment 34 | * Publishing others' private information, such as a physical or email 35 | address, without their explicit permission 36 | * Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement at 63 | rockstarpabitra2204@gmail.com. 64 | All complaints will be reviewed and investigated promptly and fairly. 65 | 66 | All community leaders are obligated to respect the privacy and security of the 67 | reporter of any incident. 68 | 69 | ## Enforcement Guidelines 70 | 71 | Community leaders will follow these Community Impact Guidelines in determining 72 | the consequences for any action they deem in violation of this Code of Conduct: 73 | 74 | ### 1. Correction 75 | 76 | **Community Impact**: Use of inappropriate language or other behavior deemed 77 | unprofessional or unwelcome in the community. 78 | 79 | **Consequence**: A private, written warning from community leaders, providing 80 | clarity around the nature of the violation and an explanation of why the 81 | behavior was inappropriate. A public apology may be requested. 82 | 83 | ### 2. Warning 84 | 85 | **Community Impact**: A violation through a single incident or series 86 | of actions. 87 | 88 | **Consequence**: A warning with consequences for continued behavior. No 89 | interaction with the people involved, including unsolicited interaction with 90 | those enforcing the Code of Conduct, for a specified period of time. This 91 | includes avoiding interactions in community spaces as well as external channels 92 | like social media. Violating these terms may lead to a temporary or 93 | permanent ban. 94 | 95 | ### 3. Temporary Ban 96 | 97 | **Community Impact**: A serious violation of community standards, including 98 | sustained inappropriate behavior. 99 | 100 | **Consequence**: A temporary ban from any sort of interaction or public 101 | communication with the community for a specified period of time. No public or 102 | private interaction with the people involved, including unsolicited interaction 103 | with those enforcing the Code of Conduct, is allowed during this period. 104 | Violating these terms may lead to a permanent ban. 105 | 106 | ### 4. Permanent Ban 107 | 108 | **Community Impact**: Demonstrating a pattern of violation of community 109 | standards, including sustained inappropriate behavior, harassment of an 110 | individual, or aggression toward or disparagement of classes of individuals. 111 | 112 | **Consequence**: A permanent ban from any sort of public interaction within 113 | the community. 114 | 115 | ## Attribution 116 | 117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 118 | version 2.0, available at 119 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 120 | 121 | Community Impact Guidelines were inspired by [Mozilla's code of conduct 122 | enforcement ladder](https://github.com/mozilla/diversity). 123 | 124 | [homepage]: https://www.contributor-covenant.org 125 | 126 | For answers to common questions about this code of conduct, see the FAQ at 127 | https://www.contributor-covenant.org/faq. Translations are available at 128 | https://www.contributor-covenant.org/translations. 129 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to CodeScribe 2 | 3 | Welcome to the CodeScribe project! We appreciate your interest in contributing to this Visual Studio Code extension. By contributing, you help make CodeScribe even better for developers. 4 | 5 | ## Table of Contents 6 | 7 | - [Getting Started](#getting-started) 8 | - [How to Contribute](#how-to-contribute) 9 | - [1. Reporting Issues](#1-reporting-issues) 10 | - [2. Suggesting Enhancements](#2-suggesting-enhancements) 11 | - [3. Code Contributions](#3-code-contributions) 12 | - [Development Setup](#development-setup) 13 | - [Code Style and Guidelines](#code-style-and-guidelines) 14 | - [License](#license) 15 | 16 | ## Getting Started 17 | 18 | Before you start contributing, please make sure you have read and understood our [Code of Conduct](CODE_OF_CONDUCT.md). 19 | 20 | ## How to Contribute 21 | 22 | There are several ways to contribute to CodeScribe, and we welcome all types of contributions, from reporting issues to submitting code changes. 23 | 24 | ### 1. Reporting Issues 25 | 26 | If you encounter a bug, have a question, or want to request a new feature, you can create an issue in our [issue tracker](https://github.com/pb2204/CodeScribe/issues). When creating an issue, please provide as much detail as possible, including steps to reproduce, your operating system, and your Visual Studio Code version. 27 | 28 | ### 2. Suggesting Enhancements 29 | 30 | If you have ideas for enhancing CodeScribe, feel free to create an enhancement proposal by opening an issue in our [issue tracker](https://github.com/PB2204/CodeScribe/issues). Describe the feature or improvement you have in mind, and we'll discuss it with you. 31 | 32 | ### 3. Code Contributions 33 | 34 | We welcome code contributions! To contribute code changes: 35 | 36 | 1. Fork this repository to your GitHub account. 37 | 2. Create a new branch for your changes. 38 | 3. Make your changes and commit them with clear and concise commit messages. 39 | 4. Push your branch to your GitHub repository. 40 | 5. Open a pull request (PR) in this repository with a clear description of your changes. 41 | 6. Your PR will be reviewed by maintainers, and any necessary changes will be discussed. 42 | 43 | ## Development Setup 44 | 45 | To set up a development environment for CodeScribe, follow these steps: 46 | 47 | 1. Clone your fork of the repository: 48 | 49 | ```bash 50 | git clone https://github.com/your-github-username/CodeScribe.git 51 | ``` 52 | 53 | 2. Navigate to the project directory: 54 | 55 | ```bash 56 | cd CodeScribe 57 | ``` 58 | 59 | 3. Install the project dependencies: 60 | 61 | ```bash 62 | npm install 63 | ``` 64 | 65 | 4. Build the extension: 66 | 67 | ```bash 68 | npm run compile 69 | ``` 70 | 71 | 5. Open the project in Visual Studio Code: 72 | 73 | ```bash 74 | code . 75 | ``` 76 | 77 | 6. Start debugging and developing your changes. 78 | 79 | ## Code Style and Guidelines 80 | 81 | Please follow the established coding style and guidelines used in the project. These guidelines help maintain consistency and make the codebase more accessible for everyone. 82 | 83 | ## License 84 | 85 | By contributing to CodeScribe, you agree that your contributions will be licensed under the project's [MIT License](LICENSE). You retain the copyright to your contributions. 86 | 87 | Thank you for contributing to CodeScribe! 88 | 89 | --- 90 | 91 | By participating in this project, you agree to abide by the [Code of Conduct](CODE_OF_CONDUCT.md). 92 | 93 | If you have any questions or need assistance, please contact the project maintainers. 94 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Pabitra Banerjee 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CodeScribe - Visual Studio Code Extension 2 | 3 | ## Description 4 | 5 | CodeScribe is a Visual Studio Code extension designed to help you generate documentation from code comments in your code files. It can identify and extract comments within your code, making it easier to document your codebase. This extension is a valuable tool for developers who want to create well-documented code quickly and efficiently. 6 | 7 | ## Features 8 | 9 | - **Code Comment Parsing**: CodeScribe parses code comments, including both single-line (//) and multi-line (/* */) comments. 10 | - **Documentation Generation**: Easily generate documentation from your code comments to describe your code's functionality. 11 | - **Quick Access**: Use the provided commands to initiate the code comment parsing process. 12 | 13 | ## Usage 14 | 15 | 1. Open a code file in Visual Studio Code. 16 | 2. Select the code you want to document or position the cursor in the file. 17 | 3. Use the command `CodeScribe: Parse Code Comments` to start the parsing process. 18 | 4. The extension will identify and extract code comments from the selected code. 19 | 5. Review and modify the generated documentation as needed. 20 | 6. Use the generated documentation to maintain clear and up-to-date code comments. 21 | 22 | ## Installation 23 | 24 | You can install CodeScribe from the Visual Studio Code Marketplace by following these steps: 25 | 26 | 1. Open Visual Studio Code. 27 | 2. Go to the Extensions view by clicking on the square icon on the sidebar or using the keyboard shortcut `Ctrl+Shift+X`. 28 | 3. Search for "CodeScribe" in the search bar. 29 | 4. Click the "Install" button to install the extension. 30 | 31 | ## Requirements 32 | 33 | - Visual Studio Code (minimum version 1.63.0) 34 | 35 | ## License 36 | 37 | This extension is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. 38 | 39 | ## Author 40 | 41 | - [Pabitra Banerjee](https://pabitrabanerjee.me) 42 | 43 | ## Contribute 44 | 45 | If you find any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request on [GitHub](https://github.com/PB2204/CodeScribe/issues). 46 | 47 | ## Release Notes 48 | 49 | See the [CHANGELOG](CHANGELOG.md) for the extension's version history and updates. 50 | 51 | ## Support 52 | 53 | If you encounter any problems or have questions related to the extension, please reach out to the author or the community for assistance. 54 | 55 | ## Acknowledgments 56 | 57 | - Thanks to the Visual Studio Code community for making extension development possible. 58 | 59 | ## Happy Coding! 60 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | Use this section to tell people about which versions of your project are 6 | currently being supported with security updates. 7 | 8 | | Version | Supported | 9 | | ------- | ------------------ | 10 | | 5.1.x | :white_check_mark: | 11 | | 5.0.x | :x: | 12 | | 4.0.x | :white_check_mark: | 13 | | < 4.0 | :x: | 14 | 15 | ## Reporting a Vulnerability 16 | 17 | Use this section to tell people how to report a vulnerability. 18 | 19 | Tell them where to go, how often they can expect to get an update on a 20 | reported vulnerability, what to expect if the vulnerability is accepted or 21 | declined, etc. 22 | -------------------------------------------------------------------------------- /STRUCTUE.md: -------------------------------------------------------------------------------- 1 | ```bash 2 | CodeScribe/ 3 | │ 4 | ├── src/ 5 | │ ├── extension.ts // Main extension code 6 | │ └── codeComments.ts // Code comment parsing logic 7 | │ 8 | ├── package.json // Extension metadata and dependencies 9 | ├── README.md // Extension README 10 | ├── CHANGELOG.md // Changelog for version history 11 | ├── LICENSE // Licensing information 12 | │ 13 | └── .vscode/ 14 | ├── launch.json // Debug configuration 15 | └── settings.json // VS Code settings 16 | ``` -------------------------------------------------------------------------------- /images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/CodeScribe/0e9241ca841c504a242722961c7ffa892e0263f4/images/icon.png -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "codescribe", 3 | "version": "1.0.0", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "codescribe", 9 | "version": "1.0.0", 10 | "license": "MIT", 11 | "devDependencies": { 12 | "typescript": "^4.5.2" 13 | } 14 | }, 15 | "node_modules/typescript": { 16 | "version": "4.9.5", 17 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", 18 | "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", 19 | "dev": true, 20 | "bin": { 21 | "tsc": "bin/tsc", 22 | "tsserver": "bin/tsserver" 23 | }, 24 | "engines": { 25 | "node": ">=4.2.0" 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "codescribe", 3 | "displayName": "CodeScribe", 4 | "description": "A Visual Studio Code extension for generating documentation from code comments.", 5 | "version": "1.0.0", 6 | "author": "Pabitra Banerjee", 7 | "publisher": "Pabitra Banerjee", 8 | "engines": { 9 | "vscode": "^1.63.0" 10 | }, 11 | "categories": [ 12 | "Programming Languages" 13 | ], 14 | "license": "MIT", 15 | "repository": { 16 | "type": "git", 17 | "url": "https://github.com/pb2204/CodeScribe.git" 18 | }, 19 | "homepage": "https://github.com/pb2204/CodeScribe", 20 | "icon": "images/icon.png", 21 | "activationEvents": ["onCommand:codeScribe.parseComments"], 22 | "main": "src/extension.js", 23 | "contributes": { 24 | "commands": [ 25 | { 26 | "command": "codeScribe.parseComments", 27 | "title": "Parse Code Comments" 28 | } 29 | ], 30 | "menus": { 31 | "editor/context": [ 32 | { 33 | "command": "codeScribe.parseComments", 34 | "group": "navigation", 35 | "when": "editorLangId == javascript" 36 | } 37 | ] 38 | } 39 | }, 40 | "devDependencies": { 41 | "typescript": "^4.5.2" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/codeComments.js: -------------------------------------------------------------------------------- 1 | function parseCodeComments(code, languageId) { 2 | let commentRegex; 3 | 4 | if (languageId === 'javascript') { 5 | commentRegex = /\/\/.*|\/\*[\s\S]*?\*\//g; 6 | } else if (languageId === 'python') { 7 | commentRegex = /#.*/g; 8 | }else if (languageId === 'html') { 9 | commentRegex = //g; // HTML comments: 10 | } else { 11 | return []; 12 | } 13 | 14 | const comments = code.match(commentRegex); 15 | return comments || []; 16 | } 17 | 18 | module.exports = { 19 | parseCodeComments 20 | }; 21 | -------------------------------------------------------------------------------- /src/extension.js: -------------------------------------------------------------------------------- 1 | const vscode = require('vscode'); 2 | const fs = require('fs'); 3 | const { parseCodeComments } = require('./codeComments'); 4 | 5 | function activate(context) { 6 | let disposable = vscode.commands.registerCommand('codeScribe.parseComments', async () => { 7 | const editor = vscode.window.activeTextEditor; 8 | 9 | if (editor) { 10 | const languageId = editor.document.languageId; 11 | 12 | if (languageId === 'javascript' || languageId === 'python') { 13 | const code = editor.document.getText(); 14 | const comments = parseCodeComments(code, languageId); 15 | 16 | if (comments.length > 0) { 17 | vscode.window.showInformationMessage(`Found ${comments.length} comments.`); 18 | } else { 19 | vscode.window.showInformationMessage('No comments found.'); 20 | } 21 | } else { 22 | vscode.window.showInformationMessage('Unsupported language: ' + languageId); 23 | } 24 | } else { 25 | vscode.window.showInformationMessage('No active editor.'); 26 | } 27 | }); 28 | 29 | context.subscriptions.push(disposable); 30 | } 31 | 32 | function deactivate() { 33 | // This method is called when your extension is deactivated. 34 | } 35 | 36 | module.exports = { 37 | activate, 38 | deactivate 39 | }; 40 | --------------------------------------------------------------------------------