1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-25 09:45:02 +00:00
oot/docs/vscode.md

97 lines
3.3 KiB
Markdown
Raw Normal View History

# VSCode
A lot of people on this project use VSCode as their coding environment.
## Extensions
There are a number of useful extensions available to make work more efficient:
- C/C++ IntelliSense
- Clang-Format
- HexInspector (hover on numbers for float and other info)
- NumberMonger (convert hex to decimal and vice versa)
- Better MIPS Support
## Useful keyboard shortcuts
- Ctrl + Alt + Up/Down (on Windows, on Linux it's Ctrl + Shift + Up/Down or Shift + Alt + Up/Down) gives multicursors across consecutive lines. If you want several cursors in a more diverse arrangement, middle clicking works, at least on Windows.
- Alt + Up/Down moves lines up/down.
- Shift + Alt + Up/Down (Linux: Ctrl + Shift + Alt + Up/Down) copies lines up/down.
- Ctrl + P offers a box to use to search for and open files.
- Ctrl + Shift + P offers a box for commands like editing settings or reloading the window.
- Make use of VSCode's search/search-and-replace features.
- Ctrl + Click goes to a definition.
- Ctrl + F for search in current file
- Ctrl + H for replace in current file
- Ctrl + Shift + F for search in all files
- Ctrl + Shift + H for replace in all files
- F2 for Rename symbol
Many of VS Code's other shortcuts can be found on [its getting started page](https://code.visualstudio.com/docs/getstarted/keybindings), which also has links to OS-specific PDFs.
## C/C++ configuration
You can create a `.vscode/c_cpp_properties.json` file with `C/C++: Edit Configurations (JSON)` in the command box to customise how IntelliSense reads the repository (stuff like where to look for includes, flags, compiler defines, etc.) to make VSCode's IntelliSense plugin better able to understand the structure of the repository.
Below is a good default one to use for this project's repository, for the oot-gc-eu-mq-dbg version specifically.
A more complete `c_cpp_properties.json` with configurations for all supported versions [can be found here](c_cpp_properties.json).
```jsonc
{
"configurations": [
{
"name": "oot-gc-eu-mq-dbg",
"compilerArgs": [
"-m32" // Removes integer truncation warnings with gbi macros
],
"includePath": [ // Matches makefile's includes
"include",
"include/libc",
"src",
"build/gc-eu-mq-dbg",
".",
"extracted/gc-eu-mq-dbg"
],
"defines": [
"_LANGUAGE_C", // For gbi.h
// Version-specific
"OOT_VERSION=OOT_GC_EU_MQ_DBG",
"OOT_REGION=REGION_EU",
"PLATFORM_N64=0",
"PLATFORM_GC=1",
"OOT_PAL=1",
"OOT_MQ=1",
"OOT_DEBUG=1",
"F3DEX_GBI_2",
"F3DEX_GBI_PL",
"GBI_DOWHILE",
"GBI_DEBUG"
],
"cStandard": "gnu89", // C89 + some GNU extensions from C99 like C++ comments
}
],
"version": 4
}
```
## Settings
Add the following to (or create) the `.vscode/settings.json` file for VSCode to search the gitignored asset files by default:
```jsonc
{
"search.useIgnoreFiles": false,
"search.exclude": {
"**/.git": true,
Setup rom decompression and compression (#1614) * decompress baserom * cleanup * specific hash check * rename baserom * git subrepo clone (merge) --branch=5da3132606e4fd427a8d72b8428e4f921cd6e56f git@github.com:z64tools/z64compress.git tools/z64compress subrepo: subdir: "tools/z64compress" merged: "5da313260" upstream: origin: "git@github.com:z64tools/z64compress.git" branch: "5da3132606e4fd427a8d72b8428e4f921cd6e56f" commit: "5da313260" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * setup compression * Add all compressed segments to the spec * Update md5 files * readme instructions * cleanup * Setup python dependencies on Jenkinsfile * Update Makefile Co-authored-by: cadmic <cadmic24@gmail.com> * review * . .venv/bin/activate * update readme * whoops * Yeet other versions from decompress_baserom.py * my bad * Move everything to baseroms/VERSION/ * Active venv on each command * jenkinsfile: use multiline syntax * Put the correct path on the jenkinsfile * Forgot to call per_version_fixes * CC0 * Update readme * Change where baserom segments are put into * Update Makefile Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com> * Update crunch64 * Label compressed instead of uncompressed * Update README.md Co-authored-by: fig02 <fig02srl@gmail.com> * Fix * `make rom` * baserom-uncompressed * Update README.md Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com> * Update README.md Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com> * Update README.md Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com> * Update README.md Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com> * Update README.md Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com> * review * baserom-decompressed.z64 * ignore baseroms * rm -rf tools/z64compress * wip crunch64-based compress.py * OK compress * use ipl3checksum sum directly for cic update on compressed rom * multithreading * "docs" * fix MT: move set_sigint_ignored to global level for pickling * license compress.py * rm junk * Fix (or at least sort out) compress_ranges.txt dependencies * Update tools/overlayhelpers/damage_table.py Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com> --------- Co-authored-by: cadmic <cadmic24@gmail.com> Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com> Co-authored-by: fig02 <fig02srl@gmail.com>
2024-01-24 18:00:10 +00:00
"baseroms/**": true,
"build/**": true,
"expected/**": true,
},
}
```