Skip to content

Commit 70fc662

Browse files
authored
Merge pull request #481 from Arthur-Milchior/IDE
NF: add an IDE help
2 parents 6cc8c29 + bb0e776 commit 70fc662

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

microbit/src/03-setup/IDE.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Getting the most out of your IDE
2+
3+
All code in this book assumes that you use a simple terminal to build your code,
4+
run it, and interact with it. It also makes no assumption about your text editor.
5+
6+
However, you may have your favourite IDEs, providing you auto-complete, type annotation,
7+
your preferred shortcuts and much more. This section explains how to get the most out
8+
of your IDE using the code obtained from this book's repo.
9+
10+
# Auto-completion, type annotation, and more
11+
12+
Some IDEs fail to understand the code, because they fail to determine whether a term
13+
is defined in the microbit or microbit-v2 codebase. If you fail to get auto-completion to work,
14+
you may want to try to edit the `Cargo.toml` files you encounter through this book, and remove
15+
all references to the version of microbit you are not using. That is:
16+
in the `Cargo.toml` file you must remove the dependency and features you do not use (the part guarded by `#[cfg(feature = "vI")]` and the guard itself)
17+
18+
# IDE configuration
19+
20+
Below, we explain how to configure your IDE to get the most out of this book.
21+
If your IDE is not listed below, please improve this book by adding a section, so that the next
22+
reader can get the best experience out of it.
23+
24+
## How to build with IntelliJ
25+
26+
When editing the IntelliJ build configuration, here are a few non-default values:
27+
* You should edit the command. When this book tells you to run `cargo embed FLAGS`,
28+
You'll need to replace the default value `run` by the command `embed FLAGS`,
29+
* You should enable "Emulate terminal in output console". Otherwise, your program will fail to print text to a terminal
30+
* You should ensure that the working directory is `microbit/src/N-name`, with `N-name` being the directory of the chapter you
31+
are reading. You can not run from the `src` directory since it contains no cargo file.

microbit/src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- [Windows](03-setup/windows.md)
77
- [macOS](03-setup/macos.md)
88
- [Verify the installation](03-setup/verify.md)
9+
- [Setting up your IDE](03-setup/IDE.md)
910
- [Meet your hardware](04-meet-your-hardware/README.md)
1011
- [micro:bit v2](04-meet-your-hardware/microbit-v2.md)
1112
- [micro:bit v1](04-meet-your-hardware/microbit-v1.md)

0 commit comments

Comments
 (0)