Skip to main content
summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorAndrew Gvozdev2013-05-20 18:58:44 +0000
committerAndrew Gvozdev2013-05-20 19:21:57 +0000
commitb18bf27bb42903af925049a4a1bfcae95a1aca48 (patch)
tree3828944f712c77336fe02e13a6a3b8cbc510f382 /build
parentf2af5d39a960a4342acb80de7002ab4a30c8c412 (diff)
downloadorg.eclipse.cdt-b18bf27bb42903af925049a4a1bfcae95a1aca48.tar.gz
org.eclipse.cdt-b18bf27bb42903af925049a4a1bfcae95a1aca48.tar.xz
org.eclipse.cdt-b18bf27bb42903af925049a4a1bfcae95a1aca48.zip
bug 402023: When persisting discovered include paths, project-relative paths should not embed the project name
Diffstat (limited to 'build')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/GCCBuildCommandParserTest.java62
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractLanguageSettingsOutputScanner.java45
2 files changed, 64 insertions, 43 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/GCCBuildCommandParserTest.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/GCCBuildCommandParserTest.java
index 75aa2201343..2cae3fb6c44 100644
--- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/GCCBuildCommandParserTest.java
+++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/GCCBuildCommandParserTest.java
@@ -716,7 +716,7 @@ public class GCCBuildCommandParserTest extends BaseTestCase {
assertEquals(new CIncludeFileEntry("/include.file with spaces", 0), entries.get(1));
assertEquals(new CIncludeFileEntry(project.getLocation().removeLastSegments(2).append("include.file2"), 0), entries.get(2));
- assertEquals(new CIncludeFileEntry(project.getFullPath().append("include.file3"), ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED), entries.get(3));
+ assertEquals(new CIncludeFileEntry("/${ProjName}/include.file3", ICSettingEntry.VALUE_WORKSPACE_PATH), entries.get(3));
assertEquals(new CIncludeFileEntry(project.getLocation().removeLastSegments(2).append("include-file-with-dashes"), 0), entries.get(4));
}
@@ -928,7 +928,7 @@ public class GCCBuildCommandParserTest extends BaseTestCase {
// check entries
List<ICLanguageSettingEntry> entries = parser.getSettingEntries(cfgDescription, file, languageId);
assertEquals(new CIncludePathEntry("/path0", 0), entries.get(0));
- assertEquals(new CIncludePathEntry(project.getFullPath(), ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED), entries.get(1));
+ assertEquals(new CIncludePathEntry("/${ProjName}/", ICSettingEntry.VALUE_WORKSPACE_PATH), entries.get(1));
}
/**
@@ -1035,7 +1035,7 @@ public class GCCBuildCommandParserTest extends BaseTestCase {
// check entries
assertEquals(new CIncludePathEntry("/path0", 0), parser.getSettingEntries(cfgDescription, file, languageId).get(0));
// Information from build output should take precedence over build dir
- assertEquals(new CIncludePathEntry(project.getFullPath(), ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED), parser.getSettingEntries(cfgDescription, file, languageId).get(1));
+ assertEquals(new CIncludePathEntry("/${ProjName}/", ICSettingEntry.VALUE_WORKSPACE_PATH), parser.getSettingEntries(cfgDescription, file, languageId).get(1));
}
/**
@@ -1146,10 +1146,10 @@ public class GCCBuildCommandParserTest extends BaseTestCase {
// check populated entries
List<ICLanguageSettingEntry> entries = parser.getSettingEntries(cfgDescription, file, languageId);
// check that relative paths are relative to CWD which is the location of the project
- assertEquals(new CIncludePathEntry(project.getFullPath(), ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED), entries.get(0));
+ assertEquals(new CIncludePathEntry("/${ProjName}/", ICSettingEntry.VALUE_WORKSPACE_PATH), entries.get(0));
assertEquals(new CIncludePathEntry(project.getLocation().removeLastSegments(1), 0), entries.get(1));
- assertEquals(new CIncludePathEntry(folder.getFullPath(), ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED), entries.get(2));
- assertEquals(new CIncludePathEntry(folderComposite.getFullPath(), ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED), entries.get(3));
+ assertEquals(new CIncludePathEntry("/${ProjName}/" + folder.getProjectRelativePath(), ICSettingEntry.VALUE_WORKSPACE_PATH), entries.get(2));
+ assertEquals(new CIncludePathEntry("/${ProjName}/" + folderComposite.getProjectRelativePath(), ICSettingEntry.VALUE_WORKSPACE_PATH), entries.get(3));
}
/**
@@ -1217,7 +1217,7 @@ public class GCCBuildCommandParserTest extends BaseTestCase {
// check populated entries
List<ICLanguageSettingEntry> entries = parser.getSettingEntries(cfgDescription, file, languageId);
- assertEquals(new CIncludePathEntry(folder.getFullPath(), ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED), entries.get(0));
+ assertEquals(new CIncludePathEntry("/${ProjName}/" + folder.getProjectRelativePath(), ICSettingEntry.VALUE_WORKSPACE_PATH), entries.get(0));
assertEquals(1, entries.size());
}
@@ -1258,11 +1258,11 @@ public class GCCBuildCommandParserTest extends BaseTestCase {
// check populated entries
List<ICLanguageSettingEntry> entries = parser.getSettingEntries(cfgDescription, file, languageId);
- assertEquals(new CIncludePathEntry(buildDir.getFullPath(), ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED), entries.get(0));
- assertEquals(new CIncludePathEntry(buildDir.getFullPath().removeLastSegments(1), ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED), entries.get(1));
+ assertEquals(new CIncludePathEntry("/${ProjName}/" + buildDir.getProjectRelativePath(), ICSettingEntry.VALUE_WORKSPACE_PATH), entries.get(0));
+ assertEquals(new CIncludePathEntry("/${ProjName}/" + buildDir.getProjectRelativePath().removeLastSegments(1), ICSettingEntry.VALUE_WORKSPACE_PATH), entries.get(1));
assertEquals(new CIncludePathEntry(buildDir.getLocation().removeLastSegments(3), 0), entries.get(2));
- assertEquals(new CIncludePathEntry(folder.getFullPath(), ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED), entries.get(3));
- assertEquals(new CIncludePathEntry(buildDir.getFullPath().append("MissingFolder"), ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED), entries.get(4));
+ assertEquals(new CIncludePathEntry("/${ProjName}/" + folder.getProjectRelativePath(), ICSettingEntry.VALUE_WORKSPACE_PATH), entries.get(3));
+ assertEquals(new CIncludePathEntry("/${ProjName}/" + buildDir.getProjectRelativePath().append("MissingFolder"), ICSettingEntry.VALUE_WORKSPACE_PATH), entries.get(4));
}
/**
@@ -1294,7 +1294,7 @@ public class GCCBuildCommandParserTest extends BaseTestCase {
// check populated entries
List<ICLanguageSettingEntry> entries = parser.getSettingEntries(cfgDescription, file, languageId);
- assertEquals(new CIncludePathEntry(folder.getFullPath(), ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED), entries.get(0));
+ assertEquals(new CIncludePathEntry("/${ProjName}/" + folder.getProjectRelativePath(), ICSettingEntry.VALUE_WORKSPACE_PATH), entries.get(0));
}
/**
@@ -1331,9 +1331,9 @@ public class GCCBuildCommandParserTest extends BaseTestCase {
// check populated entries
List<ICLanguageSettingEntry> entries = parser.getSettingEntries(cfgDescription, file, languageId);
- assertEquals(new CIncludePathEntry(buildDir.getFullPath(), ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED), entries.get(0));
- assertEquals(new CIncludePathEntry(buildDir.getFullPath().removeLastSegments(1), ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED), entries.get(1));
- assertEquals(new CIncludePathEntry(buildDir.getFullPath().append("Folder"), ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED), entries.get(2));
+ assertEquals(new CIncludePathEntry("/${ProjName}/" + buildDir.getProjectRelativePath(), ICSettingEntry.VALUE_WORKSPACE_PATH), entries.get(0));
+ assertEquals(new CIncludePathEntry("/${ProjName}/" + buildDir.getProjectRelativePath().removeLastSegments(1), ICSettingEntry.VALUE_WORKSPACE_PATH), entries.get(1));
+ assertEquals(new CIncludePathEntry("/${ProjName}/" + buildDir.getProjectRelativePath().append("Folder"), ICSettingEntry.VALUE_WORKSPACE_PATH), entries.get(2));
}
/**
@@ -1416,21 +1416,21 @@ public class GCCBuildCommandParserTest extends BaseTestCase {
+ " -include /BuildDir/include.file1"
+ " -include ../BuildDir/include.file2"
+ " -include /BuildDir/missing.include.file"
- + " -include ../BuildDir/missing.include.file"
+ + " -include ../BuildDir/missing.include.file2"
+ " /BuildDir/file.cpp");
parser.shutdown();
// check populated entries
List<ICLanguageSettingEntry> entries = parser.getSettingEntries(cfgDescription, file, languageId);
- assertEquals(new CIncludePathEntry(buildDir.getFullPath(), ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED), entries.get(0));
- assertEquals(new CIncludePathEntry(folder.getFullPath(), ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED), entries.get(1));
- assertEquals(new CIncludePathEntry(folder2.getFullPath(), ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED), entries.get(2));
+ assertEquals(new CIncludePathEntry("/${ProjName}/" + buildDir.getProjectRelativePath(), ICSettingEntry.VALUE_WORKSPACE_PATH), entries.get(0));
+ assertEquals(new CIncludePathEntry("/${ProjName}/" + folder.getProjectRelativePath(), ICSettingEntry.VALUE_WORKSPACE_PATH), entries.get(1));
+ assertEquals(new CIncludePathEntry("/${ProjName}/" + folder2.getProjectRelativePath(), ICSettingEntry.VALUE_WORKSPACE_PATH), entries.get(2));
assertEquals(new CIncludePathEntry("/BuildDir/MissingFolder", 0), entries.get(3));
- assertEquals(new CIncludePathEntry(buildDir.getFullPath().append("MissingFolder2"), ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED), entries.get(4));
- assertEquals(new CIncludeFileEntry(incFile1.getFullPath(), ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED), entries.get(5));
- assertEquals(new CIncludeFileEntry(incFile2.getFullPath(), ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED), entries.get(6));
+ assertEquals(new CIncludePathEntry("/${ProjName}/" + buildDir.getProjectRelativePath().append("MissingFolder2"), ICSettingEntry.VALUE_WORKSPACE_PATH), entries.get(4));
+ assertEquals(new CIncludeFileEntry("/${ProjName}/" + incFile1.getProjectRelativePath(), ICSettingEntry.VALUE_WORKSPACE_PATH), entries.get(5));
+ assertEquals(new CIncludeFileEntry("/${ProjName}/" + incFile2.getProjectRelativePath(), ICSettingEntry.VALUE_WORKSPACE_PATH), entries.get(6));
assertEquals(new CIncludeFileEntry("/BuildDir/missing.include.file", 0), entries.get(7));
- assertEquals(new CIncludeFileEntry(buildDir.getFullPath().append("missing.include.file"), ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED), entries.get(8));
+ assertEquals(new CIncludeFileEntry("/${ProjName}/" + buildDir.getProjectRelativePath().append("missing.include.file2"), ICSettingEntry.VALUE_WORKSPACE_PATH), entries.get(8));
}
/**
@@ -1470,8 +1470,8 @@ public class GCCBuildCommandParserTest extends BaseTestCase {
// check populated entries
List<ICLanguageSettingEntry> entries = parser.getSettingEntries(cfgDescription, file, languageId);
- assertEquals(new CIncludePathEntry(folder.getFullPath(), ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED), entries.get(0));
- assertEquals(new CIncludePathEntry(mappedFolder.getFullPath(), ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED), entries.get(1));
+ assertEquals(new CIncludePathEntry("/${ProjName}/" + folder.getProjectRelativePath(), ICSettingEntry.VALUE_WORKSPACE_PATH), entries.get(0));
+ assertEquals(new CIncludePathEntry("/${ProjName}/" + mappedFolder.getProjectRelativePath(), ICSettingEntry.VALUE_WORKSPACE_PATH), entries.get(1));
assertEquals(new CIncludePathEntry("/Ambiguous/Folder", 0), entries.get(2));
assertEquals(new CIncludePathEntry("/Missing/Folder", 0), entries.get(3));
}
@@ -1686,8 +1686,8 @@ public class GCCBuildCommandParserTest extends BaseTestCase {
// check populated entries
List<ICLanguageSettingEntry> entries = parser.getSettingEntries(cfgDescription, file, languageId);
- assertEquals(new CIncludePathEntry(buildDir.getFullPath(), ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED), entries.get(0));
- assertEquals(new CIncludePathEntry(includeDir.getFullPath(), ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED), entries.get(1));
+ assertEquals(new CIncludePathEntry("/${ProjName}/" + buildDir.getProjectRelativePath(), ICSettingEntry.VALUE_WORKSPACE_PATH), entries.get(0));
+ assertEquals(new CIncludePathEntry("/${ProjName}/" + includeDir.getProjectRelativePath(), ICSettingEntry.VALUE_WORKSPACE_PATH), entries.get(1));
}
/**
@@ -1729,8 +1729,8 @@ public class GCCBuildCommandParserTest extends BaseTestCase {
// check populated entries
List<ICLanguageSettingEntry> entries = parser.getSettingEntries(cfgDescription, file, languageId);
- assertEquals(new CIncludePathEntry(buildDir.getFullPath(), ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED), entries.get(0));
- assertEquals(new CIncludePathEntry(includeDir.getFullPath(), ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED), entries.get(1));
+ assertEquals(new CIncludePathEntry("/${ProjName}/" + buildDir.getProjectRelativePath(), ICSettingEntry.VALUE_WORKSPACE_PATH), entries.get(0));
+ assertEquals(new CIncludePathEntry("/${ProjName}/" + includeDir.getProjectRelativePath(), ICSettingEntry.VALUE_WORKSPACE_PATH), entries.get(1));
}
/**
@@ -1870,7 +1870,7 @@ public class GCCBuildCommandParserTest extends BaseTestCase {
// check populated entries
List<ICLanguageSettingEntry> entries = parser.getSettingEntries(cfgDescription, file, languageId);
- assertEquals(new CIncludePathEntry(project.getFullPath(), ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED), entries.get(0));
+ assertEquals(new CIncludePathEntry("/${ProjName}/", ICSettingEntry.VALUE_WORKSPACE_PATH), entries.get(0));
// "/Python1025/Include" not expected to be there
assertFalse(new java.io.File("/Python1025/Include").exists());
assertEquals(new CIncludePathEntry("/Python1025/Include", 0), entries.get(1));
@@ -1913,7 +1913,7 @@ public class GCCBuildCommandParserTest extends BaseTestCase {
// check populated entries
List<ICLanguageSettingEntry> entries = parser.getSettingEntries(cfgDescription, file, languageId);
String device = project.getLocation().getDevice();
- assertEquals(new CIncludePathEntry(folder.getFullPath(), ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED), entries.get(0));
+ assertEquals(new CIncludePathEntry("/${ProjName}/" + folder.getProjectRelativePath(), ICSettingEntry.VALUE_WORKSPACE_PATH), entries.get(0));
assertEquals(new CIncludePathEntry(new Path("/Absolute/Folder").setDevice(device), 0), entries.get(1));
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractLanguageSettingsOutputScanner.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractLanguageSettingsOutputScanner.java
index 57d675b4f75..8181a9e42ce 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractLanguageSettingsOutputScanner.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/AbstractLanguageSettingsOutputScanner.java
@@ -40,6 +40,7 @@ import org.eclipse.cdt.core.settings.model.util.CDataUtil;
import org.eclipse.cdt.internal.core.XmlUtil;
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
import org.eclipse.cdt.utils.EFSExtensionManager;
+import org.eclipse.cdt.utils.cdtvariables.CdtVariableResolver;
import org.eclipse.core.filesystem.EFS;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFolder;
@@ -71,6 +72,8 @@ import org.w3c.dom.Element;
*/
public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSettingsSerializableProvider implements ICBuildOutputParser {
protected static final String ATTR_KEEP_RELATIVE_PATHS = "keep-relative-paths"; //$NON-NLS-1$
+ // evaluates to "/${ProjName)/"
+ private static final String PROJ_NAME_PREFIX = '/' + CdtVariableResolver.createVariableReference(CdtVariableResolver.VAR_PROJ_NAME) + '/';
protected ICConfigurationDescription currentCfgDescription = null;
protected IWorkingDirectoryTracker cwdTracker = null;
@@ -1012,7 +1015,12 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett
*/
private ICLanguageSettingEntry createResolvedPathEntry(AbstractOptionParser optionParser, String parsedPath, int flag, URI baseURI) {
URI uri = determineMappedURI(parsedPath, baseURI);
- ICLanguageSettingEntry entry = resolvePathEntryInWorkspace(optionParser, uri, flag);
+ boolean isRelative = !new Path(parsedPath).isAbsolute();
+ // is mapped something that is not a project root
+ boolean isRemapped = baseURI != null && currentProject != null && !baseURI.equals(currentProject.getLocationURI());
+ boolean presentAsRelative = isRelative || isRemapped;
+
+ ICLanguageSettingEntry entry = resolvePathEntryInWorkspace(optionParser, uri, flag, presentAsRelative);
if (entry != null) {
return entry;
}
@@ -1020,11 +1028,11 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett
if (entry != null) {
return entry;
}
- entry = resolvePathEntryInWorkspaceAsBestFit(optionParser, parsedPath, flag);
+ entry = resolvePathEntryInWorkspaceAsBestFit(optionParser, parsedPath, flag, presentAsRelative);
if (entry != null) {
return entry;
}
- entry = resolvePathEntryInWorkspaceToNonexistingResource(optionParser, uri, flag);
+ entry = resolvePathEntryInWorkspaceToNonexistingResource(optionParser, uri, flag, presentAsRelative);
if (entry != null) {
return entry;
}
@@ -1036,9 +1044,25 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett
}
/**
+ * Create a language settings entry for a given resource.
+ * This will represent relative path using CDT variable ${ProjName}.
+ */
+ private ICLanguageSettingEntry createPathEntry(AbstractOptionParser optionParser, IResource rc, boolean isRelative, int flag) {
+ String path;
+ if (isRelative && rc.getProject().equals(currentProject)) {
+ path = PROJ_NAME_PREFIX + rc.getFullPath().removeFirstSegments(1);
+ flag = flag | ICSettingEntry.VALUE_WORKSPACE_PATH;
+ } else {
+ path = rc.getFullPath().toString();
+ flag = flag | ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED;
+ }
+ return optionParser.createEntry(path, path, flag);
+ }
+
+ /**
* Find an existing resource in the workspace and create a language settings entry for it.
*/
- private ICLanguageSettingEntry resolvePathEntryInWorkspace(AbstractOptionParser optionParser, URI uri, int flag) {
+ private ICLanguageSettingEntry resolvePathEntryInWorkspace(AbstractOptionParser optionParser, URI uri, int flag, boolean isRelative) {
if (uri != null && uri.isAbsolute()) {
IResource rc = null;
if (optionParser.isForFolder()) {
@@ -1047,8 +1071,7 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett
rc = findFileForLocationURI(uri, currentProject, /*checkExistence*/ true);
}
if (rc != null) {
- String path = rc.getFullPath().toString();
- return optionParser.createEntry(path, path, flag | ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED);
+ return createPathEntry(optionParser, rc, isRelative, flag);
}
}
return null;
@@ -1071,11 +1094,10 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett
/**
* Find a best fit for the resource in the workspace and create a language settings entry for it.
*/
- private ICLanguageSettingEntry resolvePathEntryInWorkspaceAsBestFit(AbstractOptionParser optionParser, String parsedPath, int flag) {
+ private ICLanguageSettingEntry resolvePathEntryInWorkspaceAsBestFit(AbstractOptionParser optionParser, String parsedPath, int flag, boolean isRelative) {
IResource rc = findBestFitInWorkspace(parsedPath);
if (rc != null) {
- String path = rc.getFullPath().toString();
- return optionParser.createEntry(path, path, flag | ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED);
+ return createPathEntry(optionParser, rc, isRelative, flag);
}
return null;
}
@@ -1083,7 +1105,7 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett
/**
* Try to map a resource in the workspace even if it does not exist and create a language settings entry for it.
*/
- private ICLanguageSettingEntry resolvePathEntryInWorkspaceToNonexistingResource(AbstractOptionParser optionParser, URI uri, int flag) {
+ private ICLanguageSettingEntry resolvePathEntryInWorkspaceToNonexistingResource(AbstractOptionParser optionParser, URI uri, int flag, boolean isRelative) {
if (uri != null && uri.isAbsolute()) {
IResource rc = null;
if (optionParser.isForFolder()) {
@@ -1092,8 +1114,7 @@ public abstract class AbstractLanguageSettingsOutputScanner extends LanguageSett
rc = findFileForLocationURI(uri, currentProject, /*checkExistence*/ false);
}
if (rc != null) {
- String path = rc.getFullPath().toString();
- return optionParser.createEntry(path, path, flag | ICSettingEntry.VALUE_WORKSPACE_PATH | ICSettingEntry.RESOLVED);
+ return createPathEntry(optionParser, rc, isRelative, flag);
}
}
return null;

Back to the top