Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 312111 - [content assist] [api] StructuredContentAssistProcessor#CompletionListener#assistSessionEnded always skipped
Summary: [content assist] [api] StructuredContentAssistProcessor#CompletionListener#as...
Status: RESOLVED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.sse (show other bugs)
Version: 3.2   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.2 RC1   Edit
Assignee: Ian Tewksbury CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-07 14:45 EDT by Ian Tewksbury CLA
Modified: 2010-05-10 15:23 EDT (History)
1 user (show)

See Also:
nsand.dev: review+
thatnitind: review+


Attachments
Fix Patch (1.43 KB, patch)
2010-05-07 14:47 EDT, Ian Tewksbury CLA
nsand.dev: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Tewksbury CLA 2010-05-07 14:45:03 EDT
StructuredContentAssistProcessor#CompletionListener#assistSessionEnded is always being skipped right now because it starts with the following statement:

event.processor == StructuredContentAssistProcessor.this

This would be fine except in SSE the StructuredContentAssistProcessor is always a child of a CompoundContentAssistProcessor and thus that statement fails.

Ironically enough StructuredContentAssistProcessor#CompletionListener#assistSessionStarted already has the correct if check of:

if (event.processor == StructuredContentAssistProcessor.this ||
					(event.processor instanceof CompoundContentAssistProcessor &&
							((CompoundContentAssistProcessor)event.processor).containsProcessor(StructuredContentAssistProcessor.this))) {

This most likly happned because none of the SSE code takes advantage of ICompletionProposalComputer#sessionEnded so the issue was never noticed there like it was in ICompletionProposalComputer#sessionStarted.

Because of this bug anyone who implements ICompletionProposalComputer will never have their #sessionEnded method called.

Fix is simple, use the same if statment in #assistSessionEnded as in #assistSessionStarted.
Comment 1 Ian Tewksbury CLA 2010-05-07 14:47:09 EDT
Created attachment 167534 [details]
Fix Patch

Fix as described in the description.  This fix really should go into WTP 3.2 otherwise any adopter of the new content assist framework will not be able to take advantage of the ICompletionProposalComputer#sessionEnded method.
Comment 2 Nick Sandonato CLA 2010-05-10 14:27:20 EDT
Looks good to me.