An open API service indexing awesome lists of open source software.

https://github.com/virresh/comment_input

VSCode extension that enables providing input from a comment into the integrated terminal for code-runner
https://github.com/virresh/comment_input

comments competitive-programming extension hacktoberfest input terminal vscode vscode-extension

Last synced: about 1 month ago
JSON representation

VSCode extension that enables providing input from a comment into the integrated terminal for code-runner

Awesome Lists containing this project

README

          

![Visual Studio Marketplace Downloads](https://img.shields.io/visual-studio-marketplace/d/virresh.cinp) ![Visual Studio Marketplace Installs](https://img.shields.io/visual-studio-marketplace/i/virresh.cinp?label=active%20users)

# Comment Input

Send input to your single-file applications with ease!
Just add a comment in your source with desired input and voila!

Aimed at competitive programmers and Data Scientists who spend time debugging small (single file) scripts.

## Features

- Select a custom keyphrase
- Supported for all languages that have a block comment and are supported by code-runner*
- Uses VSCode's internal comment settings, no need for extra configuration
- Uses integrated terminal, so you don't have to switch tabs often
- Set custom delay between code compilation and input
- No configuration required on Windows, MacOS and Linux with default VSCode installation**.

\* code-runner has some limitations and all those apply to this extension as well.
\*\* For non-default install locations, extension needs to be configured.

## Requirements
[code-runner](https://github.com/formulahendry/vscode-code-runner) is required for this extension to work since VSCode doesn't support hijacking terminal input.

Further, if the extension is not installed in default location, please configure `cinp.language_extension_resources_folder`. This is required due to a known issue.

On windows, integrated terminal with cmd is required. Powershell will not work.

## Extension Settings

* `cinp.trigger`: Set the keyword for comment identification. Default is "input".
* `cinp.input_delay`: Set the delay between code compilation and input in milliseconds. Default is "500".
* `cinp.language_extension_resources_folder`: Set the Language Configuration folder. Automatically set on linux, mac and windows to default locations. Configure only if not a default installation.

-----------------------------------------------------------------------------------------------------------

## Usage

A sample script looking as follows:
```python
"""input 4 "abc" """
i, j = input().split(" ")
print(int(i) + 100, j)
```

Similarly for c++:
```c++
#include
using namespace std;
/*input
4 "abc"
*/
int main(){
string s;
cin>>s;
cout<