diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index f8ca9c3613..1ce9a79c9c 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -9,7 +9,7 @@ RUN apt-get update RUN apt-get upgrade -y -RUN apt-get install -y vim git wget python3 python-is-python3 pip gcc-arm-none-eabi scons libncurses5-dev +RUN apt-get install -y vim git wget python3 python-is-python3 pip gcc-arm-none-eabi libncurses5-dev RUN DEBIAN_FRONTEND=noninteractive apt-get install -y qemu-system-arm @@ -34,7 +34,7 @@ RUN git clone https://github.com/RT-Thread/packages.git /root/.env/packages/pack ENV PATH="/root/.env/tools/scripts:$PATH" -RUN pip install requests psutil kconfiglib tqdm -qq +RUN pip install scons requests psutil kconfiglib tqdm -qq ENV RTT_EXEC_PATH=/usr/bin diff --git a/tools/vsc.py b/tools/vsc.py index 7d23f17958..eb20dd0b3c 100644 --- a/tools/vsc.py +++ b/tools/vsc.py @@ -108,8 +108,17 @@ def GenerateCFiles(env): target_path_list = [] for path in path_list: if path['path'] != '.': - path['name'] = 'rtthread/' + '/'.join([p for p in path['path'].split('\\') if p != '..']) + normalized_path = path['path'].replace('\\', os.path.sep) + segments = [p for p in normalized_path.split(os.path.sep) if p != '..'] + path['name'] = 'rtthread/' + '/'.join(segments) json_obj['folders'] = path_list + if os.path.exists('compile_commands.json'): + json_obj['settings'] = { + "clangd.arguments": [ + "--compile-commands-dir=.", + "--header-insertion=never" + ] + } vsc_space_file.write(json.dumps(json_obj, ensure_ascii=False, indent=4)) vsc_space_file.close() return