diff options
author | Alain Magloire | 2004-12-14 22:29:22 +0000 |
---|---|---|
committer | Alain Magloire | 2004-12-14 22:29:22 +0000 |
commit | ed57ae9e444ecd6f2c9457229c85d767ea391c7c (patch) | |
tree | c8f784659ba6c91e5f46b52ff0c4ca314bb977ff /build | |
parent | b5b9cb7f7dcc1c3c0105592033c46abb242075ca (diff) | |
download | org.eclipse.cdt-ed57ae9e444ecd6f2c9457229c85d767ea391c7c.tar.gz org.eclipse.cdt-ed57ae9e444ecd6f2c9457229c85d767ea391c7c.tar.xz org.eclipse.cdt-ed57ae9e444ecd6f2c9457229c85d767ea391c7c.zip |
Fix for PR 81007
Diffstat (limited to 'build')
-rw-r--r-- | build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileTextHover.java | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileTextHover.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileTextHover.java index b1c61a40e1e..babfd03cd9a 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileTextHover.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MakefileTextHover.java @@ -54,31 +54,33 @@ public class MakefileTextHover implements ITextHover { if (fEditor != null && len > -1) { IWorkingCopyManager fManager = MakeUIPlugin.getDefault().getWorkingCopyManager(); IMakefile makefile = fManager.getWorkingCopy(fEditor.getEditorInput()); - WordPartDetector wordPart = new WordPartDetector(textViewer, offset); - String name = wordPart.toString(); - IMacroDefinition[] statements = null; - if (WordPartDetector.inMacro(textViewer, offset)) { - statements = makefile.getMacroDefinitions(name); - if (statements == null || statements.length == 0) { - statements = makefile.getBuiltinMacroDefinitions(name); + if (makefile != null) { + WordPartDetector wordPart = new WordPartDetector(textViewer, offset); + String name = wordPart.toString(); + IMacroDefinition[] statements = null; + if (WordPartDetector.inMacro(textViewer, offset)) { + statements = makefile.getMacroDefinitions(name); + if (statements == null || statements.length == 0) { + statements = makefile.getBuiltinMacroDefinitions(name); + } } - } - - if (statements == null) { - statements = new IMacroDefinition[0]; - } - // iterate over all the different categories - StringBuffer buffer = new StringBuffer(); - for (int i = 0; i < statements.length; i++) { - if (i > 0) { - buffer.append("\n"); //$NON-NLS-1$ + + if (statements == null) { + statements = new IMacroDefinition[0]; + } + // iterate over all the different categories + StringBuffer buffer = new StringBuffer(); + for (int i = 0; i < statements.length; i++) { + if (i > 0) { + buffer.append("\n"); //$NON-NLS-1$ + } + String infoString = statements[i].getValue().toString(); + buffer.append(name); + buffer.append(" - "); //$NON-NLS-1$ + buffer.append(infoString); } - String infoString = statements[i].getValue().toString(); - buffer.append(name); - buffer.append(" - "); //$NON-NLS-1$ - buffer.append(infoString); + return buffer.toString(); } - return buffer.toString(); } } catch (BadLocationException e) { } |