diff --git a/core/org.eclipse.cdt.core/parser/ChangeLog-parser b/core/org.eclipse.cdt.core/parser/ChangeLog-parser index f0871f8b0f7..b9c2cc03ee4 100644 --- a/core/org.eclipse.cdt.core/parser/ChangeLog-parser +++ b/core/org.eclipse.cdt.core/parser/ChangeLog-parser @@ -1,3 +1,6 @@ +2003-12-31 Hoda Amer + - Changed ASTUtil.getType to include parameter initializer clause in returned string. + 2003-12-22 Hoda Amer Content Assist Work : Returned the results size of the IASTNode lookup to help in determining the scope relevance diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/util/ASTUtil.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/util/ASTUtil.java index 84789ade26a..04cced9ba18 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/util/ASTUtil.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/util/ASTUtil.java @@ -18,7 +18,9 @@ import org.eclipse.cdt.core.parser.ast.ASTClassKind; import org.eclipse.cdt.core.parser.ast.ASTPointerOperator; import org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration; import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier; +import org.eclipse.cdt.core.parser.ast.IASTExpression; import org.eclipse.cdt.core.parser.ast.IASTFunction; +import org.eclipse.cdt.core.parser.ast.IASTInitializerClause; import org.eclipse.cdt.core.parser.ast.IASTParameterDeclaration; import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier; import org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration; @@ -89,9 +91,27 @@ public class ASTUtil { type.append(getArrayQualifiers(declaration)); type.append(getPointerToFunctionType(declaration)); + if (declaration instanceof IASTParameterDeclaration) + type.append(getInitializerClause((IASTParameterDeclaration)declaration)); return type.toString(); } + public static String getInitializerClause(IASTParameterDeclaration declaration){ + StringBuffer initializer = new StringBuffer(); + if(declaration != null){ + IASTInitializerClause clause = declaration.getDefaultValue(); + if(clause != null){ + IASTExpression expression = clause.getAssigmentExpression(); + if(expression != null){ + String literal = expression.getLiteralString(); + if(literal.length() > 0) + initializer.append("="); + initializer.append(literal); + } + } + } + return initializer.toString(); + } public static String getPointerToFunctionType(IASTAbstractDeclaration declaration){ StringBuffer type = new StringBuffer(); ASTPointerOperator po = declaration.getPointerToFunctionOperator(); diff --git a/core/org.eclipse.cdt.ui/ChangeLog b/core/org.eclipse.cdt.ui/ChangeLog index 34d9a02a493..a5a06b6c18a 100644 --- a/core/org.eclipse.cdt.ui/ChangeLog +++ b/core/org.eclipse.cdt.ui/ChangeLog @@ -1,4 +1,7 @@ -2003-12-20 Hoda Amer +2003-12-31 Hoda Amer + Displayed "No Completions Found" message in status bar + +2003-12-30 Hoda Amer - Fix for bug#44359: Content Assist: foo(void) does not require args to be filled - Fix for bug#44378: Content Assist: easy keyboard exit of argument-providing mode diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java index 7e8516bfa5e..1fd849d4944 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java @@ -85,6 +85,7 @@ import org.eclipse.ui.texteditor.ContentAssistAction; import org.eclipse.ui.texteditor.DefaultMarkerAnnotationAccess; import org.eclipse.ui.texteditor.DefaultRangeIndicator; import org.eclipse.ui.texteditor.ExtendedTextEditorPreferenceConstants; +import org.eclipse.ui.texteditor.IEditorStatusLine; import org.eclipse.ui.texteditor.ITextEditorActionConstants; import org.eclipse.ui.texteditor.MarkerAnnotation; import org.eclipse.ui.texteditor.MarkerAnnotationPreferences; @@ -763,7 +764,12 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IS if (getTextWidget() == null) { return; } - + switch (operation) { + case CONTENTASSIST_PROPOSALS: + String msg= fContentAssistant.showPossibleCompletions(); + setStatusLineErrorMessage(msg); + return; + } super.doOperation(operation); } @@ -921,4 +927,15 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IS sourceViewer.invalidateTextPresentation(); } } + + /** + * Sets the given message as error message to this editor's status line. + * + * @param msg message to be set + */ + protected void setStatusLineErrorMessage(String msg) { + IEditorStatusLine statusLine= (IEditorStatusLine) getAdapter(IEditorStatusLine.class); + if (statusLine != null) + statusLine.setMessage(true, msg, null); + } }