diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileSourceConfiguration.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileSourceConfiguration.java index ad0e89fe6fa..0aecea3fe70 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileSourceConfiguration.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileSourceConfiguration.java @@ -176,6 +176,6 @@ public class MakefileSourceConfiguration extends SourceViewerConfiguration { * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getAnnotationHover(org.eclipse.jface.text.source.ISourceViewer) */ public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) { - return new MakefileAnnotationHover(); + return new MakefileAnnotationHover(fEditor); } } diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/WordPartDetector.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/WordPartDetector.java index d5c80b9abbb..d23964ba4e3 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/WordPartDetector.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/WordPartDetector.java @@ -1,12 +1,14 @@ -/* - * "The Java Developer's Guide to Eclipse" - * by Shavor, D'Anjou, Fairbrother, Kehn, Kellerman, McCarthy - * - * (C) Copyright International Business Machines Corporation, 2003. - * All Rights Reserved. - * - * Code or samples provided herein are provided without warranty of any kind. - */ +/********************************************************************** + * Copyright (c) 2002,2003 QNX Software Systems and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v10.html + * + * Contributors: + * QNX Software Systems - Initial API and implementation +***********************************************************************/ + package org.eclipse.cdt.make.internal.ui.text; import org.eclipse.jface.text.BadLocationException; @@ -72,7 +74,6 @@ public class WordPartDetector { /** - * Method getString. * @return String */ public String toString() { diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileAnnotationHover.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileAnnotationHover.java index a9096990287..ca4423ac9a2 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileAnnotationHover.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileAnnotationHover.java @@ -11,11 +11,15 @@ package org.eclipse.cdt.make.internal.ui.text.makefile; +import org.eclipse.cdt.make.core.makefile.IMakefile; +import org.eclipse.cdt.make.internal.ui.MakeUIPlugin; +import org.eclipse.cdt.make.ui.IWorkingCopyManager; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.IRegion; import org.eclipse.jface.text.source.IAnnotationHover; import org.eclipse.jface.text.source.ISourceViewer; +import org.eclipse.ui.IEditorPart; /** * MakefileAnnotationHover @@ -23,11 +27,13 @@ import org.eclipse.jface.text.source.ISourceViewer; */ public class MakefileAnnotationHover implements IAnnotationHover { + private IEditorPart fEditor; + /** * */ - public MakefileAnnotationHover() { - super(); + public MakefileAnnotationHover(IEditorPart editor) { + fEditor = editor; } /* @@ -38,15 +44,19 @@ public class MakefileAnnotationHover implements IAnnotationHover { */ public String getHoverInfo(ISourceViewer sourceViewer, int lineNumber) { IDocument document = sourceViewer.getDocument(); - try { IRegion info = document.getLineInformation(lineNumber); - return document.get(info.getOffset(), info.getLength()); + String line = document.get(info.getOffset(), info.getLength()); + if (line != null && line.indexOf('$') != -1 && line.length() > 1) { + IWorkingCopyManager fManager = MakeUIPlugin.getDefault().getWorkingCopyManager(); + IMakefile makefile = fManager.getWorkingCopy(fEditor.getEditorInput()); + line = makefile.expandString(line); + return line; + } + return line; } catch (BadLocationException x) { } - return null; - } }