diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/IPositionTrackerManager.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/IPositionTrackerManager.java
index e23f3b15af8..20c2f122a57 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/IPositionTrackerManager.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/IPositionTrackerManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2008 Wind River Systems, Inc. and others.
+ * Copyright (c) 2006, 2009 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,9 +8,10 @@
* Contributors:
* Markus Schorn - initial API and implementation
*******************************************************************************/
-
package org.eclipse.cdt.core;
+import java.net.URI;
+
import org.eclipse.cdt.core.model.ITranslationUnit;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IPath;
@@ -19,16 +20,10 @@ import org.eclipse.core.runtime.IPath;
* An interface to manage the position tracking. It allows for mapping character
* offsets from a file previously stored on disk to the offset in the current document
* for the file.
- *
- *
This interface is not intended to be implemented by clients.
- *
- *
- * EXPERIMENTAL. This interface has been added as
- * part of a work in progress. There is no guarantee that this API will
- * work or that it will remain the same. Please do not use this API without
- * consulting with the CDT team.
- *
* @since 4.0
+ *
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
*/
public interface IPositionTrackerManager {
/**
@@ -61,4 +56,16 @@ public interface IPositionTrackerManager {
* @return the requested position converter or null.
*/
public IPositionConverter findPositionConverter(IPath fullPathOrExternalLocation, long timestamp);
+
+ /**
+ * Returns the position tracker suitable for mapping character offsets of the
+ * given external file/timestamp to the current version of it.
+ * The method cannot be used for resources that are part of the workspace.
+ *
+ * @param externalLocation an external location for which the position adapter is requested.
+ * @param timestamp identifies the version of the file stored on disk.
+ * @return the requested position converter or null.
+ * @since 5.1
+ */
+ public IPositionConverter findPositionConverter(URI externalLocation, long timestamp);
}
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/PositionTrackerManager.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/PositionTrackerManager.java
index 18bb0745ab2..9a44fe87a56 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/PositionTrackerManager.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/PositionTrackerManager.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core;
+import java.net.URI;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
@@ -25,6 +26,7 @@ import org.eclipse.core.filebuffers.IFileBuffer;
import org.eclipse.core.filebuffers.IFileBufferListener;
import org.eclipse.core.filebuffers.ITextFileBuffer;
import org.eclipse.core.filebuffers.ITextFileBufferManager;
+import org.eclipse.core.filesystem.URIUtil;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IPath;
@@ -40,10 +42,16 @@ public class PositionTrackerManager implements IPositionTrackerManager, IFileBuf
private int fMemoryCounter= 0;
private int fInstalled= 0;
- private HashMap fPositionTrackerMap;
+ /**
+ * as the key in the map we use:
+ * the full path for resources,
+ * the location as path for local non-workspace files,
+ * the location as URI for non-local non-workspace files.
+ */
+ private HashMap