@@ -4339,6 +4339,20 @@ class DevtoolIdeSdkGccTests(DevtoolIdeSdkTests):
self._test_code_and_none_qemu(slirp=True)
+class DevtoolIdeSdkRustTests(DevtoolIdeSdkTests):
+
+ def test_code_cargo_rust_analyzer_recommendation(self):
+ recipe_name = "cargo-example"
+ self._check_workspace()
+ self._write_bb_config()
+ tempdir = self._devtool_ide_sdk_recipe(recipe_name, "Cargo.toml", None)
+ runCmd('devtool ide-sdk %s oe-selftest-image --ide=code' % recipe_name,
+ output_log=self._cmd_logger)
+
+ with open(os.path.join(tempdir, '.vscode', 'extensions.json')) as extensions_file:
+ extensions = json.load(extensions_file)
+ self.assertIn('rust-lang.rust-analyzer', extensions['recommendations'])
+
class DevtoolIdeSdkKernelTests(DevtoolIdeSdkTests):
@OETestTag("runqemu")
@@ -303,6 +303,8 @@ class IdeVSCode(IdeBase):
def vscode_extensions(self, modified_recipe):
recommendations = []
+ if modified_recipe.build_tool is BuildTool.CARGO:
+ recommendations.append("rust-lang.rust-analyzer")
# clangd (matched to the recipe's real cross compiler via
# compile_commands.json) replaces cpptools as the IntelliSense provider
# when selected via IDE_SDK_INTELLISENSE (defaults to clangd for the
Recommend rust-analyzer for Cargo recipes and verify the extension appears in the generated VS Code recommendations file. AI-Generated: Uses GitHub Copilot Signed-off-by: Enguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com> --- meta/lib/oeqa/selftest/cases/devtool.py | 14 ++++++++++++++ scripts/lib/devtool/ide_plugins/ide_code.py | 2 ++ 2 files changed, 16 insertions(+)