diff --git a/ewp_parser.py b/ewp_parser.py index 289a2be..0876f2e 100644 --- a/ewp_parser.py +++ b/ewp_parser.py @@ -142,15 +142,21 @@ def generate_compile_commands(output_file, root_path, options, files): :param options: a list of the compilation options :param files: a list of files """ + + #Compile command implementations seem to have issues ready properly the first + #argument, so we add a dummy one as a workaround. Seen with CppCheck and + #Clangd + fixed_options = [""] + fixed_options += options + with open(output_file, "w") as output: commands = [] for file in files: commands.append( - {"directory": root_path, "arguments": options, "file": file}) + {"directory": root_path, "arguments": fixed_options, "file": file}) json.dump(commands, output, indent=True) - def normalize_path(path): """ Normalizes the given path. Handles mixed-convention paths (dos/unix), which