I am writing eclipse plugin to add better support for properties files. One of the missing piece is content-assist ... I'd like to show matching properties keys when user starts typing some string and presses content assist key.
For example, when I have property hello = world
in one of my properties files, and I start typing format("hel
and hit CTRL+SPACE now, I'd like to see available hello
property.
My problem is that I cannot find correct extension point to provide custom content assist processor. How can I provide my own content assist processor for text files? I'd like to make it work mainly in Java, JSP and XML files.
Extensions and extension points. Eclipse provides the concept of extensions to contribute functionality to a certain type of API. The type of API is defined by a plug-in via an extension point . Extensions can be contribute by one or more plug-ins.
Switch to the Extensions tab and select Add… . Select your custom extension point and press the Finish button. Add a client to your extension point via right-click. Create the GreeterGerman class with the following code.
Within an editor, content assist helps reduce the characters typed by providing a context sensitive list of possible completions to the characters already typed. The context assist can be invoked by clicking Ctrl + Space.
The plug-in which defines the extension point is also responsible for evaluating the extensions. Therefore, it typically contains the necessary code to do that. This plug-in provides an extension (contribution) based on the contract defined by an existing extension point. Contributions can be code or data. 3. Creating an extension point
You can do it by declaring an extension to:
org.eclipse.jdt.ui.javaCompletionProposalComputer
Here is the reference page to start with.
You can find a demo project here
I've looked for such an extension point before with no success. As far as I know it's not possible to add new types of content assist to editors in Eclipse in this way.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With