From 31919965a1e8200635f4cda0075396b4a4520b8e Mon Sep 17 00:00:00 2001 From: hedger Date: Tue, 16 Jul 2024 17:41:30 +0300 Subject: [PATCH] VSCode fixes: .gitignore & clangd (#3790) * vscode: fine-tuned .gitignore to allow extra untracked files in .vscode folder * vscode: temporary disabled toolchain-provided clangd * Update sublime project to match vscode config Co-authored-by: Aleksandr Kutuzov --- .sublime-project | 22 +++++++++++-------- .vscode/.gitignore | 8 +++---- .vscode/example/settings.json.tmpl | 2 +- .../project_template/.vscode/settings.json | 2 +- 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/.sublime-project b/.sublime-project index 5d751aaf6..da2ef41a1 100644 --- a/.sublime-project +++ b/.sublime-project @@ -6,16 +6,20 @@ } ], "settings": { - "LSP": { - "clangd": { - "initializationOptions": { - "clangd.compile-commands-dir": "build/latest", - "clangd.header-insertion": "never", - "clangd.query-driver": "**", - "clangd.clang-tidy": true, - }, + "LSP": { + "clangd": { "enabled": true, + "initializationOptions": { + // Use with toolchain version 39+ + // Set `"binary": "custom",` option in LSP-clangd config to use toolchain clangd + // "custom_command": ["toolchain/current/bin/clangd"], + + "clangd.compile-commands-dir": "build/latest", + "clangd.header-insertion": "never", + "clangd.query-driver": "**/arm-none-eabi-*", + "clangd.clang-tidy": true, + }, }, - }, + }, }, } diff --git a/.vscode/.gitignore b/.vscode/.gitignore index 481efcdef..bd4df47d6 100644 --- a/.vscode/.gitignore +++ b/.vscode/.gitignore @@ -1,5 +1,3 @@ -/c_cpp_properties.json -/extensions.json -/launch.json -/settings.json -/tasks.json +* +!example/ +!ReadMe.md diff --git a/.vscode/example/settings.json.tmpl b/.vscode/example/settings.json.tmpl index 5e5b5dcf4..5e0da6897 100644 --- a/.vscode/example/settings.json.tmpl +++ b/.vscode/example/settings.json.tmpl @@ -12,7 +12,7 @@ "SConstruct": "python", "*.fam": "python" }, - "clangd.path": "${workspaceFolder}/toolchain/current/bin/clangd@FBT_PLATFORM_EXECUTABLE_EXT@", + // "clangd.path": "${workspaceFolder}/toolchain/current/bin/clangd@FBT_PLATFORM_EXECUTABLE_EXT@", "clangd.arguments": [ "--query-driver=**/arm-none-eabi-*", "--compile-commands-dir=${workspaceFolder}/build/latest", diff --git a/scripts/ufbt/project_template/.vscode/settings.json b/scripts/ufbt/project_template/.vscode/settings.json index d304752a9..b93ad82f1 100644 --- a/scripts/ufbt/project_template/.vscode/settings.json +++ b/scripts/ufbt/project_template/.vscode/settings.json @@ -19,7 +19,7 @@ "[python]": { "editor.defaultFormatter": "ms-python.black-formatter" }, - "clangd.path": "@UFBT_TOOLCHAIN_CLANGD@", + // "clangd.path": "@UFBT_TOOLCHAIN_CLANGD@", "clangd.arguments": [ "--query-driver=**/arm-none-eabi-*", "--compile-commands-dir=${workspaceFolder}/.vscode",