Skip to content

Commit

Permalink
Add vscode docs (#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yanis002 authored Oct 8, 2024
1 parent 2d85ac9 commit ac598e5
Show file tree
Hide file tree
Showing 2 changed files with 135 additions and 0 deletions.
77 changes: 77 additions & 0 deletions docs/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"configurations": [
{
"name": "mq-j",
"intelliSenseMode": "${default}",
"includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}/src",
"${workspaceFolder}/include",
"${workspaceFolder}/libc",
"${workspaceFolder}/build/mq-j/include"
],
"defines": ["VERSION=MQ_J"]
},
{
"name": "mq-u",
"intelliSenseMode": "${default}",
"includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}/src",
"${workspaceFolder}/include",
"${workspaceFolder}/libc",
"${workspaceFolder}/build/mq-u/include"
],
"defines": ["VERSION=MQ_U"]
},
{
"name": "mq-e",
"intelliSenseMode": "${default}",
"includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}/src",
"${workspaceFolder}/include",
"${workspaceFolder}/libc",
"${workspaceFolder}/build/mq-e/include"
],
"defines": ["VERSION=MQ_E"]
},
{
"name": "ce-j",
"intelliSenseMode": "${default}",
"includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}/src",
"${workspaceFolder}/include",
"${workspaceFolder}/libc",
"${workspaceFolder}/build/ce-j/include"
],
"defines": ["VERSION=CE_J"]
},
{
"name": "ce-u",
"intelliSenseMode": "${default}",
"includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}/src",
"${workspaceFolder}/include",
"${workspaceFolder}/libc",
"${workspaceFolder}/build/ce-u/include"
],
"defines": ["VERSION=CE_U"]
},
{
"name": "ce-e",
"intelliSenseMode": "${default}",
"includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}/src",
"${workspaceFolder}/include",
"${workspaceFolder}/libc",
"${workspaceFolder}/build/ce-e/include"
],
"defines": ["VERSION=CE_E"]
}
],
"version": 4
}
58 changes: 58 additions & 0 deletions docs/vscode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# 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)

## 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 `ce-j` 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": "ce-j",
"intelliSenseMode": "${default}",
"includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}/src",
"${workspaceFolder}/include",
"${workspaceFolder}/libc",
"${workspaceFolder}/build/ce-j/include"
],
"defines": ["VERSION=CE_J"]
}
],
"version": 4
}
```

0 comments on commit ac598e5

Please sign in to comment.