Closed db48x closed 1 week ago
I see that parser.rs:288 has c.get_name().unwrap_or_default()
, so I guess that’s where the empty string is coming from. get_name()
is a simple wrapper around clang_getCursorSpelling
from libclang, so I guess we just get what we get.
I can't reproduce, this works fine in the example directory. Can you share your config file? This may be because you forgot to pass -x c++ to clang.
[input]
glob = "src/*.h"
compiler_arguments = ["-Isrc -isystem src/third-party -DGIT_VERSION -DTILES -DBACKTRACE -DLOCALIZE -Og -Werror -Wall -Wextra -Wformat-signedness -Wlogical-op -Wmissing-declarations -Wmissing-noreturn -Wnon-virtual-dtor -Wold-style-cast -Woverloaded-virtual -Wpedantic -Wsuggest-override -Wunused-macros -Wzero-as-null-pointer-constant -Wno-unknown-warning-option -Wno-dangling-reference -Wno-c++20-compat -Wredundant-decls -ggdb -g -fsigned-char -std=c++17 -I/usr/include/SDL2 -D_REENTRANT -I/usr/include/SDL2 -D_REENTRANT -DHWY_SHARED_DEFINE -DAVIF_DLL -I/usr/include/webp -I/usr/include/libpng16 -DWITH_GZFILEOP -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-6 -pthread -I/usr/include/freetype2 -I/usr/include/libpng16 -DWITH_GZFILEOP -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-6 -pthread -I/usr/include/SDL2 -D_REENTRANT -DSDL_SOUND -MMD -MP"]
Adding -x c++
to compiler_arguments
doesn’t change the result.
Try splitting your arguments, compiler_arguments
is an array of arguments. So it should be ["-Isrc", "-isystem", ...]
I can do that, but is it really relevant? It just concatenates them back into a single string.
I can do that, but is it really relevant? It just concatenates them back into a single string.
Yes. It seems like libclang expects an array.
Yea, that does fix it. And I was misremembering; it’s compiler_invocation
in the [doctests]
section that is joined back into a single string.
Maybe it should print a warning if compiler_arguments
looks suspiciously like a single string with spaces in it?
Yea, that does fix it. And I was misremembering; it’s
compiler_invocation
in the[doctests]
section that is joined back into a single string.Maybe it should print a warning if
compiler_arguments
looks suspiciously like a single string with spaces in it?
Yeah that is a good idea, I suppose I could also add some kind of fallback, like if there's only one element in the array and it is space-separated, split it into a proper array
Given the struct
mvwzstr
:cppdoc outputs:
The types are not perfect either, but let’s start with the name.