mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fix for 62512
Added matching routine to IncludePattern
This commit is contained in:
parent
a86bb76c6a
commit
a8037dbc3a
6 changed files with 31 additions and 14 deletions
|
@ -1,3 +1,6 @@
|
|||
2004-05-17 Bogdan Gheorghe
|
||||
Added matching routine to IncludePattern
|
||||
|
||||
2004-05-17 Andrew Niefer
|
||||
bug 61044 - report search matches at the end of each compilation unit
|
||||
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
package org.eclipse.cdt.internal.core.search.matching;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.eclipse.cdt.core.parser.ISourceElementCallbackDelegate;
|
||||
import org.eclipse.cdt.core.parser.ast.IASTInclusion;
|
||||
import org.eclipse.cdt.core.search.ICSearchScope;
|
||||
import org.eclipse.cdt.internal.core.CharOperation;
|
||||
import org.eclipse.cdt.internal.core.index.IEntryResult;
|
||||
|
@ -98,7 +98,21 @@ public class IncludePattern extends CSearchPattern {
|
|||
*/
|
||||
public int matchLevel(ISourceElementCallbackDelegate node, LimitTo limit) {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
if (!( node instanceof IASTInclusion )) {
|
||||
return IMPOSSIBLE_MATCH;
|
||||
}
|
||||
|
||||
if( ! canAccept( limit ) )
|
||||
return IMPOSSIBLE_MATCH;
|
||||
|
||||
IASTInclusion inc = (IASTInclusion) node;
|
||||
String fileName = inc.getFullFileName();
|
||||
|
||||
if(CharOperation.equals(simpleName,fileName.toCharArray(),_caseSensitive)){
|
||||
return ACCURATE_MATCH;
|
||||
}
|
||||
|
||||
return IMPOSSIBLE_MATCH;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ public class IndexingJob extends Job {
|
|||
|
||||
public IndexingJob( Thread thread, JobManager manager )
|
||||
{
|
||||
super( "Indexer" );
|
||||
super( "C/C++ Indexer" ); //$NON-NLS-1$
|
||||
jobManager = manager;
|
||||
indexThread = thread;
|
||||
setPriority( LONG );
|
||||
|
@ -46,7 +46,7 @@ public class IndexingJob extends Job {
|
|||
protected IStatus run(IProgressMonitor monitor) {
|
||||
progressMonitor = monitor;
|
||||
setThread( indexThread );
|
||||
progressMonitor.beginTask( "", 100 );
|
||||
progressMonitor.beginTask( "", 100 ); //$NON-NLS-1$
|
||||
return ASYNC_FINISH;
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ public class IndexingJob extends Job {
|
|||
ticks++;
|
||||
if( ticks > maxTicks )
|
||||
maxTicks = ticks;
|
||||
updateRemainingCount( "" );
|
||||
updateRemainingCount( "" ); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public void setTicks( int n ){
|
||||
|
@ -67,7 +67,7 @@ public class IndexingJob extends Job {
|
|||
maxTicks = ticks;
|
||||
|
||||
updatePercentage();
|
||||
updateRemainingCount( "" );
|
||||
updateRemainingCount( "" ); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public int tickDown( String str ){
|
||||
|
@ -86,7 +86,7 @@ public class IndexingJob extends Job {
|
|||
if( progressMonitor == null )
|
||||
return;
|
||||
|
||||
String taskString = Util.bind("manager.filesToIndex", Integer.toString(ticks));
|
||||
String taskString = Util.bind("manager.filesToIndex", Integer.toString(ticks)); //$NON-NLS-1$
|
||||
taskString += str;
|
||||
progressMonitor.subTask( taskString );
|
||||
}
|
||||
|
|
|
@ -51,8 +51,8 @@ public abstract class JobManager implements Runnable {
|
|||
|
||||
protected IndexingJob indexJob = null;
|
||||
|
||||
static private final IStatus OK_STATUS = new Status( IStatus.OK, "org.eclipse.cdt.core", IStatus.OK, "", null );
|
||||
static private final IStatus ERROR_STATUS = new Status( IStatus.ERROR, "org.eclipse.cdt.core", IStatus.ERROR, "", null );
|
||||
static private final IStatus OK_STATUS = new Status( IStatus.OK, "org.eclipse.cdt.core", IStatus.OK, "", null ); //$NON-NLS-1$//$NON-NLS-2$
|
||||
static private final IStatus ERROR_STATUS = new Status( IStatus.ERROR, "org.eclipse.cdt.core", IStatus.ERROR, "", null ); //$NON-NLS-1$//$NON-NLS-2$
|
||||
|
||||
public static void verbose(String log) {
|
||||
System.out.println("(" + Thread.currentThread() + ") " + log); //$NON-NLS-1$//$NON-NLS-2$
|
||||
|
@ -194,9 +194,9 @@ public abstract class JobManager implements Runnable {
|
|||
String progressString = null;
|
||||
IJob job = currentJob();
|
||||
if( job instanceof IndexRequest ){
|
||||
progressString = " (";
|
||||
progressString = " ("; //$NON-NLS-1$
|
||||
progressString += job.toString();
|
||||
progressString += ")";
|
||||
progressString += ")"; //$NON-NLS-1$
|
||||
}
|
||||
if( indexJob.tickDown( progressString ) == 0 ){
|
||||
indexJob.done( OK_STATUS );
|
||||
|
|
|
@ -153,7 +153,7 @@ HideHeaderFiles.description= Hides all Header files
|
|||
|
||||
WorkInProgress.name=Work In Progress
|
||||
|
||||
CDTIndexerProperty.name=CDT Indexer
|
||||
CDTIndexerProperty.name=C/C++ Indexer
|
||||
|
||||
cDocumentFactory=C Document Factory
|
||||
cDocumentSetupParticipant=C Document Setup Participant
|
||||
|
|
|
@ -43,8 +43,8 @@ ErrorParserBlock.desc=Set the error parsers for this project
|
|||
BinaryParserBlock.label=Binary Parser
|
||||
BinaryParserBlock.desc=Set required binary parser for this project
|
||||
|
||||
IndexerBlock.label=Indexer
|
||||
IndexerBlock.desc=Indexer setting for this project. The indexer is required for search and other related features.
|
||||
IndexerBlock.label=C/C++ Indexer
|
||||
IndexerBlock.desc=C/C++ Indexer setting for this project. The C/C++ indexer is required for C/C++ search and other related features.
|
||||
|
||||
ReferenceBlock.label= Projects
|
||||
ReferenceBlock.desc= Referenced C/C++ Projects
|
||||
|
|
Loading…
Add table
Reference in a new issue