forked from RobotLocomotion/drake
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[doc] Add VS Code and Emacs integration tips (RobotLocomotion#18681)
- Loading branch information
1 parent
9fb09b4
commit 91ef573
Showing
4 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
title: Emacs IDE setup | ||
--- | ||
|
||
This guide describes how to edit the Drake codebase using Emacs. | ||
|
||
If you have tips that would help out other developers, drop us a line and we | ||
can add them here! | ||
|
||
# Setting up Emacs | ||
|
||
There is nothing really special to do. | ||
On Ubuntu ``sudo apt install emacs``. | ||
|
||
## Bazel | ||
|
||
We recommend [emacs-bazel-mode](https://github.com/bazelbuild/emacs-bazel-mode). | ||
If you have MELPA configured, use ``M-x package-install bazel``. | ||
|
||
## Git | ||
|
||
We recommend ``magit``. | ||
On Ubuntu ``sudo apt install elpa-magit``. | ||
|
||
## C++ code formatting | ||
|
||
Use ``(require 'clang-format)`` to enable the ``M-x clang-format-...`` family of | ||
functions. Also check that the customize variable ``clang-format-executable`` is | ||
set to Drake's preferred value ``clang-format-12``. | ||
|
||
<!--- TODO(jwnimmer-tri) Explain 'google-c-style from the styleguide. --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
title: VS Code IDE setup | ||
--- | ||
|
||
This guide describes how to edit the Drake codebase using VS Code. | ||
|
||
If you have tips that would help out other developers, drop us a line and we | ||
can add them here! | ||
|
||
# Setting up VS Code | ||
|
||
There is nothing really special to do. | ||
Be sure you've installed the C/C++ extension pack from Microsoft. | ||
|
||
## C++ paths | ||
|
||
Because VS Code wants to locate all included headers, but Bazel does | ||
not provide those headers in a single consistent location, it is | ||
common to get "red squiggles" for included headers, particularly for | ||
externals like LCM. So far this does not seem to be avoidable; the | ||
`"C_Cpp.errorSquiggles": "enabledIfIncludesResolve"` setting does not | ||
work to solve this problem. | ||
|
||
## C++ code formatting | ||
|
||
The [Visual Studio docs](https://code.visualstudio.com/docs/cpp/cpp-ide#_code-formatting) | ||
on code formatting work well. Take note of "Format Document", | ||
"Format Selection", "Format on save", and "Format on type". | ||
|
||
In the VS Code Options configuration, check that the option for | ||
``C_Cpp: Clang_format_path`` is set to Drake's preferred value | ||
``clang-format-12``. |