Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 245443

Summary: StandaloneIndexerTask base uses default ScannerConfig in producing AST
Product: [Tools] CDT Reporter: Missing name Mising name <sebastian.moss>
Component: cdt-coreAssignee: Mike Kucera <mikekucera>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: cdt-core-inbox, cdtdoug, recoskie
Version: 5.0Flags: cdtdoug: iplog-
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 245713    
Attachments:
Description Flags
Patch providing overloaded retrieveScannerConfig in StandaloneIndexerTask
none
Patch providing overloaded retrieveScannerConfig in StandaloneIndexerTask
none
proposed fix cdtdoug: iplog-

Description Missing name Mising name CLA 2008-08-27 16:14:02 EDT
Created attachment 111120 [details]
Patch providing overloaded retrieveScannerConfig in StandaloneIndexerTask

AbstractIndexerTask - base of StandaloneIndexerTask - uses a new ScannerConfig object when creating an AST.

In derived classes such as StandaloneIndexerTask, it is preferable to use the IScannerConfig of the member indexer than the default-constructed ScannerConfig produced by AbstractIndexerTask.
Comment 1 Missing name Mising name CLA 2008-08-27 17:35:49 EDT
Created attachment 111128 [details]
Patch providing overloaded retrieveScannerConfig in StandaloneIndexerTask
Comment 2 Chris Recoskie CLA 2008-08-28 10:00:58 EDT
Mike, I know you did some stuff recently with the scanner config for the standalone indexer.  Can you take a look?  Thanks.
Comment 3 Mike Kucera CLA 2008-08-28 14:14:44 EDT
I recently added the ability to use an IStandaloneScannerInfoProvider with the StandaloneIndexer in order to provide ISannerInfo objects for specific files. The provided solution is incomplete because it does not use the IStandaloneScannerInfoProvider.

As far as I can tell the 'default' scanner info object is only used when the indexer parses files up front. I guess this is because normally when an include file is parsed it is in the context of a source file in the project. But if a header file outside the project is parsed up front it needs a 'default' scanner info to provide at least a minimal amount of info to the parser.

I'll take a look at fixing this.
Comment 4 Mike Kucera CLA 2008-08-29 11:43:29 EDT
Created attachment 111311 [details]
proposed fix

This patch fixes the problem in a similar way, but it also adds a method to IStandaloneScannerInfoProvider for providing the default scanner info.

Also I deprecated getScannerInfo() in the standalone indexer task. You can get the same behavior by providing an implementation of IStandaloneScannerInfoProvider that always returns the same IScannerInfo object.
Comment 5 Mike Kucera CLA 2008-09-03 17:22:26 EDT
Fixed in HEAD.
Comment 6 Mike Kucera CLA 2009-07-16 14:51:52 EDT
I've backported the patch to the 5.0 stream.