/*******************************************************************************
- * Copyright (c) 2000, 2001, 2002 International Business Machines Corp. and others.
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v0.5
+ * 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-v05.html
+ * http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
- ******************************************************************************/
+ *******************************************************************************/
package net.sourceforge.phpdt.internal.compiler.problem;
import net.sourceforge.phpdt.core.compiler.IProblem;
-import net.sourceforge.phpdt.internal.compiler.env.ICompilationUnit;
import net.sourceforge.phpdt.internal.compiler.util.Util;
+import org.eclipse.ui.texteditor.ITextEditor;
+
+
public class DefaultProblem implements ProblemSeverities, IProblem {
private char[] fileName;
this.line = line;
}
- public String errorReportSource(ICompilationUnit compilationUnit) {
+ public String errorReportSource(ITextEditor textEditor){ //ICompilationUnit compilationUnit) {
//extra from the source the innacurate token
//and "highlight" it using some underneath ^^^^^
//put some context around too.
final char SPACE = '\u0020';
final char MARK = '^';
final char TAB = '\t';
- char[] source = compilationUnit.getContents();
+// char[] source = compilationUnit.getContents();
+ char[] source = textEditor.getDocumentProvider().getDocument(null).get().toCharArray();
//the next code tries to underline the token.....
//it assumes (for a good display) that token source does not
//contain any \r \n. This is false on statements !
}
return s;
}
-}
\ No newline at end of file
+}