Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 331669 - [assist] Autocompletion on base keyword within static callin missing
Summary: [assist] Autocompletion on base keyword within static callin missing
Status: VERIFIED FIXED
Alias: None
Product: Objectteams
Classification: Tools
Component: OTDT (show other bugs)
Version: 0.7.1   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: 0.8 M4   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-02 09:11 EST by Jan Marc Hoffmann CLA
Modified: 2010-12-16 15:30 EST (History)
0 users

See Also:


Attachments
test & fix (2.76 KB, patch)
2010-12-05 08:43 EST, Stephan Herrmann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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