mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Last minute demo fixes for Search/Indexer/COMPLETE_PARSE.
This commit is contained in:
parent
c9baf818e7
commit
7c5787894d
4 changed files with 8 additions and 4 deletions
|
@ -59,7 +59,7 @@ public class SourceIndexer extends AbstractIndexer {
|
||||||
// Create a new Parser
|
// Create a new Parser
|
||||||
SourceIndexerRequestor requestor = new SourceIndexerRequestor(this, document);
|
SourceIndexerRequestor requestor = new SourceIndexerRequestor(this, document);
|
||||||
IParser parser = ParserFactory.createParser(
|
IParser parser = ParserFactory.createParser(
|
||||||
ParserFactory.createScanner( new StringReader( document.getStringContent() ), document.getName(), new ScannerInfo(), ParserMode.QUICK_PARSE, requestor ),
|
ParserFactory.createScanner( new StringReader( document.getStringContent() ), resourceFile.getLocation().toOSString(), new ScannerInfo(), ParserMode.COMPLETE_PARSE, requestor ),
|
||||||
requestor, ParserMode.COMPLETE_PARSE);
|
requestor, ParserMode.COMPLETE_PARSE);
|
||||||
try{
|
try{
|
||||||
parser.parse();
|
parser.parse();
|
||||||
|
|
|
@ -38,7 +38,7 @@ public class ASTEnumerationSpecifier
|
||||||
{
|
{
|
||||||
super(symbol);
|
super(symbol);
|
||||||
setStartingOffset(startingOffset);
|
setStartingOffset(startingOffset);
|
||||||
setNameOffset( startingOffset );
|
setNameOffset( nameOffset );
|
||||||
qualifiedName = new ASTQualifiedNamedElement( getOwnerScope(), symbol.getName() );
|
qualifiedName = new ASTQualifiedNamedElement( getOwnerScope(), symbol.getName() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ public class FunctionDeclarationPattern extends CSearchPattern {
|
||||||
return IMPOSSIBLE_MATCH;
|
return IMPOSSIBLE_MATCH;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( parameterNames != null ){
|
if( parameterNames != null && parameterNames.length > 0 ){
|
||||||
Iterator params = function.getParameters();
|
Iterator params = function.getParameters();
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -265,6 +265,8 @@ public class MatchLocator implements ISourceElementRequestor, ICSearchConstants
|
||||||
if( i > 0 && pathString.equals( paths[ i - 1 ] ) ) continue;
|
if( i > 0 && pathString.equals( paths[ i - 1 ] ) ) continue;
|
||||||
|
|
||||||
Reader reader = null;
|
Reader reader = null;
|
||||||
|
|
||||||
|
IPath realPath = null;
|
||||||
if( workspaceRoot != null ){
|
if( workspaceRoot != null ){
|
||||||
IWorkingCopy workingCopy = (IWorkingCopy)wcPaths.get( pathString );
|
IWorkingCopy workingCopy = (IWorkingCopy)wcPaths.get( pathString );
|
||||||
|
|
||||||
|
@ -283,6 +285,7 @@ public class MatchLocator implements ISourceElementRequestor, ICSearchConstants
|
||||||
if( currentResource != null && currentResource instanceof IFile ){
|
if( currentResource != null && currentResource instanceof IFile ){
|
||||||
IFile file = (IFile) currentResource;
|
IFile file = (IFile) currentResource;
|
||||||
reader = new InputStreamReader( file.getContents() );
|
reader = new InputStreamReader( file.getContents() );
|
||||||
|
realPath = currentResource.getLocation();
|
||||||
} else continue;
|
} else continue;
|
||||||
} catch ( CoreException e ){
|
} catch ( CoreException e ){
|
||||||
continue;
|
continue;
|
||||||
|
@ -292,12 +295,13 @@ public class MatchLocator implements ISourceElementRequestor, ICSearchConstants
|
||||||
try {
|
try {
|
||||||
currentPath = path;
|
currentPath = path;
|
||||||
reader = new FileReader( path.toFile() );
|
reader = new FileReader( path.toFile() );
|
||||||
|
realPath = currentPath;
|
||||||
} catch (FileNotFoundException e) {
|
} catch (FileNotFoundException e) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IScanner scanner = ParserFactory.createScanner( reader, pathString, new ScannerInfo(), ParserMode.QUICK_PARSE, this );
|
IScanner scanner = ParserFactory.createScanner( reader, realPath.toOSString(), new ScannerInfo(), ParserMode.COMPLETE_PARSE, this );
|
||||||
IParser parser = ParserFactory.createParser( scanner, this, ParserMode.COMPLETE_PARSE );
|
IParser parser = ParserFactory.createParser( scanner, this, ParserMode.COMPLETE_PARSE );
|
||||||
|
|
||||||
parser.parse();
|
parser.parse();
|
||||||
|
|
Loading…
Add table
Reference in a new issue