Genio icon indicating copy to clipboard operation
Genio copied to clipboard

Incomplete outline for ColumnTypes.cpp (in Haiku source)

Open humdingerb opened this issue 9 months ago • 14 comments

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...

humdingerb avatar May 02 '24 12:05 humdingerb

Has the compile db been generated?

nexus6-haiku avatar May 04 '24 14:05 nexus6-haiku

How can I tell? I just did a "Open project..." and opened the /src/kits/interface folder. Then opened the file ColumnTypes.cpp.

humdingerb avatar May 04 '24 17:05 humdingerb

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.

nexus6-haiku avatar May 04 '24 21:05 nexus6-haiku

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...

humdingerb avatar May 05 '24 05:05 humdingerb

2024-05-06_16-32

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?

nexus6-haiku avatar May 06 '24 14:05 nexus6-haiku

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.

humdingerb avatar May 07 '24 05:05 humdingerb

Are you on LLVM16 or 17?

nexus6-haiku avatar May 07 '24 14:05 nexus6-haiku

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

humdingerb avatar May 07 '24 15:05 humdingerb

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

Freaxed avatar May 08 '24 19:05 Freaxed

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

humdingerb avatar May 09 '24 06:05 humdingerb

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?

lonemadmax avatar May 09 '24 15:05 lonemadmax

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?

jackburton79 avatar May 09 '24 15:05 jackburton79

I agree, this could explain the behaviour. Anyway, by looking at the logs, Genio is correctly showing the only symbol sent by clangd (gSystemCatalog).

Freaxed avatar May 09 '24 16:05 Freaxed

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?

humdingerb avatar May 09 '24 16:05 humdingerb

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 ?

jackburton79 avatar May 22 '24 07:05 jackburton79

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: @.***>

Freaxed avatar May 22 '24 08:05 Freaxed

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.

lonemadmax avatar May 22 '24 15:05 lonemadmax

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

jackburton79 avatar May 22 '24 17:05 jackburton79

Anyway, let's close this for now.

jackburton79 avatar May 23 '24 09:05 jackburton79