1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 01:15:29 +02:00

[263201] - patch applied for: In Problems view - move location of errors/warnings from Description column to Location

This commit is contained in:
Alena Laskavaia 2009-03-12 18:32:27 +00:00
parent b411c3d854
commit 3ab9cc8beb
3 changed files with 20 additions and 5 deletions

View file

@ -140,7 +140,6 @@ public class ErrorPattern {
if (file == null) {
// If the file is not found in the workspace we attach the problem to the project
// and add the external path to the file.
desc = fileName + " " + desc; //$NON-NLS-1$
file = eoParser.getProject();
externalPath = getLocation(fileName);
}
@ -162,7 +161,11 @@ public class ErrorPattern {
try {
cygpath = new CygPath("cygpath"); //$NON-NLS-1$
String cygfilename = cygpath.getFileName(filename);
path = new Path(cygfilename);
IPath convertedPath = new Path(cygfilename);
file = convertedPath.toFile() ;
if (file.exists()) {
path = convertedPath;
}
} catch (IOException e) {
}
finally {

View file

@ -21,6 +21,7 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Preferences;
import org.eclipse.osgi.util.NLS;
public abstract class ACBuilder extends IncrementalProjectBuilder implements IMarkerGenerator {
@ -53,13 +54,20 @@ public abstract class ACBuilder extends IncrementalProjectBuilder implements IMa
/*
* Try to find matching markers and don't put in duplicates
*/
String externalLocation = null;
if (problemMarkerInfo.externalPath != null) {
externalLocation = problemMarkerInfo.externalPath.toOSString();
}
if ((cur != null) && (cur.length > 0)) {
for (IMarker element : cur) {
int line = ((Integer) element.getAttribute(IMarker.LINE_NUMBER)).intValue();
int sev = ((Integer) element.getAttribute(IMarker.SEVERITY)).intValue();
String mesg = (String) element.getAttribute(IMarker.MESSAGE);
String extloc = (String) element.getAttribute(ICModelMarker.C_MODEL_MARKER_EXTERNAL_LOCATION);
if (line == problemMarkerInfo.lineNumber && sev == mapMarkerSeverity(problemMarkerInfo.severity) && mesg.equals(problemMarkerInfo.description)) {
return;
if (extloc==externalLocation || (extloc!=null && extloc.equals(externalLocation))) {
return;
}
}
}
}
@ -73,8 +81,11 @@ public abstract class ACBuilder extends IncrementalProjectBuilder implements IMa
if (problemMarkerInfo.variableName != null) {
marker.setAttribute(ICModelMarker.C_MODEL_MARKER_VARIABLE, problemMarkerInfo.variableName);
}
if (problemMarkerInfo.externalPath != null) {
marker.setAttribute(ICModelMarker.C_MODEL_MARKER_EXTERNAL_LOCATION, problemMarkerInfo.externalPath.toOSString());
if (externalLocation != null) {
marker.setAttribute(ICModelMarker.C_MODEL_MARKER_EXTERNAL_LOCATION, externalLocation);
String locationText = NLS.bind(CCorePlugin.getResourceString("ACBuilder.ProblemsView.Location"), //$NON-NLS-1$
problemMarkerInfo.lineNumber, externalLocation);
marker.setAttribute(IMarker.LOCATION, locationText);
}
}
catch (CoreException e) {

View file

@ -10,6 +10,7 @@
# Markus Schorn (Wind River Systems)
# Anton Leherbauer (Wind River Systems)
###############################################################################
ACBuilder.ProblemsView.Location=line {0}, external location: {1}
CBuilder.build_error= Build Error
CoreModel.BinaryRunner.Binary_Search_Thread=Searching for Binaries
CoreModel.CModelBuilder.Parser_Construction_Failure=Parser/Scanner construction failure.