mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 14:55:41 +02:00
[263201] - patch applied for: In Problems view - move location of errors/warnings from Description column to Location
This commit is contained in:
parent
b411c3d854
commit
3ab9cc8beb
3 changed files with 20 additions and 5 deletions
|
@ -140,7 +140,6 @@ public class ErrorPattern {
|
||||||
if (file == null) {
|
if (file == null) {
|
||||||
// If the file is not found in the workspace we attach the problem to the project
|
// If the file is not found in the workspace we attach the problem to the project
|
||||||
// and add the external path to the file.
|
// and add the external path to the file.
|
||||||
desc = fileName + " " + desc; //$NON-NLS-1$
|
|
||||||
file = eoParser.getProject();
|
file = eoParser.getProject();
|
||||||
externalPath = getLocation(fileName);
|
externalPath = getLocation(fileName);
|
||||||
}
|
}
|
||||||
|
@ -162,7 +161,11 @@ public class ErrorPattern {
|
||||||
try {
|
try {
|
||||||
cygpath = new CygPath("cygpath"); //$NON-NLS-1$
|
cygpath = new CygPath("cygpath"); //$NON-NLS-1$
|
||||||
String cygfilename = cygpath.getFileName(filename);
|
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) {
|
} catch (IOException e) {
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
|
|
|
@ -21,6 +21,7 @@ import org.eclipse.core.resources.IResource;
|
||||||
import org.eclipse.core.resources.IncrementalProjectBuilder;
|
import org.eclipse.core.resources.IncrementalProjectBuilder;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.Preferences;
|
import org.eclipse.core.runtime.Preferences;
|
||||||
|
import org.eclipse.osgi.util.NLS;
|
||||||
|
|
||||||
public abstract class ACBuilder extends IncrementalProjectBuilder implements IMarkerGenerator {
|
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
|
* 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)) {
|
if ((cur != null) && (cur.length > 0)) {
|
||||||
for (IMarker element : cur) {
|
for (IMarker element : cur) {
|
||||||
int line = ((Integer) element.getAttribute(IMarker.LINE_NUMBER)).intValue();
|
int line = ((Integer) element.getAttribute(IMarker.LINE_NUMBER)).intValue();
|
||||||
int sev = ((Integer) element.getAttribute(IMarker.SEVERITY)).intValue();
|
int sev = ((Integer) element.getAttribute(IMarker.SEVERITY)).intValue();
|
||||||
String mesg = (String) element.getAttribute(IMarker.MESSAGE);
|
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)) {
|
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) {
|
if (problemMarkerInfo.variableName != null) {
|
||||||
marker.setAttribute(ICModelMarker.C_MODEL_MARKER_VARIABLE, problemMarkerInfo.variableName);
|
marker.setAttribute(ICModelMarker.C_MODEL_MARKER_VARIABLE, problemMarkerInfo.variableName);
|
||||||
}
|
}
|
||||||
if (problemMarkerInfo.externalPath != null) {
|
if (externalLocation != null) {
|
||||||
marker.setAttribute(ICModelMarker.C_MODEL_MARKER_EXTERNAL_LOCATION, problemMarkerInfo.externalPath.toOSString());
|
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) {
|
catch (CoreException e) {
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
# Markus Schorn (Wind River Systems)
|
# Markus Schorn (Wind River Systems)
|
||||||
# Anton Leherbauer (Wind River Systems)
|
# Anton Leherbauer (Wind River Systems)
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
ACBuilder.ProblemsView.Location=line {0}, external location: {1}
|
||||||
CBuilder.build_error= Build Error
|
CBuilder.build_error= Build Error
|
||||||
CoreModel.BinaryRunner.Binary_Search_Thread=Searching for Binaries
|
CoreModel.BinaryRunner.Binary_Search_Thread=Searching for Binaries
|
||||||
CoreModel.CModelBuilder.Parser_Construction_Failure=Parser/Scanner construction failure.
|
CoreModel.CModelBuilder.Parser_Construction_Failure=Parser/Scanner construction failure.
|
||||||
|
|
Loading…
Add table
Reference in a new issue