Skip to content

Commit

Permalink
NF: add an IDE help
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthur-Milchior authored and eldruin committed May 2, 2024
1 parent 6cc8c29 commit 9617573
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
32 changes: 32 additions & 0 deletions microbit/src/03-setup/IDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Getting the best of your IDE

All codes in this book works assume that you use a simple terminal to build your code
run it, and interact with it. It also makes no assumption about your text editor.

However, you may have your favourite IDEs, providing you auto-complete, type annotation,
your preferred shortcuts and much more. This section explains how to get the best
of your IDE using the code obtained from this book's repo.

# Auto-completion, type annotation, and more

Some IDEs fail to understand the code, because it fails to determine whether a term
is defined in microbit or microbit-v2 codebase. If you fail to get auto-completion to work,
you may want to try to edit the `Cargo.toml` files you encounter through this book, and remove
all references to the version of microbit you are not using. That is:
* in Cargo.toml you must remove the dependency and feature you do not use
* in code, you must remove the part of the code guarded by `#[cfg(feature = "vI")]`, and the guard

# IDEs configuration

Below, we explain how to configure your IDE to get the best out of this book.
If your IDE is not listed below, please improve this book by adding a section, so that the next
reader get the best experience out of it.

## How to build with IntelliJ

When editing IntelliJ build configuration, here are a few non-default values:
* you should edit the command. When this book tells you to run `cargo embed FLAGS`,
you'll need to replace the default value `run` by the command `embed FLAGS`,
* You should check "Emulate terminal in output console". Otherwise, your program will fail to print text to a terminal
* You should ensure that the working directory is `microbit/src/N-name`, with `N-name` the directory of the chapter you
are reading. You can not run from the `src` directory since it contains no cargo file.
1 change: 1 addition & 0 deletions microbit/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- [Windows](03-setup/windows.md)
- [macOS](03-setup/macos.md)
- [Verify the installation](03-setup/verify.md)
- [Setting up your IDE](03-setup/IDE.md)
- [Meet your hardware](04-meet-your-hardware/README.md)
- [micro:bit v2](04-meet-your-hardware/microbit-v2.md)
- [micro:bit v1](04-meet-your-hardware/microbit-v1.md)
Expand Down

0 comments on commit 9617573

Please sign in to comment.