Search in sources :

Example 1 with STPProbevarCompletionProposal

use of org.eclipse.linuxtools.internal.systemtap.ui.ide.editors.stp.proposals.STPProbevarCompletionProposal in project linuxtools by eclipse.

the class STPCompletionProcessor method getProbeVariableCompletions.

private ICompletionProposal[] getProbeVariableCompletions(IDocument document, int offset, String prefix) {
    try {
        String probeName = getProbe(document, offset);
        TreeNode[] completionData = stpMetadataSingleton.getProbeVariableCompletions(probeName, prefix);
        ICompletionProposal[] result = new ICompletionProposal[completionData.length];
        for (int i = 0; i < completionData.length; i++) {
            result[i] = new STPProbevarCompletionProposal(completionData[i], prefix.length(), offset, probeName);
        }
        return result;
    } catch (BadLocationException | BadPartitioningException e) {
        return NO_COMPLETIONS;
    }
}
Also used : BadPartitioningException(org.eclipse.jface.text.BadPartitioningException) TreeNode(org.eclipse.linuxtools.systemtap.structures.TreeNode) ICompletionProposal(org.eclipse.jface.text.contentassist.ICompletionProposal) STPProbevarCompletionProposal(org.eclipse.linuxtools.internal.systemtap.ui.ide.editors.stp.proposals.STPProbevarCompletionProposal) BadLocationException(org.eclipse.jface.text.BadLocationException)

Aggregations

BadLocationException (org.eclipse.jface.text.BadLocationException)1 BadPartitioningException (org.eclipse.jface.text.BadPartitioningException)1 ICompletionProposal (org.eclipse.jface.text.contentassist.ICompletionProposal)1 STPProbevarCompletionProposal (org.eclipse.linuxtools.internal.systemtap.ui.ide.editors.stp.proposals.STPProbevarCompletionProposal)1 TreeNode (org.eclipse.linuxtools.systemtap.structures.TreeNode)1