foo for VS Code — BOJ HelperLess setup. More solving. English · 한국어 A VS Code extension that puts a GUI on Installation guideYou need VS Code 1.100 or later, the 1. Install a compiler or interpreter
2. Install the
|
| Problem | What to do |
|---|---|
foo is not found |
Restart VS Code. If it still fails, set foo.executablePath to the full path, usually .cargo/bin/foo in your home folder (.cargo\bin\foo.exe on Windows). Write the path out without ~ or %USERPROFILE%. |
| Compiler or runtime was not found | Add it to PATH and restart VS Code, or choose its executable in the settings screen. |
F5 shows no output |
Check that your program prints something; a new problem starts from an empty template. If an earlier run is still waiting for input in the terminal, close that terminal and try again. |
Workbooks and solving
BOJ prohibits scraping, so neither foo nor this extension fetches its pages. Press Add and either import a workbook or step page you saved yourself in your browser, or enter a title and the problem numbers.
| Where | What it does |
|---|---|
| Tree | Lists your workbooks and problems. Clicking a problem opens its page in your browser and its folder in VS Code, and activates its workbook. |
| Start / Previous / Next | Opens the current, previous, or next problem of the active workbook. |
| Checkbox | Your own note that a problem was accepted on BOJ. The extension can't check BOJ. |
| Status bar | Shows 2557 · 1/13 · C++. Click it for a menu of commands, including opening a problem by number. |
| Gear | Changes foo's default language, workspace folder, compiler, and VS Code path, and links to the extension settings. |
The language list shows what your installed foo supports.
Running and copying your code
In a problem folder, F5 saves your files, copies the problem's source code to the clipboard, and builds and runs it, so you can paste it straight into BOJ's submit form. Set foo.copyOnF5 to false to keep your clipboard untouched. While a debug session is paused, F5 continues as usual.
Local tests
Test cases are pairs of <name>.in and <name>.out (or .ans) files in the problem's tests/ folder.
- Add test case creates an empty pair to paste into.
- Import samples reads the samples and title from a problem page you saved as HTML.
- Run tests reports
AC,WA,TLE, orERR(compile or runtime error) for each case. Each case builds the program again, so the time limit includes build time.
| Setting | Default | Meaning |
|---|---|---|
foo.test.directory |
tests |
Test case folder inside the problem folder. |
foo.test.timeoutMs |
10000 |
Time limit per case, including the build. |
foo.test.compare |
lenient |
lenient ignores trailing spaces and blank lines. Also exact, tokens, and float. |
foo.test.floatTolerance |
0.000001 |
Allowed absolute or relative error in float mode. |
foo.test.stopOnFirstFailure |
false |
Stops at the first case that doesn't pass. |
foo.test.revealOutput |
onFailure |
When to show the output panel: onFailure, always, or never. |
Upload to GitHub
Press the GitHub button on a problem. By default the extension signs in with VS Code's GitHub account, asks for the repository (owner/name), creates it as private if it doesn't exist, and asks you to confirm before committing. Set foo.github.method to git to commit into a local clone with your own git credentials instead.
Setting (foo.github.…) |
Default | Meaning |
|---|---|---|
method |
api |
api (GitHub API) or git (local clone). |
repository, branch |
empty | Target for api. An empty branch means the default branch. |
createIfMissing, visibility |
true, private |
Creating a missing repository (api). |
localPath, push |
empty, true |
The local clone, and whether to push after committing (git). |
directoryTemplate |
{lang}/{id} |
Folder for each problem. |
commitMessageTemplate |
[{langLabel}] BOJ {id} |
Commit message. |
readmeTemplate |
see Settings | README written into each problem folder. |
include |
source, readme |
What to upload: source, tests, readme. |
trigger |
manual |
Or upload after onTestsPass or onMarkSolved. |
requireTestsPass |
false |
Uploads only problems that passed local tests. |
confirmBeforeUpload |
true |
Shows the files and commit message first. |
onExisting |
overwrite |
For an existing source file: overwrite, skip, or rename. |
updateIndex, indexFile |
true, README.md |
Keeps a table of solved problems in the repository. |
openAfterUpload |
false |
Opens the commit in the browser. |
Templates accept {id}, {title}, {lang}, {langLabel}, {ext}, {source}, {workbook}, {index}, {index3}, {url}, {result}, and {date}.
Other settings
| Setting | Default | Meaning |
|---|---|---|
foo.executablePath |
foo |
The foo executable. |
foo.openBrowser |
true |
Opens the problem page when moving to a problem. |
foo.openFolderIn |
currentWindow |
Or newWindow. |
foo.copyOnF5 |
true |
Copies the source code when you press F5. |
Files
Workbooks, positions, and foo's settings stay in foo's own config.toml and state.toml; the extension only changes them through the CLI, so the terminal and the extension stay in step. Test results, accepted marks, and problem titles are stored in VS Code, not in your problem folders.
Development
npm run typecheck
npm test # Node 23.6 or later
npm run build # or: npm run watch
npm run package # creates the .vsix
Press F5 in this repository to launch an Extension Development Host. Login, automatic submission, and fetching BOJ pages are out of scope.
License
Licensed under the MIT License.