|JSDT: Dynamic Code Completion [message #989775]
||Fri, 07 December 2012 17:05
| Christoph Hausmann
Registered: December 2012
I have a question regarding the JSDT code completion. Basically, I want to have full control over the objects and methods offered in the code completion dialog. These objects and methods are not static, they are dynamically generated at runtime and should immediately appear within the code completion dialog.
Here is what I already tried:
(1) Using the 'org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer' extension point I added a custom library that contains the API, which should be available via code completion. However, this approach does not work for a "dynamic" API - if I change the library file at runtime, the changes are not reflected in the code completion.
(2) I used the 'org.eclipse.wst.jsdt.core.inferrenceSupport' extension point and implemented a custom InferenceProvider which returns an extension of the InferEngine that dynamically modifies the given CompilationUnitDeclaration and, e.g., adds an additional type. This type then afterwards appears in the code completion dialog, so it is basically working. However, there seems to be no API for adding additional variables. There is just CompilationUnitDeclaration.addType(...) and CompilationUnitDeclaration.addImport(...). And this approach also seems more like a hack to me.
(3) The last thing I tried was using the 'org.eclipse.wst.jsdt.ui.javaCompletionProposalComputer' extension point to provide a custom CompletionProposalComputer. But so far I am a bit lost there, so if this is the correct approach, I need some more hints on how to do this.
Powered by FUDForum
. Page generated in 0.01678 seconds