Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 316445

Summary: Markers are not updated for read-only files during clean/full build
Product: [Modeling] TMF Reporter: germund <germund>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: clay, johannes.stelzer, mirko, sebastian.zarnekow, smit27589, stephane, sven.efftinge
Version: unspecifiedFlags: sebastian.zarnekow: indigo+
Target Milestone: SR1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description germund CLA 2010-06-10 07:35:46 EDT
Build Identifier: 20100218-1602

Building/cleaning a project won't update (add or remove) markers for files that are read-only. Spawning the Xtext validation manually however does this.


Reproducible: Always

Steps to Reproduce:
1. Turn off auto build
2. Create a general project, paste into it a file with contents that will yield an Xtext resource, and that also should contain some errors/warnings when built/validated.
3. Set the file to read-only.
4. Clean the project and notice that no markers are created.
5. Disable the read-only flag again.
6. Clean the project and notice that the markers get created.
Comment 1 Sven Efftinge CLA 2010-06-10 07:50:33 EDT
That's intended behavior. The rational (besides that we have a similar behavior in JDT) is that you can't do anything about it (i.e. fix them) and also the markers API is not available for non workspace resources like jar entries for instance.
Comment 2 germund CLA 2010-06-10 11:47:02 EDT
(In reply to comment #1)
> That's intended behavior. The rational (besides that we have a similar behavior
> in JDT) is that you can't do anything about it (i.e. fix them) and also the
> markers API is not available for non workspace resources like jar entries for
> instance.

Ok, thanks for the clarification. A different rationale for open (read-only) documents then.
Comment 3 Sven Efftinge CLA 2010-06-10 14:20:56 EDT
Yes.
Comment 4 Smit CLA 2011-07-18 15:29:52 EDT
Many version control systems such as Perforce,Clearcase mark files that are not checked out as read only.
So the intended behaviour according to you has caused me lot of problems and basically we need to change that condition (!file.isReadonly())
Comment 5 Sebastian Zarnekow CLA 2011-07-18 15:34:21 EDT
See last comment.

We should have a second look at this issue.
Comment 6 Mirko Raner CLA 2011-07-27 20:26:42 EDT
Another person has added a similar comment to the corresponding forum thread (http://www.eclipse.org/forums/index.php/t/207688/#msg_702462) on 07/26/2011.
I think it is high time that this issue is addressed. The original rationale seems flawed to me, because developers can actually do something about errors in write-protected resources, namely they can check out the file out of source control and fix the problem (or just remove the write lock manually). But even for files that are not currently writable, developers would want to know if they contain any problems. IMHO, the fact that a file is read-only does not imply that I don't care about any errors in that file.
Comment 7 Sebastian Zarnekow CLA 2011-07-29 03:53:48 EDT
Removed the dependency to bug 351963 since the readonly issue affects all languages (even those, that you cannot manipulate, e.g. Xtext, Xtend, mwe2).
Comment 8 Sebastian Zarnekow CLA 2011-07-31 08:40:05 EDT
Pushed to master.
Comment 9 Mirko Raner CLA 2011-08-01 12:27:34 EDT
Thanks for fixing this! :-)
Comment 10 Holger Schill CLA 2011-09-14 08:30:17 EDT
*** Bug 342875 has been marked as a duplicate of this bug. ***
Comment 11 Karsten Thoms CLA 2017-09-19 17:56:10 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 12 Karsten Thoms CLA 2017-09-19 18:06:54 EDT
Closing all bugs that were set to RESOLVED before Neon.0