mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-29 20:05:35 +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() {
|
public String toString() {
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
sb.append(super.toString());
|
sb.append(super.toString());
|
||||||
|
if (basePath != null && !basePath.isEmpty()) {
|
||||||
sb.append(" base-path:").append(basePath.toString()); //$NON-NLS-1$
|
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$
|
sb.append(" base-ref:").append(baseRef.toString()); //$NON-NLS-1$
|
||||||
|
}
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,8 +103,12 @@ public class IncludeEntry extends APathEntry implements IIncludeEntry {
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
sb.append(super.toString());
|
sb.append(super.toString());
|
||||||
|
if (isSystemInclude) {
|
||||||
sb.append(" isSystemInclude:").append(isSystemInclude); //$NON-NLS-1$
|
sb.append(" isSystemInclude:").append(isSystemInclude); //$NON-NLS-1$
|
||||||
sb.append(" includePath:").append(includePath); //$NON-NLS-1
|
}
|
||||||
|
if (includePath != null && !includePath.isEmpty()) {
|
||||||
|
sb.append(" includePath:").append(includePath); //$NON-NLS-1$
|
||||||
|
}
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -162,7 +162,9 @@ public class LibraryEntry extends APathEntry implements ILibraryEntry {
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
sb.append(super.toString());
|
sb.append(super.toString());
|
||||||
|
if (libraryPath != null && !libraryPath.isEmpty()) {
|
||||||
sb.append(" librarypath:").append(libraryPath.toString()); //$NON-NLS-1$
|
sb.append(" librarypath:").append(libraryPath.toString()); //$NON-NLS-1$
|
||||||
|
}
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,8 +80,12 @@ public class MacroEntry extends APathEntry implements IMacroEntry {
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
sb.append(super.toString());
|
sb.append(super.toString());
|
||||||
|
if (macroName != null && macroName.length() > 0) {
|
||||||
sb.append(" name:").append(macroName); //$NON-NLS-1$
|
sb.append(" name:").append(macroName); //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
if (macroValue != null && macroValue.length() > 0) {
|
||||||
sb.append(" value:").append(macroValue); //$NON-NLS-1$
|
sb.append(" value:").append(macroValue); //$NON-NLS-1$
|
||||||
|
}
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,7 +120,7 @@ public class PathEntry implements IPathEntry {
|
||||||
*/
|
*/
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuffer buffer = new StringBuffer();
|
StringBuffer buffer = new StringBuffer();
|
||||||
if (path != null) {
|
if (path != null && !path.isEmpty()) {
|
||||||
buffer.append(path.toString()).append(' ');
|
buffer.append(path.toString()).append(' ');
|
||||||
}
|
}
|
||||||
buffer.append('[');
|
buffer.append('[');
|
||||||
|
|
|
@ -975,7 +975,9 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (entry != otherEntry && otherEntry.equals(entry)) {
|
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);
|
String exclusionPattern = entryPath.removeFirstSegments(otherPath.segmentCount()).segment(0);
|
||||||
if (CoreModelUtil.isExcluded(entryPath, exclusionPatterns)) {
|
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 {
|
} else {
|
||||||
if (otherKind == IPathEntry.CDT_SOURCE) {
|
if (otherKind == IPathEntry.CDT_SOURCE) {
|
||||||
exclusionPattern += '/';
|
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 {
|
} 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){
|
public ICModelStatus validatePathEntry(ICProject cProject, IPathEntry entry, boolean checkSourceAttachment, boolean recurseInContainers){
|
||||||
IProject project = cProject.getProject();
|
IProject project = cProject.getProject();
|
||||||
IPath projectPath = cProject.getPath();
|
StringBuffer sb = new StringBuffer();
|
||||||
String entryMesg = projectPath.toString() + ": " + entry.toString(); //$NON-NLS-1$
|
sb.append(CCorePlugin.getResourceBundle().getString("CoreModel.PathEntry.InvalidPathEntry")); //$NON-NLS-1$
|
||||||
|
sb.append(':').append(entry.toString());
|
||||||
|
String entryMesg = sb.toString();
|
||||||
switch(entry.getEntryKind()) {
|
switch(entry.getEntryKind()) {
|
||||||
case IPathEntry.CDT_INCLUDE: {
|
case IPathEntry.CDT_INCLUDE: {
|
||||||
IIncludeEntry include = (IIncludeEntry)entry;
|
IIncludeEntry include = (IIncludeEntry)entry;
|
||||||
|
@ -1103,6 +1113,20 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case IPathEntry.CDT_CONTAINER:
|
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;
|
break;
|
||||||
}
|
}
|
||||||
return CModelStatus.VERIFIED_OK;
|
return CModelStatus.VERIFIED_OK;
|
||||||
|
|
|
@ -154,6 +154,9 @@
|
||||||
<super
|
<super
|
||||||
type="org.eclipse.core.resources.textmarker">
|
type="org.eclipse.core.resources.textmarker">
|
||||||
</super>
|
</super>
|
||||||
|
<persistent
|
||||||
|
value="true">
|
||||||
|
</persistent>
|
||||||
</extension>
|
</extension>
|
||||||
<!-- =================================================================================== -->
|
<!-- =================================================================================== -->
|
||||||
<!-- CDT C Nature -->
|
<!-- CDT C Nature -->
|
||||||
|
@ -372,7 +375,7 @@
|
||||||
</super>
|
</super>
|
||||||
</extension>
|
</extension>
|
||||||
<!-- =================================================================================== -->
|
<!-- =================================================================================== -->
|
||||||
<!-- Marker for problems in the PathEntrie -->
|
<!-- Marker for problems in the PathEntries -->
|
||||||
<!-- =================================================================================== -->
|
<!-- =================================================================================== -->
|
||||||
<extension
|
<extension
|
||||||
id="pathentry_problem"
|
id="pathentry_problem"
|
||||||
|
@ -381,9 +384,6 @@
|
||||||
<super
|
<super
|
||||||
type="org.eclipse.core.resources.problemmarker">
|
type="org.eclipse.core.resources.problemmarker">
|
||||||
</super>
|
</super>
|
||||||
<persistent
|
|
||||||
value="true">
|
|
||||||
</persistent>
|
|
||||||
</extension>
|
</extension>
|
||||||
|
|
||||||
</plugin>
|
</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.Not_binary_file=not a binary file
|
||||||
CoreModel.NullBinaryParser.Null_Format=Null Format
|
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
|
CommandLauncher.error.commandCanceled=Command canceled
|
||||||
|
|
||||||
CCProjectNature.exception.noNature=Project must have a cnature
|
CCProjectNature.exception.noNature=Project must have a cnature
|
||||||
|
|
Loading…
Add table
Reference in a new issue