Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] vscode: improve settings for new yocto plugin
@ 2024-02-09 20:30 Adrian Freihofer
  2024-02-09 23:43 ` [OE-core] " Richard Purdie
  0 siblings, 1 reply; 10+ messages in thread
From: Adrian Freihofer @ 2024-02-09 20:30 UTC (permalink / raw)
  To: openembedded-core; +Cc: Adrian Freihofer

There is a new official bitbake plugin:
https://marketplace.visualstudio.com/items?itemName=yocto-project.yocto-bitbake

This plugin automatically updates the .vscode/settings.json file.

Having the settings.json file in git and a plugin which modifies this
file is not ideal. It can lead to anoying situations especially when
working with git. For example a git stash reverts the settings which are
automatically applied by the plugin. While git stashed the settings.json
file the plugin immediately changes the file again and tries to run
bitbake based on the newly generated settings. When git does a stash pop
the restored settings.json file conflicts with the new settigns.json
file which has been generated while the git stash took place.

Removing the settings.json from git would lead to other issues as
already described in the commit message of 5ff688fe29. Until VSCode or
the plugin supports multiple config files like bitbake does with the
site.conf and the local.conf files, there are probably some use cases
and workflows where the plugin needs to be disabled.

This commit aligns the default settings.json file with the default
settings.json which gets generated by the plugin. This is a workaround
for the issue described above. But it works only for the default build
configuration with one build folder named "build".

Discussion is here:
https://github.com/yoctoproject/vscode-bitbake/issues/95
---
 .gitignore            |  4 ++--
 .vscode/settings.json | 28 +++++++++++++++++++++++++++-
 2 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/.gitignore b/.gitignore
index f6ce090b5fc..fa5345a79f5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -36,5 +36,5 @@ _toaster_clones/
 downloads/
 sstate-cache/
 toaster.sqlite
-.vscode/
-vscode-bitbake-build/
+.vscode/*
+!.vscode/settings.json
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 517a86d1bfa..4d615ae3aa9 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -28,5 +28,31 @@
         "**/vscode-bitbake-build/**",
         "**/workspace/sources/**",
         "**/workspace/attic/**"
-    ]
+    ],
+    "bitbake.pathToBitbakeFolder": "${workspaceFolder}/bitbake",
+    "bitbake.pathToEnvScript": "${workspaceFolder}/oe-init-build-env",
+    "bitbake.pathToBuildFolder": "${workspaceFolder}/build",
+    "bitbake.commandWrapper": "",
+    "bitbake.workingDirectory": "",
+    "python.autoComplete.extraPaths": [
+        "${workspaceFolder}/bitbake/lib",
+        "${workspaceFolder}/meta/lib"
+    ],
+    "python.analysis.extraPaths": [
+        "${workspaceFolder}/bitbake/lib",
+        "${workspaceFolder}/meta/lib"
+    ],
+    "[python]": {
+        "diffEditor.ignoreTrimWhitespace": false,
+        "gitlens.codeLens.symbolScopes": [
+            "!Module"
+        ],
+        "editor.formatOnType": true,
+        "editor.wordBasedSuggestions": "off",
+        "files.trimTrailingWhitespace": false
+    },
+    "[shellscript]": {
+        "files.eol": "\n",
+        "files.trimTrailingWhitespace": false
+    }
 }
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-02-13 14:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-09 20:30 [PATCH] vscode: improve settings for new yocto plugin Adrian Freihofer
2024-02-09 23:43 ` [OE-core] " Richard Purdie
2024-02-10 13:42   ` adrian.freihofer
2024-02-11 15:24   ` adrian.freihofer
2024-02-12  9:42     ` Enguerrand de Ribaucourt
2024-02-12 15:48       ` adrian.freihofer
2024-02-12 16:58         ` Enguerrand de Ribaucourt
2024-02-12 22:43           ` adrian.freihofer
2024-02-13  9:22             ` Enguerrand de Ribaucourt
2024-02-13 14:53               ` Peter Kjellerstedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox