Conversation
compile_flags.txt gives clangd the compile flags this one gives it the include directories, letting it perform code completion, linting, etc.
this commit disables transitive include errors
Claegtun
left a comment
There was a problem hiding this comment.
Do these files only affect vscode, not the actual compiling of the binary in CubeIDE?
There was a problem hiding this comment.
Does this file affect or influence the parent .clang files, i.e. .clang-format and .clang-tidy?
There was a problem hiding this comment.
Nope, .clangd is only used by clangd, .clang-format is only used by clang-format, .clang-tidy is only used by clang-tidy, and they don't have any connection to each other
clang-format formats files, clang-tidy lints code to detect errors, whereas clangd is a language server used to integrate code into an IDE with code completion, compile errors, etc.
I'm not sure if there's any reason to use clang-tidy if using clangd, clangd seems to provide a superset of clang-tidy's functionality, as well as proper IDE integration
There was a problem hiding this comment.
Correction, the vscode clangd extension actually embeds both: clang-format (reads .clang-format) providing formatting, and clang-tidy (reads .clang-tidy) which
provides extra hints about code problems: bug-prone patterns, performance traps, and style issues.
Yeah, both .clangd and compile_flags.txt are files specific to clangd (the language server, not to be confused with clang, the compiler) |
adds files (compile_flags.txt, .clangd) to configure clangd so that the clangd extension can be used in vscode (or anywhere with clangd support) for code highlighting, code completion, etc.
the config also does the following:
currently, it uses the default compiler installed on the user's machine, not the target architecture (arm) compiler, for simplicity and so that each user doesn't have to install the cross-compiler