eclipse / xtext

Eclipse Xtext™ is a language development framework

Home Page:http://www.eclipse.org/Xtext

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

xtext clean output - not removing all output folders, if previous does not exists

marcinjunger opened this issue · comments

Hi,
I would like to report a possible bug. Please take a look at line 490 in org.eclipse.xtext.builder.BuilderParticipant -> cleanOutput(IBuildContext, OutputConfiguration, EclipseResourceFileSystemAccess2, IProgressMonitor)

This method removes output folders based on configuration: the general logic is:
for (IContainer container : getOutputs(project, config)) {
delete the output
}

The problem is with the following lines:
for (IContainer container : getOutputs(project, config)) {
if (!container.exists()) {
return;
}

It stops deleting on the first non-existing resource to be deleted. So, if getOuputs returns two folders, and both exists - both will be deleted. If the first one does not exists, but the second does - it will not be deleted.

I propose to change "return" into "continue" - this should fix the issue.
Kind regards
Marcin

Thank you for the analysis. Do you plan to create a pull request? That would be greatly appreciated.

Hi, no problem, tried to search for a guide how to do it, naming conventions etc... is there any? Should I check out the git repo (I am using sourcetree) locally, create locally a branch named eg. bugfix\issue2853, commit and push a fix, and then create pull request in sourcetree?

Hi, no problem, tried to search for a guide how to do it, naming conventions etc... is there any? Should I check out the git repo (I am using sourcetree) locally, create locally a branch named eg. bugfix\issue2853, commit and push a fix, and then create pull request in sourcetree?

@marcinjunger you might want to look at https://github.com/eclipse/xtext/blob/main/CONTRIBUTING.md in particular how to setup your Eclipse workspace (we use Oomph)