How to create a ITypeBinding from the fully qualified type name.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to create a ITypeBinding from the fully qualified type name.

Gayan Perera
I'm working on a CodeCompletionComputer where i would like to get the org.eclipse.jdt.core.CompletionContext.getExpectedTypesSignatures() converted to a ITypeBinding. I required a ITypeBinding since i want the generic type parameters which is not available in org.eclipse.jdt.ui.text.java.JavaContentAssistInvocationContext.getExpectedType().
Is there any helper methods in JDT which i can use to get the ITypeBinding which contains generic type parameters ?

Br,
Gayan.


_______________________________________________
jdt-dev mailing list
[hidden email]
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jdt-dev
Reply | Threaded
Open this post in threaded view
|

Re: How to create a ITypeBinding from the fully qualified type name.

stephan.herrmann
The canonical answer would be to consult the FAQ near
https://wiki.eclipse.org/JDT/FAQ#From_an_IJavaElement_to_an_IBinding

But I think there's a better way: avoid getExpectedTypesSignatures() in favor of
getExpectedTypesKeys(). If you look for clients of that method, you'll
immediately see how to get ITypeBindings from that.

HTH,
Stephan

On 12.04.20 13:59, Gayan Perera wrote:

> I'm working on a CodeCompletionComputer where i would like to get
> the org.eclipse.jdt.core.CompletionContext.getExpectedTypesSignatures()
> converted to a ITypeBinding. I required a ITypeBinding since i want the generic
> type parameters which is not available
> in org.eclipse.jdt.ui.text.java.JavaContentAssistInvocationContext.getExpectedType().
> Is there any helper methods in JDT which i can use to get the ITypeBinding which
> contains generic type parameters ?
>
> Br,
> Gayan.
>
>
> _______________________________________________
> jdt-dev mailing list
> [hidden email]
> To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jdt-dev
>

_______________________________________________
jdt-dev mailing list
[hidden email]
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jdt-dev