| Summary: | Opening declaration place from function information opens file from different project | ||
|---|---|---|---|
| Product: | [Applications] kdevelop | Reporter: | Jakub Caban <kuba> |
| Component: | Language Support: PHP | Assignee: | kdevelop-bugs-null |
| Status: | REPORTED --- | ||
| Severity: | normal | CC: | cyberbeat, mail, opi |
| Priority: | NOR | ||
| Version First Reported In: | git master | ||
| Target Milestone: | --- | ||
| Platform: | Gentoo Packages | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: | Patch trying to address this issue. | ||
|
Description
Jakub Caban
2013-02-11 15:30:24 UTC
It happens right now 100% times. It usually opens file from project on which I was previously working. But on clean instance of KDevelop it opens file from what looks like randomly chosen project from project folder. I can confirm this happening to me with KDevelop 4.5.1 and PHP 1.5.1 from stable sources as well, haven't tried git. Very troubling if you're using in-house frameworks or similarly named classes between projects, because code it also affects code completion and, if you're not vigilant, you may change files from unrelated projects. I wouldn't be surprises if bug 213747 is related to this. Created attachment 82526 [details]
Patch trying to address this issue.
Can someone of you try to apply the attached patch to kdev-php and see whether it helps with the problem?
It now prefers "nearby" declarations, meaning declarations where the path difference between $targetFile/.. and $potentialMatchFile/.. is shortest.
The project itself cannot be used here due to thread safety issues. The above should be nicer anyways I hope but of course can be just as wrong in some circumstances I'm afraid :(
I've just applied it and to try opened file at: ~/projects/project1/index.php than through declaration of class "Module" it got me to: ~/projects/project2/classes/module.php So no difference. Although maybe I should clear some kdev cache? If so, please tell me how :) Yep, just remove ~/cache/.kdevduchain or try the "reparse" button in the problem's toolview, just set the scope to all projects. OK - I did both, but unfortunately no go :( Situation: I opened Kdevelop after clearing cache and reparsed with scope "all projects". Project "project1" was opened, so as previously in: ~/projects/project1/index.php I've opened Module class declaration. It went well: ~/project/project1/classes/module.php But that I've closed project1 and opened project2 (in the same Kdevelop session) and in file: ~/projects/project2/index.php I tried again to open declaration of class Module. Ant it went to: ~/projects/project1/classes/module.php And so on - opening any declaration in project2 opens it from project1. I believe it may be somehow related to sessions handling in Kdevelop...? Hm are there openly accessible project which one may use to reproduce this issue and try to fix it? I've tried to create some lightweight test project, but anytime I try to create a few files one it simply works... Than when I switch to my framework it's no working once again :( Unfortunately I am not allowed to openly publish all framework, although I could send it privately to you for testing purposes, if that could help. Duplicate of Bug #284931 ? *** Bug 284931 has been marked as a duplicate of this bug. *** Thank you for the bug report. As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists. If this bug is no longer persisting or relevant please change the status to resolved. |