Proposed API change to IMessageHandler [message #578057] |
Tue, 24 August 2010 18:46 |
Adam Taylor Messages: 12 Registered: August 2010 |
Junior Member |
|
|
*** Problem: ***
Quick Fix support:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=323532
*** Diagnosis: ***
For some quickfixes additional information is needed (an error code for example) when creating IMarkers and Annotations.
*** Proposed IMP API change: ***
Add the following method:
public interface IMessageHandler{
// ...
void handleSimpleMessage(String msg, int startOffset, int endOffset,
int startCol, int endCol,
int startLine, int endLine, Map<String, Object> attributeMap);
// ...
}
Also since this is a breaking change to this API, I suggest that IMessageHandlerExtension is thrown out and its method be added to IMessageHandler as well
|
|
|
Re: Proposed API change to IMessageHandler [message #578075 is a reply to message #578057] |
Tue, 24 August 2010 19:11 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
Hi Adam
In my experience, functions with many arguments have many arguments
because there is a missing configuration/state object.
If you're breaking the API why not break it properly. Why are seven
attributes privileged while the rest are mapped? Surely severity,
source,... deserve to be privileged too? Why not allow derived
implementations to manage the representation to taste.
Generally at least one of startOffset or startLine/startCol is
redundant, ditto end... Putting them in the interface mandates that the
redundant one is calculated and that redundant state is propagated.
Regards
Ed Willink
On 24/08/2010 19:46, Adam Taylor wrote:
> *** Problem: ***
>
> Quick Fix support:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=323532
>
>
> *** Diagnosis: ***
>
> For some quickfixes additional information is needed (an error code for
> example) when creating IMarkers and Annotations.
>
> *** Proposed IMP API change: ***
>
> Add the following method:
>
> public interface IMessageHandler{
> // ...
>
> void handleSimpleMessage(String msg, int startOffset, int endOffset,
> int startCol, int endCol,
> int startLine, int endLine, Map<String, Object> attributeMap);
>
> // ...
> }
>
> Also since this is a breaking change to this API, I suggest that
> IMessageHandlerExtension is thrown out and its method be added to
> IMessageHandler as well
|
|
|
Powered by
FUDForum. Page generated in 0.02644 seconds