Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 320490 - [Linking] Resource#getWarnings not cleared before linking
Summary: [Linking] Resource#getWarnings not cleared before linking
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 1.0.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: SR1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-21 08:06 EDT by Sebastian Zarnekow CLA
Modified: 2017-09-19 15:59 EDT (History)
0 users

See Also:
sebastian.zarnekow: helios+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Zarnekow CLA 2010-07-21 08:06:29 EDT
I tried to change the unresolved reference diagnostic severity from error to warning.
Therefore I've overridden LinkingDiagnosticMessageProvider so that the created DiagnosticMessage's severity will be WARNING:

public class MyLinkingDiagnosticMessageProvider extends
        LinkingDiagnosticMessageProvider {
    
    public DiagnosticMessage getUnresolvedProxyMessage(ILinkingDiagnosticContext context) {
        EClass referenceType = context.getReference().getEReferenceType();
        String msg = "Couldn't resolve reference to " + referenceType.getName() + " '" + context.getLinkText() + "'.";
        // only change ERROR to WARNING
        //return new DiagnosticMessage(msg, DiagnosticSeverity.ERROR, Diagnostic.LINKING_DIAGNOSTIC);
        return new DiagnosticMessage(msg, DiagnosticSeverity.WARNING, Diagnostic.LINKING_DIAGNOSTIC);
    }
}
This works well except that the warning won't be removed anymore. When closing and reopening the file, all warnings are removed properly but not at "runtime". With severity level ERROR everything works fine.
Comment 1 Sebastian Zarnekow CLA 2010-07-21 10:52:06 EDT
Fixed in HEAD.
Comment 2 Karsten Thoms CLA 2017-09-19 15:59:20 EDT
Closing bug which were set to RESOLVED before Eclipse Neon.0.