mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +02:00
Making the CProblem markers persistent across sessions.
This commit is contained in:
parent
47da7cb742
commit
4452556357
8 changed files with 61 additions and 18 deletions
|
@ -124,8 +124,12 @@ public abstract class APathEntry extends PathEntry {
|
|||
public String toString() {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append(super.toString());
|
||||
sb.append(" base-path:").append(basePath.toString()); //$NON-NLS-1$
|
||||
sb.append(" base-ref:").append(baseRef.toString()); //$NON-NLS-1$
|
||||
if (basePath != null && !basePath.isEmpty()) {
|
||||
sb.append(" base-path:").append(basePath.toString()); //$NON-NLS-1$
|
||||
}
|
||||
if (baseRef != null && !baseRef.isEmpty()) {
|
||||
sb.append(" base-ref:").append(baseRef.toString()); //$NON-NLS-1$
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -103,8 +103,12 @@ public class IncludeEntry extends APathEntry implements IIncludeEntry {
|
|||
public String toString() {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append(super.toString());
|
||||
sb.append(" isSystemInclude:").append(isSystemInclude); //$NON-NLS-1$
|
||||
sb.append(" includePath:").append(includePath); //$NON-NLS-1
|
||||
if (isSystemInclude) {
|
||||
sb.append(" isSystemInclude:").append(isSystemInclude); //$NON-NLS-1$
|
||||
}
|
||||
if (includePath != null && !includePath.isEmpty()) {
|
||||
sb.append(" includePath:").append(includePath); //$NON-NLS-1$
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -162,7 +162,9 @@ public class LibraryEntry extends APathEntry implements ILibraryEntry {
|
|||
public String toString() {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append(super.toString());
|
||||
sb.append(" librarypath:").append(libraryPath.toString()); //$NON-NLS-1$
|
||||
if (libraryPath != null && !libraryPath.isEmpty()) {
|
||||
sb.append(" librarypath:").append(libraryPath.toString()); //$NON-NLS-1$
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -80,8 +80,12 @@ public class MacroEntry extends APathEntry implements IMacroEntry {
|
|||
public String toString() {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append(super.toString());
|
||||
sb.append(" name:").append(macroName); //$NON-NLS-1$
|
||||
sb.append(" value:").append(macroValue); //$NON-NLS-1$
|
||||
if (macroName != null && macroName.length() > 0) {
|
||||
sb.append(" name:").append(macroName); //$NON-NLS-1$
|
||||
}
|
||||
if (macroValue != null && macroValue.length() > 0) {
|
||||
sb.append(" value:").append(macroValue); //$NON-NLS-1$
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -120,7 +120,7 @@ public class PathEntry implements IPathEntry {
|
|||
*/
|
||||
public String toString() {
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
if (path != null) {
|
||||
if (path != null && !path.isEmpty()) {
|
||||
buffer.append(path.toString()).append(' ');
|
||||
}
|
||||
buffer.append('[');
|
||||
|
|
|
@ -975,7 +975,9 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
|
|||
continue;
|
||||
}
|
||||
if (entry != otherEntry && otherEntry.equals(entry)) {
|
||||
return new CModelStatus(ICModelStatusConstants.INVALID_PATHENTRY, "Duplication:" + entry.toString()); //$NON-NLS-1$
|
||||
StringBuffer errMesg = new StringBuffer(CCorePlugin.getResourceBundle().getString("CoreModel.PathEntry.DuplicateEntry")); //$NON-NLS-1$
|
||||
errMesg.append(':').append(entry.toString());
|
||||
return new CModelStatus(ICModelStatusConstants.INVALID_PATHENTRY, errMesg.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1003,13 +1005,19 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
|
|||
|
||||
String exclusionPattern = entryPath.removeFirstSegments(otherPath.segmentCount()).segment(0);
|
||||
if (CoreModelUtil.isExcluded(entryPath, exclusionPatterns)) {
|
||||
return new CModelStatus(ICModelStatusConstants.INVALID_PATHENTRY, "Nested:" + entry.toString()); //$NON-NLS-1$
|
||||
StringBuffer errMesg = new StringBuffer(CCorePlugin.getResourceBundle().getString("CoreModel.PathEntry.NestedEntry")); //$NON-NLS-1$
|
||||
errMesg.append(':').append(entry.toString());
|
||||
return new CModelStatus(ICModelStatusConstants.INVALID_PATHENTRY, errMesg.toString());
|
||||
} else {
|
||||
if (otherKind == IPathEntry.CDT_SOURCE) {
|
||||
exclusionPattern += '/';
|
||||
return new CModelStatus(ICModelStatusConstants.INVALID_PATHENTRY, "Nested:" + entry.toString()); //$NON-NLS-1$
|
||||
StringBuffer errMesg = new StringBuffer(CCorePlugin.getResourceBundle().getString("CoreModel.PathEntry.NestedEntry")); //$NON-NLS-1$
|
||||
errMesg.append(':').append(entry.toString());
|
||||
return new CModelStatus(ICModelStatusConstants.INVALID_PATHENTRY, errMesg.toString());
|
||||
} else {
|
||||
return new CModelStatus(ICModelStatusConstants.INVALID_PATHENTRY, "Nested:" + entry.toString()); //$NON-NLS-1$
|
||||
StringBuffer errMesg = new StringBuffer(CCorePlugin.getResourceBundle().getString("CoreModel.PathEntry.NestedEntry")); //$NON-NLS-1$
|
||||
errMesg.append(':').append(entry.toString());
|
||||
return new CModelStatus(ICModelStatusConstants.INVALID_PATHENTRY, errMesg.toString()); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1023,8 +1031,10 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
|
|||
|
||||
public ICModelStatus validatePathEntry(ICProject cProject, IPathEntry entry, boolean checkSourceAttachment, boolean recurseInContainers){
|
||||
IProject project = cProject.getProject();
|
||||
IPath projectPath = cProject.getPath();
|
||||
String entryMesg = projectPath.toString() + ": " + entry.toString(); //$NON-NLS-1$
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append(CCorePlugin.getResourceBundle().getString("CoreModel.PathEntry.InvalidPathEntry")); //$NON-NLS-1$
|
||||
sb.append(':').append(entry.toString());
|
||||
String entryMesg = sb.toString();
|
||||
switch(entry.getEntryKind()) {
|
||||
case IPathEntry.CDT_INCLUDE: {
|
||||
IIncludeEntry include = (IIncludeEntry)entry;
|
||||
|
@ -1103,6 +1113,20 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
|
|||
break;
|
||||
}
|
||||
case IPathEntry.CDT_CONTAINER:
|
||||
if (recurseInContainers) {
|
||||
try {
|
||||
IPathEntryContainer cont = getPathEntryContainer((IContainerEntry)entry, cProject);
|
||||
IPathEntry[] contEntries = cont.getPathEntries();
|
||||
for (int i = 0; i < contEntries.length; i++) {
|
||||
ICModelStatus status = validatePathEntry(cProject, contEntries[i], checkSourceAttachment, false);
|
||||
if (!status.isOK()) {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
} catch (CModelException e) {
|
||||
return new CModelStatus(e);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return CModelStatus.VERIFIED_OK;
|
||||
|
|
|
@ -154,6 +154,9 @@
|
|||
<super
|
||||
type="org.eclipse.core.resources.textmarker">
|
||||
</super>
|
||||
<persistent
|
||||
value="true">
|
||||
</persistent>
|
||||
</extension>
|
||||
<!-- =================================================================================== -->
|
||||
<!-- CDT C Nature -->
|
||||
|
@ -372,7 +375,7 @@
|
|||
</super>
|
||||
</extension>
|
||||
<!-- =================================================================================== -->
|
||||
<!-- Marker for problems in the PathEntrie -->
|
||||
<!-- Marker for problems in the PathEntries -->
|
||||
<!-- =================================================================================== -->
|
||||
<extension
|
||||
id="pathentry_problem"
|
||||
|
@ -381,9 +384,6 @@
|
|||
<super
|
||||
type="org.eclipse.core.resources.problemmarker">
|
||||
</super>
|
||||
<persistent
|
||||
value="true">
|
||||
</persistent>
|
||||
</extension>
|
||||
|
||||
</plugin>
|
||||
|
|
|
@ -14,6 +14,11 @@ CoreModel.CModelStatus.Error_in_CPlugin=Error in C Plugin
|
|||
CoreModel.NullBinaryParser.Not_binary_file=not a binary file
|
||||
CoreModel.NullBinaryParser.Null_Format=Null Format
|
||||
|
||||
CoreModel.PathEntry.IllegalContainerPath= Illegal container entry
|
||||
CoreModel.PathEntry.DuplicatedEntry= Duplicate path entries
|
||||
CoreModel.PathEntry.NestedEntry= Nested path entries
|
||||
CoreModel.PathEntry.InvalidPathEntry= Invalid path
|
||||
|
||||
CommandLauncher.error.commandCanceled=Command canceled
|
||||
|
||||
CCProjectNature.exception.noNature=Project must have a cnature
|
||||
|
|
Loading…
Add table
Reference in a new issue