| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente |
| prog:vsc:extension [2025/10/08 16:24] – [Configuration] : Précision sur la taille des indentations pour Python root | prog:vsc:extension [2025/11/18 09:37] (Version actuelle) – Ajout de "Formatter" > "Prettier" root |
|---|
| |
| Dans les préférences utilisateurs (''CTRL+,''), mettre | Dans les préférences utilisateurs (''CTRL+,''), mettre |
| * ''Editor: Tab Size'' à ''2''. Il est déconseillé de changer la taille des tabulations. Certains linters ne le supportent pas ([[https://github.com/psf/black/issues/378|Configurable Indent Levels?]] {{ :prog:vsc:extension:configurable_indent_levels_issue_378_psf_black_10_8_2025_4_22_47_pm_.html |Archive du 25/06/2018 le 08/10/2025}}). | * ''Editor: Tab Size'' à ''4''. Il est déconseillé de changer la taille des tabulations. Certains linters ne le supportent pas ([[https://github.com/psf/black/issues/378|Configurable Indent Levels?]] {{ :prog:vsc:extension:configurable_indent_levels_issue_378_psf_black_10_8_2025_4_22_47_pm_.html |Archive du 25/06/2018 le 08/10/2025}}). |
| * ''pylint args'' : mettre les même arguments que [[lang:python:linter#pylint|pylint]] | * ''pylint args'' : mettre les même arguments que [[lang:python:linter#pylint|pylint]] |
| |
| [[https://stackoverflow.com/questions/66698247/vscode-the-python-path-in-your-debug-configuration-is-invalid|VSCode: The Python path in your debug configuration is invalid]] {{ :prog:vsc:python:vscode_the_python_path_in_your_debug_configuration_is_invalid_-_stack_overflow_7_15_2021_10_26_55_am_.html |Archive du 18/03/2021 le 15/07/2021}} | [[https://stackoverflow.com/questions/66698247/vscode-the-python-path-in-your-debug-configuration-is-invalid|VSCode: The Python path in your debug configuration is invalid]] {{ :prog:vsc:python:vscode_the_python_path_in_your_debug_configuration_is_invalid_-_stack_overflow_7_15_2021_10_26_55_am_.html |Archive du 18/03/2021 le 15/07/2021}} |
| |
| =====Python C++ Debugger===== | =====C++===== |
| | |
| | ====CMake==== |
| | |
| | Passer des paramètres à la configuration de CMake : |
| | |
| | <code javascript> |
| | "cmake.configureArgs": [ |
| | "-DCMAKE_TOOLCHAIN_FILE=D:/vcpkg/scripts/buildsystems/vcpkg.cmake", |
| | "-DBUILD_SHARED_LIBS=ON", |
| | "-DVCPKG_TARGET_TRIPLET=x64-windows", |
| | "-DVCPKG_HOST_TRIPLET=x64-windows", |
| | "-DVCPKG_OVERLAY_TRIPLETS=../vcpkg-registry/triplets", |
| | "-DBUILD_TESTING:BOOL=ON", |
| | "-DCMAKE_INSTALL_PREFIX=d:/repos/install" |
| | ] |
| | </code> |
| | |
| | Passer des paramètres à l'exécution du programme en Debug : |
| | |
| | <code javascript> |
| | "cmake.debugConfig": { |
| | "args": [ |
| | "arg1" |
| | ] |
| | } |
| | </code> |
| | |
| | Choix du générateur : |
| | |
| | <code javascript> |
| | "cmake.generator": "Ninja" |
| | </code> |
| | |
| | ====clangd==== |
| | |
| | Ne pas afficher le nom des arguments dans la fenêtre d'édition: |
| | |
| | <code> |
| | "editor.inlayHints.enabled": "off" |
| | </code> |
| | |
| | ====C++ Debugger==== |
| | |
| | Pour s'attacher à un programme externe sous Linux: |
| | |
| | <file javascript launch.json> |
| | { |
| | "version": "0.2.0", |
| | "configurations": [ |
| | { |
| | "name": "Attach to MATLAB", |
| | "type": "cppdbg", |
| | "request": "attach", |
| | "program": "/opt/matlab/R2022b/bin/glnxa64/MATLAB", |
| | "processId": "${command:pickProcess}", |
| | "MIMode": "gdb", |
| | "setupCommands": [ |
| | { |
| | "description": "Enable pretty-printing for gdb", |
| | "text": "-enable-pretty-printing", |
| | "ignoreFailures": true |
| | } |
| | ] |
| | } |
| | ] |
| | } |
| | </file> |
| | |
| | ====vscode-cpptools==== |
| | |
| | Pour les gros projets avec des grosses dépendances, il faut augmenter la taille du cache. Certains fichiers ''ipch'' font plusieurs centaines de Mo. |
| | |
| | Dans ''Settings'' > ''Extensions'' > ''C/C++'' > ''Resource Management'', ''C_Cpp: Intelli Sense Cache Size'', mettre ''102400'' (100Go). |
| | |
| | Et éventuellement mettre le cache sur un dev drive (''C_Cpp: Intelli Sense Cache Path''). |
| | |
| | ====Python C++ Debugger==== |
| |
| Pouvoir déboguer un module python compilé en C++ depuis python. | Pouvoir déboguer un module python compilé en C++ depuis python. |
| </file> | </file> |
| |
| =====C++ Debugger===== | |
| |
| Pour s'attacher à un programme externe: | |
| |
| <file javascript launch.json> | |
| { | |
| "version": "0.2.0", | |
| "configurations": [ | |
| { | |
| "name": "Attach to MATLAB", | |
| "type": "cppdbg", | |
| "request": "attach", | |
| "program": "/opt/matlab/R2022b/bin/glnxa64/MATLAB", | |
| "processId": "${command:pickProcess}", | |
| "MIMode": "gdb", | |
| "setupCommands": [ | |
| { | |
| "description": "Enable pretty-printing for gdb", | |
| "text": "-enable-pretty-printing", | |
| "ignoreFailures": true | |
| } | |
| ] | |
| } | |
| ] | |
| } | |
| </file> | |
| =====CMake===== | =====CMake===== |
| |
| [[https://stackoverflow.com/questions/65894922/setting-cmake-compilation-options-in-vs-code|Setting CMake compilation options in VS Code]] {{ :prog:cmake:vsc:setting_cmake_compilation_options_in_vs_code_-_stack_overflow_22_09_2023_15_50_59_.html |Archive du 26/01/2021 le 22/09/2023}} | [[https://stackoverflow.com/questions/65894922/setting-cmake-compilation-options-in-vs-code|Setting CMake compilation options in VS Code]] {{ :prog:cmake:vsc:setting_cmake_compilation_options_in_vs_code_-_stack_overflow_22_09_2023_15_50_59_.html |Archive du 26/01/2021 le 22/09/2023}} |
| |
| =====Text Marker===== | =====Editeur===== |
| | |
| | ====Text Marker==== |
| |
| [[https://github.com/ryu1kn/vscode-text-marker|Site web]] | [[https://github.com/ryu1kn/vscode-text-marker|Site web]] |
| Il faut sélectionner le mot, clique-droit et ''Toggle Highlight''. | Il faut sélectionner le mot, clique-droit et ''Toggle Highlight''. |
| |
| =====Bracket Highlighter===== | ====Bracket Highlighter==== |
| |
| Ajout la surbrillance sur les crochets, parenthèses dans les strings. | Ajout la surbrillance sur les crochets, parenthèses dans les strings. |
| } | } |
| </code> | </code> |
| | |
| | =====Formatter===== |
| | |
| | ====Prettier==== |
| | |
| | Il faut l'extension ''esbenp.prettier-vscode'' et installer ''prettier'' via la commande ''npm -g install prettier''. |