Implementing completion popups

Your derived instance of SideKickParser can implement additional methods to tell Sidekick that your parser supports completions.

        /* @return true if plugin supports completion */
        public boolean supportsCompletion();
        /* @return true if we show completions after a period of inactivity. */
    public boolean canCompleteAnywhere() ;
        /* @return a list of characters which trigger completion immediately. */
    public String getInstantCompletionTriggers();


        /* @return all completions at a given caret position for this
        editpane */
        public SideKickCompletion complete(EditPane editPane, int caret)
      

If your SideKickParser does support completion, the actual brains of the plugin goes in the last method, complete(), which must construct an instance of SideKickCompletion, given an EditPane and a caret position.

The constructor for SideKickCompletion accepts a list (or array) of possible values, these are the values that are displayed in the dropdown. This is an abstract class, so you'll need to derive a specific implementation. You may want to override the 'insert(int)' method to support language specifics, like "dot" completion.

How you actually create the completion depends on the specific language and support classes, and the information provided by the parser for the current file.