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

Bug 331669

Summary: [assist] Autocompletion on base keyword within static callin missing
Product: [Tools] Objectteams Reporter: Jan Marc Hoffmann <exelnet>
Component: OTDTAssignee: Stephan Herrmann <stephan.herrmann>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: P3    
Version: 0.7.1   
Target Milestone: 0.8 M4   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
test & fix none

Description Jan Marc Hoffmann CLA 2010-12-02 09:11:57 EST
If a static callin is used, the usual autocompletion on base isn't working.

public team class SelectionAdapter {
	
	@SuppressWarnings("restriction")
	protected class GOTWordFinder playedBy JavaWordFinder {
		IRegion findWord(IDocument document, int offset) <- replace IRegion findWord(IDocument document, int offset);
		
		static callin IRegion findWord(IDocument document, int offset) {
			base. // <-- findWord should be available here.
			return null;
		}
	}
}

greetings

Jan Marc
Comment 1 Stephan Herrmann CLA 2010-12-05 08:43:37 EST
Created attachment 184553 [details]
test & fix

I could reproduce by combining two factors:
 - methods are static
 - base call is used as a statement (ignoring the result)

New test is ...otdt...CodeCompletionTest.testCompleteBasecall2()

The bug happened because CompletionOnMemberAccess.resolveType(..)
could not resolve the receiver ('base').
Fixed by better resolving of a base reference in a static context.
Comment 2 Stephan Herrmann CLA 2010-12-05 09:46:23 EST
Fix was committed as r1127 f.
Comment 3 Stephan Herrmann CLA 2010-12-16 15:30:43 EST
Verified for M4 using build 201012150343