Summary: | The classes toolview does not work--no classes displayed | ||
---|---|---|---|
Product: | [Applications] kdevelop | Reporter: | kdbase-kdebug |
Component: | UI: general | Assignee: | kdevelop-bugs-null |
Status: | RESOLVED NOT A BUG | ||
Severity: | normal | CC: | |
Priority: | NOR | ||
Version First Reported In: | 5.6.0 | ||
Target Milestone: | --- | ||
Platform: | Fedora RPMs | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | Sample C++ program |
Description
kdbase-kdebug
2020-09-27 22:09:29 UTC
I can't reproduce this with 5.6-git on Arch, the Classes toolview is working fine. Do you have an example of a specific project this doesn't work with? (also, can you please set the 'Version' field?) Francis, Thanks for you reply. I'm not surprised that you say you can't reproduce it, since no one else has reported it. For some mysterious reason, I seem to be the only person affected. I filled in the version field to 5.6.0. It also happened with the previous version of kdevelop. You may want to close the bug. My project is small, so I can try to create a new project and session, or even re-install kdevelop, to see if that fixes the problem for me. If it does, I'll post an update. As promised, here's a followup. The Classes toolview is working properly now. I deleted and re-created the project, and then did--I did a lot of things. I'm not entirely sure what finally worked. The project is something I've been tinkering with for several years. It was originally created with a text editor outside of kdevelop, and later integrated with the IDE (which is very good, by the way). Later on, I switched from using a makefile to using meson. Everything always worked fine, until the Classes button quit doing anything a few months ago. Until today, I always ran the meson command outside of kdevelop, and used kdevelop just for its editing, searching, etc. capabilities. Just in the last few minutes, I set up kdevelop to itself build the project, using meson, and this is what finally made the Classes button work as before. As I mentioned before, the classes were always parsed properly, and I could hover over a variable in the code and get all the information about it. I think it would be better if the Classes button also worked, but this was a minor problem. Perhaps the documenation could be clearer for my use case, or perhaps it's not worth worrying about. Thank you for the report. Given that it only seems to happen for you, it's presumably caused by some attribute of your project or setup and unlikely to be reproducible given the information available. If the project is publicly-available somewhere (or you can attach it here or send it to me) I could try with that. Documentation is probably not an issue -- there's no case where classes should be visible in the code browser and not the Classes view. P.S. -- meson support in KDevelop is quite recent, it might not have existed when you originally imported the project. Created attachment 132030 [details]
Sample C++ program
Attachment for bug number 427050
I have reproduced the problem. I'll explain how here, and then I'll explain how it happened to me. 1. Create a new directory, for example 'test'. 2. Copy the file 'junk.cpp' into the directory. I just tried uploading the file as an attachment, but I'm not sure it uploaded it correctly. Since the file is short, I'll place the contents here: --------------------------------------------------------------- // Sample file #include <iostream> struct junk { long a; double b; junk() { a = 2; b = 3.5; } void out() const { std::cout << "a = " << a << ", b = " << b << '\n'; } }; int main() { junk j0; j0.out(); j0.b *= 3; j0.out(); return 0; } --------------------------------------------------------------- 3. Open kdevelop. From the menu bar, choose 'New from Template...' under 'Project'. Choose 'Standard' Category, 'Empty' Project Type. You can probably place the project anywhere, but I chose to place it in the test/ directory. I named the project 'ex'. 4. Open the newly created project 'ex'. It contains no files. Using the 'File System' tab on the left, or maybe using the 'File' menu, open the file 'junk.cpp'. 5. This re-creates the problem. The junk.cpp file is in the editor. If you click on the Classes tab, the junk struct is not present. Within the editor, however, you can access the information about variables and objects. For example, you can hover over the 'out' on line 20, or the 'b' on line 21. At least, this is the behavior I observe. How did this happen to me? In my case, I had an existing project that used meson. At first, as Francis guessed, kdevelop did not support meson. When it was added later, I couldn't figure out how to use it, although I didn't try very hard. There was (and is, I think) no template to create a new meson project, so I chose the Empty Project Type and added the source files afterwards. I hope this is clear. Please let me know if you have questions. Thank you for the detailed explanation, now I see what's happened. Also, it's a documentation (or at least a don't-use-it-that-way) issue. :D When you create the new project 'ex', it creates a new directory `test/ex/` as the project root. Because `test/junk.cpp` is outside that directory, it isn't part of the project. The "Classes" view only shows classes from open projects (my last comment "there's no case where..." was wrong...), so doesn't show those from `junk.cpp`. If you want to import a project with existing files, you shouldn't use "New from Template". Instead use "Open/Import Project" and select the existing directory -- if the buildsystem isn't supported, there will be a 'Custom Build System' option where you can enter the relevant configure/build commands manually. Resolving as no immediate bug -- we might want to consider adding classes from open non-project files to the toolview, and/or making sure the manual is clear. |