Bug 3197 - DCR - OpenOnSelection - Code resolve doesn't work on declarations (1G0UX9V)
Summary: DCR - OpenOnSelection - Code resolve doesn't work on declarations (1G0UX9V)
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 2.0 M1   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 3223 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-10-10 22:51 EDT by Dirk Baeumer CLA
Modified: 2002-01-11 09:04 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Baeumer CLA 2001-10-10 22:51:08 EDT
Consider the following code:

	class X {
		public void foo() {
		}
	}

	Passing the text range of "foo" to code resolve doesn't report any results. Selecting X works as
	expected.

NOTES:

DB (9/7/00 5:53:22 PM)
	Code resolve doesn't work for field declarations too. Test code:

	package test;

	public class FieldTest {

		public Object fObject;
	
		public void f() {
			fObject= null;
		}
	}

	Passing the text range of fObject to code resolve doesn't report any results.

PM (9/8/00 8:59:48 AM)
	I do not clearly see the benefit of using it there ? You are already inside the code you want to open onto...

DB (11.09.2000 14:14:17)
	Currently we are using code resolve to "convert" a text selection into a Java Element. Since code resolve 
	can be used for references and for type declarations it would be good if it would work for field and method
	declarations too. This would avoid code like this:

	IJavaElement[] elements= resolve.codeResolve(ts.getStartPosition(), ts.getEndPosition(), null);
	if (elements.length == 0) {
		// try a declaration
		IJavaElement element= cu.getElementAt(start);
		ISourceRange range= element.getNameRange();
		check if range in text selection.
	}

PM (11/6/00 12:13:59 PM)
	Defer post Nov.15
Comment 1 Philipe Mulet CLA 2001-10-12 06:07:48 EDT
Duplicate of 1G2NZVT
Comment 2 Philipe Mulet CLA 2001-10-12 06:25:04 EDT
*** Bug 3223 has been marked as a duplicate of this bug. ***