From 872a34e8118e88a9bc2043621de33fe23f72e7f4 Mon Sep 17 00:00:00 2001 From: Alain Magloire Date: Wed, 3 Nov 2004 14:56:52 +0000 Subject: [PATCH] 2004-11-02 Tanya Wolff Fixed content assist extensibility for 77482 - changed context condition for addProposalsFromCompletionContributors() & fixed cursor position * src/org/eclipse/cdt/internal/ui/text/contentassist/CCompletionProcessor.java --- core/org.eclipse.cdt.ui/ChangeLog | 5 +++++ .../internal/ui/text/contentassist/CCompletionProcessor.java | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/core/org.eclipse.cdt.ui/ChangeLog b/core/org.eclipse.cdt.ui/ChangeLog index edb789bc529..6abbb7783f9 100644 --- a/core/org.eclipse.cdt.ui/ChangeLog +++ b/core/org.eclipse.cdt.ui/ChangeLog @@ -1,3 +1,8 @@ +2004-11-02 Tanya Wolff + Fixed content assist extensibility for 77482 - changed context condition + for addProposalsFromCompletionContributors() & fixed cursor position + * src/org/eclipse/cdt/internal/ui/text/contentassist/CCompletionProcessor.java + 2004-11-01 Alain Magloire Patch from Mikhail Voronin to implement 71240. Too many changes to enumerate refer to PR: diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CCompletionProcessor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CCompletionProcessor.java index a084f4392ec..f7913e5bf91 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CCompletionProcessor.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CCompletionProcessor.java @@ -445,8 +445,7 @@ public class CCompletionProcessor implements IContentAssistProcessor { int length = prefix.length(); // calling functions should happen only within the context of a code body - if( (completionNode.getCompletionContext() != IASTCompletionNode.CompletionKind.SINGLE_NAME_REFERENCE) - && (completionNode.getCompletionContext() != IASTCompletionNode.CompletionKind.SINGLE_NAME_REFERENCE)) + if (completionNode.getCompletionContext() != null) return; IFunctionSummary[] summary; @@ -487,6 +486,8 @@ public class CCompletionProcessor implements IContentAssistProcessor { if(fargs != null && fargs.length() > 0) { proposal.setContextInformation(new ContextInformation(fname, fargs)); + // set the cursor before the closing bracket + proposal.setCursorPosition(fname.length() - 1); } completions.add(proposal);