Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
marcinjunger opened this issue Nov 22, 2023 · 4 comments

Comments

@marcinjunger
Copy link

marcinjunger commented Nov 22, 2023

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

@marcinjunger marcinjunger changed the title xtext clean output - not removing all aoutput folders, if previous does not exists xtext clean output - not removing all output folders, if previous does not exists Nov 22, 2023
@szarnekow
Copy link
Contributor

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

@marcinjunger
Copy link
Author

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?

@tripleo1
Copy link

tripleo1 commented Nov 25, 2023 via email

@LorenzoBettini
Copy link
Contributor

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants