1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

More accurate check for resource existence accounting for variables.

This commit is contained in:
Andrew Gvozdev 2011-12-20 09:59:13 -05:00
parent aa67c9cce3
commit 0847bf37d8

View file

@ -21,9 +21,9 @@ import org.eclipse.jface.viewers.IDecoration;
import org.eclipse.swt.graphics.Image;
import org.eclipse.cdt.core.settings.model.ACPathEntry;
import org.eclipse.cdt.core.settings.model.CMacroEntry;
import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
import org.eclipse.cdt.core.settings.model.ICSettingEntry;
import org.eclipse.cdt.core.settings.model.util.CDataUtil;
import org.eclipse.cdt.ui.CDTSharedImages;
import org.eclipse.cdt.ui.CUIPlugin;
@ -128,8 +128,16 @@ public class LanguageSettingsImages {
*/
public static IStatus getStatus(ICLanguageSettingEntry entry) {
if (entry instanceof ACPathEntry) {
if (!entry.isResolved()) {
ICLanguageSettingEntry[] entries = CDataUtil.resolveEntries(new ICLanguageSettingEntry[] {entry}, null);
if (entries != null && entries.length > 0) {
entry = entries[0];
}
}
ACPathEntry acEntry = (ACPathEntry)entry;
IPath path = new Path(acEntry.getName());
String acEntryName = acEntry.getName();
IPath path = new Path(acEntryName);
if (!path.isAbsolute()) {
String msg = "Using relative paths is ambiguous and not recommended. It can cause unexpected side-effects.";
return new Status(IStatus.INFO, CUIPlugin.PLUGIN_ID, msg);