Genio
Genio copied to clipboard
Incomplete outline for ColumnTypes.cpp (in Haiku source)
If you open /src/kits/interface/ColumnTypes.cpp
in the Haiku source tree, you only get one entry in the Outline pane: gSystemCatalog
Something's not right...
Has the compile db been generated?
How can I tell?
I just did a "Open project..." and opened the /src/kits/interface
folder. Then opened the file ColumnTypes.cpp
.
Just a bit of context on how clangd (the Language Server) works. It uses the AST produced by clang (the compiler) which in turn needs to know how to compile the translation units that are part of a C++ project. The compile db is a list of the options and parameters needed to compile the project and can be produced in different ways. We explain this in Configuring-clangd-lsp.md. Without it clangd may have an incomplete view of the entire AST and fail to resolve some symbols. Now, I'm just trying to figure whether this is your case.
FWIW, I don't see a "compile_commands.json" or "config.yaml" in any settings folder or project...
In any case, the outline works for other files in the same folder...
I open a project pointing to /src/kits/interface/
, then I open whatever file and get the symbols within. Being them internal symbols in the file itself, I presume this would be quite trivial for clangd without requiring the compile db.
Are these steps the same for you?
Yes. Only I get just the first, "gSystemCatalog"... I tried with this interface-kit project being "active" and not. No difference. Running current main Genio_debug, compiled a minute ago.
Curious.
Are you on LLVM16 or 17?
I got these:
llvm12_libs-12.0.1-8-x86_64.hpkg llvm17_clang-17.0.6-1-x86_64.hpkg llvm17_libs-17.0.6-1-x86_64.hpkg
I could not reproduce.. if you have time, please run genio with low/off log level but with Trace log level for LSP. Open just the header file to keep the log noise at minimum. Thanks
Open just the header file to keep the log noise at minimum.
To clarify, the outline issue described happens when opening /src/kits/interface/ColumnTypes.cpp
, not its header file.
Here are the logs when opening
-
/src/kits/interface/ColumnTypes.cpp
: log_ColumnTypes.txt (the problem) -
/src/kits/interface/Control.cpp
: log_Control.txt (working, for comparison)
Not a clangd or LSP expert here, or even C++, so I may be talkng nonsense, but maybe there's nothing else because it can't tell whether they are class methods or namespaced functions or something else due to lack of declarations? For Control.cpp it gets the header file with the declarations from the system include path, but for ColumnTypes.cpp it can't because it's in private and that's not in the list (and without the compile db it doesn't know where else to look for it). Just for testing, could you try copying ColumntTypes.h in src/kits/interface?
Ah sure! This might well be! That would also explain the different behaviour on different systems: maybe @Freaxed and @nexus6-haiku configured clangd differently by adding those paths in the configuration?
I agree, this could explain the behaviour. Anyway, by looking at the logs, Genio is correctly showing the only symbol sent by clangd (gSystemCatalog).
Just for testing, could you try copying ColumntTypes.h in src/kits/interface?
Indeed this 'fixes' my outline issue. Nice work, Sherlock Máximo! I guess there's nothing Genio can do in these cases and this is a closable non-issue?
I guess that would work if we added the private headers folder into the clangd configuration, @Freaxed ? Unfortunately we can't provide that file on installation, right ?
AFAIK there are 3 ways to provide a configuration parameter: by command line, by local project file and by user settings file. We should investigate a bit on command line options or maybe we could create/update the user settings file.
Il giorno mer 22 mag 2024 alle ore 10:00 Stefano Ceccherini < @.***> ha scritto:
I guess that would work if we added the private headers folder into the clangd configuration, @Freaxed https://github.com/Freaxed ? Unfortunately we can't provide that file on installation, right ?
— Reply to this email directly, view it on GitHub https://github.com/Genio-The-Haiku-IDE/Genio/issues/376#issuecomment-2124122288, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALC2DS4HHWEJ5XRSY5LS3TZDRGADAVCNFSM6AAAAABHDURDOOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRUGEZDEMRYHA . You are receiving this because you were mentioned.Message ID: @.***>
Is it worth it, though? Next thing is a header that is in the project but not in the installation. Or one that is different enough to cause confusion.
Headers in the project folder are on thing, but would be nice to provide a nice experience out of the box, including also private and shared haiku headers, at least. On the other hand, the current situation isnt that bad and more advanced users should learn how to configure clangd and do themselves
Anyway, let's close this for now.