Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 245443 | Differences between
and this patch

Collapse All | Expand All

(-)parser/org/eclipse/cdt/internal/core/indexer/StandaloneIndexer.java (-1 / +16 lines)
Lines 98-103 Link Here
98
	 * be provided, but not both. If a single IScannerInfo object is provided
98
	 * be provided, but not both. If a single IScannerInfo object is provided
99
	 * it will always be used. Otherwise the provider will be used.
99
	 * it will always be used. Otherwise the provider will be used.
100
	 */
100
	 */
101
	@Deprecated
101
	protected IScannerInfo fScanner;
102
	protected IScannerInfo fScanner;
102
	
103
	
103
	/**
104
	/**
Lines 158-163 Link Here
158
		}
159
		}
159
	};
160
	};
160
	
161
	
162
	/**
163
	 * @deprecated Its better to provide a scanner info provider instead.
164
	 */
165
	@Deprecated
161
	public StandaloneIndexer(IWritableIndex index, boolean indexAllFiles,  
166
	public StandaloneIndexer(IWritableIndex index, boolean indexAllFiles,  
162
			                 ILanguageMapper mapper, IParserLogService log, IScannerInfo scanner) {
167
			                 ILanguageMapper mapper, IParserLogService log, IScannerInfo scanner) {
163
		fIndex = index;
168
		fIndex = index;
Lines 217-223 Link Here
217
	
222
	
218
	/**
223
	/**
219
	 * Returns the IScannerInfo that provides include paths and defined symbols.
224
	 * Returns the IScannerInfo that provides include paths and defined symbols.
225
	 * @deprecated Should probably be using a IStandaloneScannerInfoProvider instead and
226
	 * calling getScannerInfo(String).
220
	 */
227
	 */
228
	@Deprecated
221
	public IScannerInfo getScannerInfo() {
229
	public IScannerInfo getScannerInfo() {
222
		return fScanner;
230
		return fScanner;
223
	}
231
	}
Lines 235-241 Link Here
235
		
243
		
236
		return fScannerInfoProvider.getScannerInformation(path);
244
		return fScannerInfoProvider.getScannerInformation(path);
237
	}
245
	}
238
	
246
247
248
	/**
249
	 * Returns the IStandaloneScannerInfoProvider or null if one was not provided.
250
	 */
251
	public IStandaloneScannerInfoProvider getScannerInfoProvider() {
252
		return fScannerInfoProvider;
253
	}
239
	
254
	
240
	/**
255
	/**
241
	 * Returns the ILanguageMapper that determines the ILanguage for a file.
256
	 * Returns the ILanguageMapper that determines the ILanguage for a file.
(-)parser/org/eclipse/cdt/internal/core/indexer/IStandaloneScannerInfoProvider.java (-2 / +15 lines)
Lines 15-22 Link Here
15
import org.eclipse.cdt.core.parser.IScannerInfoProvider;
15
import org.eclipse.cdt.core.parser.IScannerInfoProvider;
16
16
17
/**
17
/**
18
 * Returns a IScannerInfo for the given file by a path.
19
 * 
20
 * Similar to IScannerInfoProvider but computes the IScannerInfo
18
 * Similar to IScannerInfoProvider but computes the IScannerInfo
21
 * based on a String path instead of IResource.
19
 * based on a String path instead of IResource.
22
 * 
20
 * 
Lines 24-28 Link Here
24
 */
22
 */
25
public interface IStandaloneScannerInfoProvider {
23
public interface IStandaloneScannerInfoProvider {
26
24
25
	/**
26
	 * Returns an IScannerInfo for the given file path,
27
	 * or an empty IScannerInfo object if the file path is invalid.
28
	 */
27
	IScannerInfo getScannerInformation(String path);
29
	IScannerInfo getScannerInformation(String path);
30
	
31
	/**
32
	 * Returns an IScannerInfo when you don't necessary have access to a path. 
33
	 * 
34
	 * This is used by the "parse up front" feature. Since we are parsing
35
	 * files outside of the project a "default" IScannerInfo object
36
	 * is needed to get the minimal amount of available info in order
37
	 * to parse the file.
38
	 * @param linkageID 
39
	 */
40
	IScannerInfo getDefaultScannerInformation(int linkageID);
28
}
41
}
(-)parser/org/eclipse/cdt/internal/core/indexer/StandaloneIndexerTask.java (+15 lines)
Lines 20-25 Link Here
20
import org.eclipse.cdt.core.model.AbstractLanguage;
20
import org.eclipse.cdt.core.model.AbstractLanguage;
21
import org.eclipse.cdt.core.model.ILanguage;
21
import org.eclipse.cdt.core.model.ILanguage;
22
import org.eclipse.cdt.core.parser.IParserLogService;
22
import org.eclipse.cdt.core.parser.IParserLogService;
23
import org.eclipse.cdt.core.parser.IScannerInfo;
23
import org.eclipse.cdt.internal.core.index.IWritableIndex;
24
import org.eclipse.cdt.internal.core.index.IWritableIndex;
24
import org.eclipse.cdt.internal.core.pdom.AbstractIndexerTask;
25
import org.eclipse.cdt.internal.core.pdom.AbstractIndexerTask;
25
import org.eclipse.cdt.internal.core.pdom.IndexerProgress;
26
import org.eclipse.cdt.internal.core.pdom.IndexerProgress;
Lines 218-223 Link Here
218
	protected void logError(IStatus s) {
219
	protected void logError(IStatus s) {
219
		getLogService().traceLog(s.getMessage());
220
		getLogService().traceLog(s.getMessage());
220
	}
221
	}
222
223
	@SuppressWarnings("deprecation")
224
	@Override
225
	protected IScannerInfo createDefaultScannerConfig(int linkageID) {
226
		IStandaloneScannerInfoProvider provider = fIndexer.getScannerInfoProvider();
227
		if(provider != null)
228
			return provider.getDefaultScannerInformation(linkageID);
229
		
230
		IScannerInfo scannerInfo = fIndexer.getScannerInfo();
231
		if(scannerInfo != null)
232
			return scannerInfo;
233
		
234
		return super.createDefaultScannerConfig(linkageID);
235
	}
221
	
236
	
222
	
237
	
223
}
238
}

Return to bug 245443