From 979b5a20cdf7ecbe1feee7da916bb57357b0fea5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Volker=20Wei=C3=9Fmann?= <>
Date: Mon, 19 Jun 2023 09:57:47 +0100
Subject: [PATCH] ENH: update Visual Studio Code settings for new vscode
 versions (fixes #2805)

---
 bin/tools/vscode-settings | 36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/bin/tools/vscode-settings b/bin/tools/vscode-settings
index 6cf4804cd6f..80a9f308980 100755
--- a/bin/tools/vscode-settings
+++ b/bin/tools/vscode-settings
@@ -18,8 +18,7 @@
 #     Emit some settings for Visual Studio Code + OpenFOAM
 #
 # Example
-#     bin/tools/vscode-settings > .vscode/settings.json
-#     openfoam -spdp -int64 bin/tools/vscode-settings
+#    bin/tools/vscode-settings > openfoam.code-workspace
 #
 # Environment
 #     WM_PROJECT_DIR, WM_PROJECT_USER_DIR, WM_OPTIONS
@@ -42,8 +41,7 @@ options:
 Emit some settings for Visual Studio Code + OpenFOAM
 
 For example,
-    bin/tools/vscode-settings > .vscode/settings.json
-    openfoam -spdp -int64 bin/tools/vscode-settings
+    bin/tools/vscode-settings > openfoam.code-workspace
 
 USAGE
     exit 0  # clean exit
@@ -117,15 +115,18 @@ cat << INFO 1>&2
 # -------------------------
 INFO
 
-echo '{'  # BEGIN_LIST
-
 # ccls integration
 cat << JSON_CONTENT
-    "ccls.cache.directory":
-"$outputDir/ccls-cache",
+{
+    "folders": [
+        {
+            "path": "$projectDir"
+        }
+    ],
+    "settings": {
+        "ccls.cache.directory": "$outputDir/ccls-cache",
 
-    "ccls.misc.compilationDatabaseDirectory":
-"$outputDir",
+        "ccls.misc.compilationDatabaseDirectory": "$outputDir",
 
 JSON_CONTENT
 
@@ -134,19 +135,18 @@ JSON_CONTENT
 if [ -x "$session" ]
 then
 cat << JSON_CONTENT
-    "C_Cpp.default.compileCommands":
-"$session wmake -with-bear -s -j",
+        "C_Cpp.default.compileCommands": "$session wmake -with-bear -s -j",
 JSON_CONTENT
 fi
 
 cat << JSON_CONTENT
 
-    "C_Cpp.autocomplete": "Disabled",
-    "C_Cpp.errorSquiggles": "Disabled",
-    "C_Cpp.formatting": "Disabled",
-    "C_Cpp.intelliSenseEngine": "Disabled"
+        "C_Cpp.autocomplete": "Disabled",
+        "C_Cpp.errorSquiggles": "Disabled",
+        "C_Cpp.formatting": "Disabled",
+        "C_Cpp.intelliSenseEngine": "Disabled"
+    }
+}
 JSON_CONTENT
 
-echo '}'  # END_LIST
-
 #------------------------------------------------------------------------------
-- 
GitLab