Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add VSCode sane defaults #540

Merged
merged 7 commits into from
Sep 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 6 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# Python Byte-compiled / optimized / DLL files
# Python
__pycache__/
*.py[cod]
*$py.class
.mypy_cache/
*.egg-info/
/venv/

# Common IDE's, ideally this should be in global gitignore per user
.vscode/
.idea/
/cmake-build*/
.cache/
cmake-build*/
/build/

#GUI Files
# GUI Files
node_modules/
/src/teleop/gui/dist/
/src/teleop/gui/src/static/map
Expand All @@ -21,19 +24,8 @@ yarn-error.log*
# Bag Files
/bags/

# Catkin
/build/
/devel/
/logs/

# Moteus
moteus-cal*

# CSV
*.csv

# Virtual Environment
/venv/

# clangd Output
.cache/
12 changes: 12 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"recommendations": [
"ms-vscode.cpptools",
"ms-vscode.cmake-tools",
"ms-python.vscode-pylance",
"ms-python.black-formatter",
"dbaeumer.vscode-eslint",
"redhat.vscode-xml",
"redhat.vscode-yaml",
"llvm-vs-code-extensions.vscode-clangd",
],
}
37 changes: 37 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
//// Cmake
// Catkin only works with Make... ideally we could use Ninja
"cmake.generator": "Unix Makefiles",
// Set to the catkin build directory
"cmake.buildDirectory": "../../build/mrover",
// We want catkin to configure
// VSCode will try to use its own toolchain and ignore the catkin profile
"cmake.configureOnOpen": false,
"cmake.configureOnEdit": false,
"cmake.automaticReconfigure": false,
"cmake.debugConfig": {
"miDebuggerPath": "/usr/bin/gdb",
},
//// Microsoft C++
// Disable since clangd is used instead
"C_Cpp.intelliSenseEngine": "disabled",
//// Python
"python.analysis.inlayHints.variableTypes": true,
"python.analysis.inlayHints.callArgumentNames": "all",
"python.analysis.inlayHints.functionReturnTypes": true,
// ~/catkin_ws/devel/lib/python3/dist-packages is already in PYTHONPATH,
// but Pylance currently has a bug where it cannot handle the symlinks in it.
// Below we are just putting directly where those symlinks go
"python.analysis.extraPaths": [
"/opt/ros/noetic/lib/python3/dist-packages",
"../../devel/.private/mrover/lib/python3/dist-packages",
],
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter",
},
// We use mypy for this, see style.sh
"python.analysis.typeCheckingMode": "off",
//// Miscellaneous
"redhat.telemetry.enabled": false,
"editor.formatOnSave": true,
}