}
};
- protected final static String[] fgProposals = PHPCodeScanner.fgFunctionNames;
+ protected final static String[] fgProposals = PHPFunctionNames.FUNCTION_NAMES;
// {
// "array",
// "break",
//
// }
- // if (documentOffset > 0) {
- // try {
- // char character = document.getChar(documentOffset - 1);
- // if (character=='$') {
- //
- // }
- // result = new ICompletionProposal[fgProposals.length];
- // for (int i = 0; i < fgProposals.length; i++) {
- // IContextInformation info = new ContextInformation(fgProposals[i], MessageFormat.format(PHPEditorMessages.getString("CompletionProcessor.Proposal.ContextInfo.pattern"), new Object[] { fgProposals[i] })); //$NON-NLS-1$
- // result[i] = new CompletionProposal(fgProposals[i], documentOffset, 0, fgProposals[i].length(), null, fgProposals[i], info, MessageFormat.format(PHPEditorMessages.getString("CompletionProcessor.Proposal.hoverinfo.pattern"), new Object[] { fgProposals[i] })); //$NON-NLS-1$
- // }
- // } catch (BadLocationException e) {
- // }
- //
- // } else {
+ ArrayList arrList = new ArrayList(5);
+ IDocument document = viewer.getDocument();
+ if (documentOffset > 0) {
+ try {
+ ICompletionProposal[] result;
+ char character = document.getChar(documentOffset - 1);
+ if (character == '$') {
+//viewer. .getActivePage().getActiveEditor();
+ result = new ICompletionProposal[fgProposals.length];
+ for (int i = 0; i < fgProposals.length; i++) {
+ IContextInformation info = new ContextInformation(fgProposals[i], MessageFormat.format(PHPEditorMessages.getString("CompletionProcessor.Proposal.ContextInfo.pattern"), new Object[] { fgProposals[i] })); //$NON-NLS-1$
+ result[i] = new CompletionProposal(fgProposals[i], documentOffset, 0, fgProposals[i].length(), null, fgProposals[i], info, MessageFormat.format(PHPEditorMessages.getString("CompletionProcessor.Proposal.hoverinfo.pattern"), new Object[] { fgProposals[i] })); //$NON-NLS-1$
+ }
+ return result;
+ }
+ } catch (BadLocationException e) {
+ return new ICompletionProposal[0];
+ }
+ }
+
ICompletionProposal[] result = new ICompletionProposal[fgProposals.length];
for (int i = 0; i < fgProposals.length; i++) {
IContextInformation info = new ContextInformation(fgProposals[i], MessageFormat.format(PHPEditorMessages.getString("CompletionProcessor.Proposal.ContextInfo.pattern"), new Object[] { fgProposals[i] })); //$NON-NLS-1$