diff options
author | Enguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com> | 2024-02-19 17:55:23 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-02-20 12:58:41 +0000 |
commit | c0d340c52e6ff3a09d763fe13ea1dc9b726c6cb9 (patch) | |
tree | 85388831ce5c43dd58fc431f5004dc4fa77e00f1 /scripts/lib/devtool/ide_plugins/ide_code.py | |
parent | 8e84fbba7270335c0919a77d539f1a703f97676f (diff) | |
download | poky-c0d340c52e6ff3a09d763fe13ea1dc9b726c6cb9.tar.gz |
devtool: ide: vscode: Configure read-only files
When debugging or browsing files, the user may fall into external
sources from other packages in the sysroot or dbg-rootfs. Modifying them
will only lead to confusion since they will be overwritten by Yocto. The
user should open them in a separate devtool modify session if they want
to make changes. Meanwhile, we should prevent write access to them.
(From OE-Core rev: 8a95ad9aecb81732c865e00a987bb8bd3d6cb91d)
Signed-off-by: Enguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/devtool/ide_plugins/ide_code.py')
-rw-r--r-- | scripts/lib/devtool/ide_plugins/ide_code.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/scripts/lib/devtool/ide_plugins/ide_code.py b/scripts/lib/devtool/ide_plugins/ide_code.py index b2193130d2..f44665ed87 100644 --- a/scripts/lib/devtool/ide_plugins/ide_code.py +++ b/scripts/lib/devtool/ide_plugins/ide_code.py | |||
@@ -125,7 +125,7 @@ class IdeVSCode(IdeBase): | |||
125 | settings_dict["cmake.configureOnOpen"] = True | 125 | settings_dict["cmake.configureOnOpen"] = True |
126 | settings_dict["cmake.sourceDirectory"] = modified_recipe.real_srctree | 126 | settings_dict["cmake.sourceDirectory"] = modified_recipe.real_srctree |
127 | 127 | ||
128 | def vscode_settings(self, modified_recipe): | 128 | def vscode_settings(self, modified_recipe, image_recipe): |
129 | files_excludes = { | 129 | files_excludes = { |
130 | "**/.git/**": True, | 130 | "**/.git/**": True, |
131 | "**/oe-logs/**": True, | 131 | "**/oe-logs/**": True, |
@@ -138,9 +138,16 @@ class IdeVSCode(IdeBase): | |||
138 | "**/oe-workdir/**", | 138 | "**/oe-workdir/**", |
139 | "**/source-date-epoch/**" | 139 | "**/source-date-epoch/**" |
140 | ] | 140 | ] |
141 | files_readonly = { | ||
142 | modified_recipe.recipe_sysroot + '/**': True, | ||
143 | modified_recipe.recipe_sysroot_native + '/**': True, | ||
144 | } | ||
145 | if image_recipe.rootfs_dbg is not None: | ||
146 | files_readonly[image_recipe.rootfs_dbg + '/**'] = True | ||
141 | settings_dict = { | 147 | settings_dict = { |
142 | "files.watcherExclude": files_excludes, | 148 | "files.watcherExclude": files_excludes, |
143 | "files.exclude": files_excludes, | 149 | "files.exclude": files_excludes, |
150 | "files.readonlyInclude": files_readonly, | ||
144 | "python.analysis.exclude": python_exclude | 151 | "python.analysis.exclude": python_exclude |
145 | } | 152 | } |
146 | self.__vscode_settings_cmake(settings_dict, modified_recipe) | 153 | self.__vscode_settings_cmake(settings_dict, modified_recipe) |
@@ -424,7 +431,7 @@ class IdeVSCode(IdeBase): | |||
424 | self.vscode_tasks_fallback(args, modified_recipe) | 431 | self.vscode_tasks_fallback(args, modified_recipe) |
425 | 432 | ||
426 | def setup_modified_recipe(self, args, image_recipe, modified_recipe): | 433 | def setup_modified_recipe(self, args, image_recipe, modified_recipe): |
427 | self.vscode_settings(modified_recipe) | 434 | self.vscode_settings(modified_recipe, image_recipe) |
428 | self.vscode_extensions(modified_recipe) | 435 | self.vscode_extensions(modified_recipe) |
429 | self.vscode_c_cpp_properties(modified_recipe) | 436 | self.vscode_c_cpp_properties(modified_recipe) |
430 | if args.target: | 437 | if args.target: |