Bug 498139 - Refresh problems if a file is modified or deleted outside Eclipse
Summary: Refresh problems if a file is modified or deleted outside Eclipse
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: titan.plugins (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-19 09:38 EDT by Jeno Attila Balasko CLA
Modified: 2021-04-23 10:57 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeno Attila Balasko CLA 2016-07-19 09:38:57 EDT
If a ttcn file handled in Eclipse Designer is removed or modified the change is not handled correctly. Perhaps it requires two bug report.

1. If a file is removed. Gustavo Gonnet from Ericsson described the problem:
Hi,

This is an issue that I was not able to pinpoint for quite a long time (perhaps years).

This is what I observe:
- I have Eclipse open with a titan project open (in reality I have 3 projects opened, they depend on each other but hopefully this does not matter)
- I delete a file from the filesystem manually - outside Eclipse. This can be done by manually deleting the file or by doing a git pull in the repo of my test FW (and the file was removed by one of my colleagues)
- I come back to Eclipse, I see that the Project Explorer inside eclipse refreshes automatically after few seconds and the file is gone.
- I try to compile, I the compilation fails because the just deleted file is missing from the filesystem
- my way out today is to close eclipse, delete the offending Makefile, reopen and build - this fixes the issue. Now that I think of it, probably a project -> clean would fix it too (haven't tried this)

My opinion on why the build fails:
The file that was just deleted is still present in the Makefile

Proposed solution (very simplified!):
Once there is a change in the Project Explorer content, the code in the plugin that creates the makefile has to refresh the makefile with the ttcn files present in the project right at the time of the build.

I do not require a fix (in case this bug really is one) but it would be nice for other users to have this fixed if it's possible.
Hope my description helps, and thank you,
Gustavo.

2. If the file modified outside Eclipse, and the file is opened after that, the Designer recognizes the change and requires pushing F5 to refresh the file. After refreshing the error markers are not refreshed in the editor window.
Comment 1 Kristof Szabados CLA 2017-05-04 06:31:24 EDT
Hi, this is multiple issues/behaviours.

1)
Eclipse takes some time to recognize that the content of the project was changed out side of eclipse.

In general this is an eclipse behaviour ( I guess eclipse developers did not wish to overload the system with checking for external modifications).
But once the removal of the file is reported the designer should react to it.

This is itself can be solved by manually invoking the "refresh" action on the project, which asks eclipse to check for external changes. And in turn should result in eclipse notifying the designer plugin.

Also it is recommended to use eclipse plugins when working with eclipse resources as they are most of the time well integrated.
For example eclipse has internal git support, which notifies the plugins of file changes ... and also uses syntax coloring when displaying differences between file versions.

2)
The designer can be configured to automate the refreshing of the Makefile, or let the user manually refresh it.

It is recommended to let the designer automatically handle it (and to let the designer's internal Makefile generator do this as it is more efficient than calling the command line one)
Comment 2 Denis Roy CLA 2021-04-23 10:57:49 EDT
This bug was migrated to GitLab: https://gitlab.eclipse.org/eclipse/titan/titan.EclipsePlug-ins/-/issues