eclipse-platform / eclipse.platform.ui

Eclipse Platform
https://projects.eclipse.org/projects/eclipse.platform
Eclipse Public License 2.0
79 stars 168 forks source link

Working Sets flakey, opening files from wrong projects, Window Working Sets not honoured #1082

Open radsdau opened 1 year ago

radsdau commented 1 year ago

Using Eclipse 4.27.0 as STM32CubeIDE 1.13.1, CDT 11.1.1

Workspace contains several projects using shared C code. Typically I will set Window Working Set to just the project I'm working on, and use that in multiple places (open files context, search, etc).

One recently reprocible 'bad' case is as follows:

In other instances, Window Working Sets opens files from the wrong working set. For instance:

These have been relatively long standing issues.

mickaelistria commented 1 year ago

The strategy is usually that the UI here opens the "most nested" variant of the file (if none is open as editor), so if you have a hierarchy such as

and try to open File.c from open resoures or search, then it will open File.c as child of ProjectB project rather than ProjectB(as a folder)/File.c child of ProjectA. This is usually the desired behavior as the nested project is more specialized than its parent. In the "Open Resources" dialog, you can uncheck the "Filter Duplicate Resources" to make sure both "pointers" would be displayed and choose the one you want.

It could be that working sets are not checked when resolving which particular file to prefer. A Pull Request to fix that would be welcome.

radsdau commented 12 months ago

It could be that working sets are not checked when resolving which particular file to prefer. A Pull Request to fix that would be welcome.

Thanks Mick, appreciate the response. I don't have nested projects so I don't think that's the issue. But I have observed that certain projects appear to work normally; perhaps they're the ones positioned further up the Project Explorer list. The search results do follow the working sets setting, but resolving the right file is often wrong, so probably as you said. I doubt I'll be able to contribute to the code- my day job prevents it. Anyone who has this set up ready to go, please, be my guest.

radsdau commented 10 months ago

I'm not really sure what to do to get this in front of the dev team most likely to fix it. I'm grappling with it multiple times a day and it is very frustrating. Please, if anyone who can increase the visibility of this bug so it can get nailed, I'd be grateful. Happy to work with devs to test etc.

laeubi commented 10 months ago

I'm not really sure what to do to get this in front of the dev team most likely to fix it

There is no "dev team" only mostly volunteers that do that in their free time and some companies that share their dev teams what have their own priorities.

it seems this is not really something the usual committer/contributors encounter and thus handled with very low priority, if this is crucial to your business and likes to speed up the development you can contact me to enter a contract about this specific issue or if you need dedicated enterprise support.

I'm grappling with it multiple times a day and it is very frustrating.

So if it is affecting your day work you maybe want to rethink if "I doubt I'll be able to contribute to the code- my day job prevents it" still applies of course a PR to fix the problem would also be welcome, see the contribution guides here and if Eclipse is an important Technology for you you maybe even want to join the Eclipse IDE Workingroup that also regularly funds development in critical areas or consider a funding to improve Eclipse IDE in general.

The very first step would be to at least contribute a test-case that shows the problem. Guessing with hypothetical A and B projects and C files on special Eclipse Packages is really hard and soon leads to work assumptions as @mickaelistria guessed its a problem of hierarchy projects.

radsdau commented 10 months ago

Thanks Chris. It's helpful to be aware of the general situation. I'm happy to nut out the bug, but the learning curve is pretty significant to modify what is probably a 10 minute fix for someone who is 'set up'. Time permitting, I'll attempt to get a test case up. Thanks also for the links. Cheers

radsdau commented 9 months ago

Demo projects set up and bug replicable. Please see video for example. Workspace Temp.zip https://github.com/eclipse-platform/eclipse.platform.ui/assets/2086915/7a95da5b-277f-443a-af65-a1e384b24488

radsdau commented 7 months ago

I've posted this in the STM32CubeIDE forums also. https://community.st.com/t5/stm32cubeide-mcus/double-click-search-results-jumps-to-the-right-file-in-the-wrong/td-p/637222 Still an issue. I battle it multiple times daily.