JSDT is under heavy reconstruction and we are making big and breaking
changes.
I think your best approach is to use
org.eclipse.wst.jsdt.ui.javaCompletionProposalComputer.
If you need access to AST we plan to only keep The DOM AST which lives
on org.eclipse.wst.jsdt.core.dom
namespace. You can use **.internal.ui.javaeditor.ASTProvider to retrieve
AST.
If you are targeting only Mars and earlier than I would guess your first
approach to work.
—
Gorkem
On 18 Apr 2016, at 19:01, Mathieu Larose wrote:
Hi all,
I'm writing a plugin based on JSDT and I would like to know what are
my options for content assist.
The issue is that the types are generated dynamically based on the
user's environment. For instance, I cannot generate files and add them
to the include path as it is done for system.js.
I tried the following extension points:
1. ASTProvider
I extended InferEngine and in the doInfer I add the types
(InferEngine.addType) to the current CompilationUnitDeclaration and
then call super.doInfer. Since I don't want to see the types in the
outline, I set them as anonymous.
This works for code completion, but not for text hover.
2. org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer
The include path seems to only accept JavaScript source files. So it's
not possible to execute arbitrary code that add types.
I think I can use
org.eclipse.wst.jsdt.ui.javaCompletionProposalComputer and
org.eclipse.wst.jsdt.ui.javaEditorTextHovers, but it means I need to
bring my own parser/type inference since I could not use
CompilationUnit.codeComplete and SelectionEngine.select.
Before trying this, I would like to know if I missed something. If
not, I would like to get your suggestions.
Any help is appreciated!
Thank you,
Mathieu Larose
_______________________________________________
wtp-dev mailing list
wtp-dev@eclipse.org
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/wtp-dev
_______________________________________________
wtp-dev mailing list
wtp-dev@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from
this list, visit
https://dev.eclipse.org/mailman/listinfo/wtp-dev