The PR #55 points out that generate_rust_analyzer.py cannot function properly when the Makefiles are missing. This is due to the lack of handling for the case where the Makefile does not exist. The relevant code is as follows:
https://github.com/BUPT-OS/RROS/blob/129975ae0600ba00a548ac411591c60d291c807c/scripts/generate_rust_analyzer.py#L98-L119
The code attempts to open a file without checking for the existence of the Makefile, resulting in a FileNotFoundError when generating the rust-project.json for rust-analyzer. Since the Makefile in these directories serves no other purpose, I think handling the absence of Makefiles through exception catching is a better choice than providing empty Makefiles. The changes are as follows.
That's all.Thanks.
The PR #55 points out that generate_rust_analyzer.py cannot function properly when the Makefiles are missing. This is due to the lack of handling for the case where the Makefile does not exist. The relevant code is as follows: https://github.com/BUPT-OS/RROS/blob/129975ae0600ba00a548ac411591c60d291c807c/scripts/generate_rust_analyzer.py#L98-L119 The code attempts to open a file without checking for the existence of the Makefile, resulting in a FileNotFoundError when generating the
rust-project.json
for rust-analyzer. Since the Makefile in these directories serves no other purpose, I think handling the absence of Makefiles through exception catching is a better choice than providing empty Makefiles. The changes are as follows. That's all.Thanks.