From 2f65266115980f73b61fd504617d2b18d49b5c37 Mon Sep 17 00:00:00 2001 From: Martin Weber Date: Thu, 8 Jul 2021 23:13:36 +0200 Subject: [PATCH] Bug 564349 - rename classes with 'Indexer' in name to sth. more appropriate Change-Id: I3247f3a001a6d0f882a6b4c674b1c7c0f74b1b9e Signed-off-by: Martin Weber --- .../internal/CMakeBuildConfiguration.java | 4 +-- .../builtins/GccOutputProcessorTest.java | 4 +-- .../plugin.xml | 4 +-- ...cePage.java => JsonCdbPreferencePage.java} | 14 +++++----- .../jsoncdb/core/ui/internal/Messages.java | 8 +++--- .../core/ui/internal/messages.properties | 8 +++--- .../core/CompileCommandsJsonParser.java | 26 +++++++++---------- ...umer.java => ISourceFileInfoConsumer.java} | 4 +-- .../cdt/jsoncdb/core/ParseRequest.java | 6 ++--- .../jsoncdb/core/internal/ParseContext.java | 4 +-- .../builtins/CompilerBuiltinsDetector.java | 6 ++--- ...ndexerInfo.java => RawSourceFileInfo.java} | 8 +++--- .../cdt/jsoncdb/core/participant/IArglet.java | 2 +- ...dexerInfo.java => IRawSourceFileInfo.java} | 2 +- ....java => IRawSourceFileInfoCollector.java} | 2 +- .../participant/IToolCommandlineParser.java | 2 +- .../builtins/GccOutputProcessor.java | 4 +-- .../builtins/IBuiltinsOutputProcessor.java | 4 +-- .../participant/builtins/OutputSniffer.java | 6 ++--- .../builtins/NvccOutputProcessorTest.java | 6 ++--- 20 files changed, 62 insertions(+), 62 deletions(-) rename cmake/org.eclipse.cdt.jsoncdb.core.ui/src/org/eclipse/cdt/jsoncdb/core/ui/internal/{IndexerSupportPreferencePage.java => JsonCdbPreferencePage.java} (92%) rename cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/{IIndexerInfoConsumer.java => ISourceFileInfoConsumer.java} (95%) rename cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/internal/builtins/{RawIndexerInfo.java => RawSourceFileInfo.java} (93%) rename cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/participant/{IRawIndexerInfo.java => IRawSourceFileInfo.java} (97%) rename cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/participant/{IRawIndexerInfoCollector.java => IRawSourceFileInfoCollector.java} (97%) diff --git a/cmake/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeBuildConfiguration.java b/cmake/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeBuildConfiguration.java index c7bb2f93d7e..673ec526dc1 100644 --- a/cmake/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeBuildConfiguration.java +++ b/cmake/org.eclipse.cdt.cmake.core/src/org/eclipse/cdt/cmake/core/internal/CMakeBuildConfiguration.java @@ -32,7 +32,7 @@ import org.eclipse.cdt.cmake.core.properties.ICMakeProperties; import org.eclipse.cdt.cmake.core.properties.ICMakePropertiesController; import org.eclipse.cdt.cmake.core.properties.IOsOverrides; import org.eclipse.cdt.jsoncdb.core.CompileCommandsJsonParser; -import org.eclipse.cdt.jsoncdb.core.IIndexerInfoConsumer; +import org.eclipse.cdt.jsoncdb.core.ISourceFileInfoConsumer; import org.eclipse.cdt.jsoncdb.core.ParseRequest; import org.eclipse.cdt.core.CommandLauncherManager; import org.eclipse.cdt.core.ConsoleOutputStream; @@ -490,7 +490,7 @@ public class CMakeBuildConfiguration extends CBuildConfiguration { project.deleteMarkers(ICMakeExecutionMarkerFactory.CMAKE_PROBLEM_MARKER_ID, false, IResource.DEPTH_INFINITE); } - private static class CMakeIndexerInfoConsumer implements IIndexerInfoConsumer { + private static class CMakeIndexerInfoConsumer implements ISourceFileInfoConsumer { /** * gathered IScannerInfo objects or null if no new IScannerInfo was received */ diff --git a/cmake/org.eclipse.cdt.jsoncdb.core.tests/src/org/eclipse/cdt/jsoncdb/core/internal/builtins/GccOutputProcessorTest.java b/cmake/org.eclipse.cdt.jsoncdb.core.tests/src/org/eclipse/cdt/jsoncdb/core/internal/builtins/GccOutputProcessorTest.java index 785396adbbc..f2a7342937b 100644 --- a/cmake/org.eclipse.cdt.jsoncdb.core.tests/src/org/eclipse/cdt/jsoncdb/core/internal/builtins/GccOutputProcessorTest.java +++ b/cmake/org.eclipse.cdt.jsoncdb.core.tests/src/org/eclipse/cdt/jsoncdb/core/internal/builtins/GccOutputProcessorTest.java @@ -41,13 +41,13 @@ public class GccOutputProcessorTest { @Test @Ignore public void testProcessLine() { - testee.processLine("#define AAA xyz", new RawIndexerInfo()); + testee.processLine("#define AAA xyz", new RawSourceFileInfo()); } @Test public void testProcessFile() throws IOException { // pass resource content line-wise to the testee... - RawIndexerInfo pc = new RawIndexerInfo(); + RawSourceFileInfo pc = new RawSourceFileInfo(); try (InputStream is = getClass().getResourceAsStream("cbd-gcc.output.txt"); OutputSniffer os = new OutputSniffer(testee, null, pc)) { byte[] buffer = new byte[1024]; diff --git a/cmake/org.eclipse.cdt.jsoncdb.core.ui/plugin.xml b/cmake/org.eclipse.cdt.jsoncdb.core.ui/plugin.xml index 22f161f6160..828a7e9ce1e 100644 --- a/cmake/org.eclipse.cdt.jsoncdb.core.ui/plugin.xml +++ b/cmake/org.eclipse.cdt.jsoncdb.core.ui/plugin.xml @@ -5,8 +5,8 @@ point="org.eclipse.ui.preferencePages"> diff --git a/cmake/org.eclipse.cdt.jsoncdb.core.ui/src/org/eclipse/cdt/jsoncdb/core/ui/internal/IndexerSupportPreferencePage.java b/cmake/org.eclipse.cdt.jsoncdb.core.ui/src/org/eclipse/cdt/jsoncdb/core/ui/internal/JsonCdbPreferencePage.java similarity index 92% rename from cmake/org.eclipse.cdt.jsoncdb.core.ui/src/org/eclipse/cdt/jsoncdb/core/ui/internal/IndexerSupportPreferencePage.java rename to cmake/org.eclipse.cdt.jsoncdb.core.ui/src/org/eclipse/cdt/jsoncdb/core/ui/internal/JsonCdbPreferencePage.java index c0bdbe98b74..975d3dd3d77 100644 --- a/cmake/org.eclipse.cdt.jsoncdb.core.ui/src/org/eclipse/cdt/jsoncdb/core/ui/internal/IndexerSupportPreferencePage.java +++ b/cmake/org.eclipse.cdt.jsoncdb.core.ui/src/org/eclipse/cdt/jsoncdb/core/ui/internal/JsonCdbPreferencePage.java @@ -39,17 +39,17 @@ import org.osgi.framework.FrameworkUtil; /** * Preference page for JSON Compilation Database Parser. */ -public class IndexerSupportPreferencePage extends PreferencePage implements IWorkbenchPreferencePage { +public class JsonCdbPreferencePage extends PreferencePage implements IWorkbenchPreferencePage { private Text pattern; private Button btnVersionsEnabled; private Button btnWithConsole; private final IParserPreferencesAccess prefsAccess; - public IndexerSupportPreferencePage() { + public JsonCdbPreferencePage() { prefsAccess = EclipseContextFactory.getServiceContext(FrameworkUtil.getBundle(getClass()).getBundleContext()) .get(IParserPreferencesAccess.class); - setDescription(Messages.IndexerSupportPreferencePage_description); + setDescription(Messages.JsonCdbPreferencePage_description); } /** @@ -64,13 +64,13 @@ public class IndexerSupportPreferencePage extends PreferencePage implements IWor composite.setLayout(new GridLayout(1, false)); GridDataFactory.swtDefaults().applyTo(composite); - final Group gr = createGroup(composite, SWT.FILL, 1, - Messages.IndexerSupportPreferencePage_label_version_suffix_group, 2); + final Group gr = createGroup(composite, SWT.FILL, 1, Messages.JsonCdbPreferencePage_label_version_suffix_group, + 2); btnVersionsEnabled = createCheckbox(gr, SWT.BEGINNING, 2, prefsMeta.tryVersionSuffix()); btnVersionsEnabled.setSelection(prefs.getTryVersionSuffix()); { Label label = new Label(gr, SWT.NONE); - label.setText(Messages.IndexerSupportPreferencePage_label_suffix_pattern); + label.setText(Messages.JsonCdbPreferencePage_label_suffix_pattern); GridDataFactory.defaultsFor(label).applyTo(label); } @@ -88,7 +88,7 @@ public class IndexerSupportPreferencePage extends PreferencePage implements IWor Pattern.compile(text); setErrorMessage(null); } catch (PatternSyntaxException ex) { - String msg = String.format(Messages.IndexerSupportPreferencePage_errmsg_suffix_regex, + String msg = String.format(Messages.JsonCdbPreferencePage_errmsg_suffix_regex, ex.getDescription(), ex.getPattern(), ex.getIndex()); setErrorMessage(msg); } diff --git a/cmake/org.eclipse.cdt.jsoncdb.core.ui/src/org/eclipse/cdt/jsoncdb/core/ui/internal/Messages.java b/cmake/org.eclipse.cdt.jsoncdb.core.ui/src/org/eclipse/cdt/jsoncdb/core/ui/internal/Messages.java index 77bcaaa11f0..9f0862b450e 100644 --- a/cmake/org.eclipse.cdt.jsoncdb.core.ui/src/org/eclipse/cdt/jsoncdb/core/ui/internal/Messages.java +++ b/cmake/org.eclipse.cdt.jsoncdb.core.ui/src/org/eclipse/cdt/jsoncdb/core/ui/internal/Messages.java @@ -19,10 +19,10 @@ import org.eclipse.osgi.util.NLS; */ public class Messages extends NLS { private static final String BUNDLE_NAME = "org.eclipse.cdt.jsoncdb.core.ui.internal.messages"; //$NON-NLS-1$ - public static String IndexerSupportPreferencePage_description; - public static String IndexerSupportPreferencePage_errmsg_suffix_regex; - public static String IndexerSupportPreferencePage_label_suffix_pattern; - public static String IndexerSupportPreferencePage_label_version_suffix_group; + public static String JsonCdbPreferencePage_description; + public static String JsonCdbPreferencePage_errmsg_suffix_regex; + public static String JsonCdbPreferencePage_label_suffix_pattern; + public static String JsonCdbPreferencePage_label_version_suffix_group; static { // initialize resource bundle NLS.initializeMessages(BUNDLE_NAME, Messages.class); diff --git a/cmake/org.eclipse.cdt.jsoncdb.core.ui/src/org/eclipse/cdt/jsoncdb/core/ui/internal/messages.properties b/cmake/org.eclipse.cdt.jsoncdb.core.ui/src/org/eclipse/cdt/jsoncdb/core/ui/internal/messages.properties index 4beadc880de..17e83b5df14 100644 --- a/cmake/org.eclipse.cdt.jsoncdb.core.ui/src/org/eclipse/cdt/jsoncdb/core/ui/internal/messages.properties +++ b/cmake/org.eclipse.cdt.jsoncdb.core.ui/src/org/eclipse/cdt/jsoncdb/core/ui/internal/messages.properties @@ -11,7 +11,7 @@ # Contributors: # Martin Weber - initial API and implementation ############################################################################### -IndexerSupportPreferencePage_description=Configure how macros and include paths get extracted from the compile_commands.json file -IndexerSupportPreferencePage_errmsg_suffix_regex=Suffix pattern regular expression: %1$s in '%2$s' at index %3$d -IndexerSupportPreferencePage_label_suffix_pattern=&Suffix pattern: -IndexerSupportPreferencePage_label_version_suffix_group=For compilers with version in name +JsonCdbPreferencePage_description=Configure how macros and include paths get extracted from the compile_commands.json file +JsonCdbPreferencePage_errmsg_suffix_regex=Suffix pattern regular expression: %1$s in '%2$s' at index %3$d +JsonCdbPreferencePage_label_suffix_pattern=&Suffix pattern: +JsonCdbPreferencePage_label_version_suffix_group=For compilers with version in name diff --git a/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/CompileCommandsJsonParser.java b/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/CompileCommandsJsonParser.java index 4261a28a01b..5598598a819 100644 --- a/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/CompileCommandsJsonParser.java +++ b/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/CompileCommandsJsonParser.java @@ -32,7 +32,7 @@ import org.eclipse.cdt.jsoncdb.core.internal.ParserDetection.ParserDetectionResu import org.eclipse.cdt.jsoncdb.core.internal.Plugin; import org.eclipse.cdt.jsoncdb.core.internal.builtins.CompilerBuiltinsDetector; import org.eclipse.cdt.jsoncdb.core.participant.DefaultToolDetectionParticipant; -import org.eclipse.cdt.jsoncdb.core.participant.IRawIndexerInfo; +import org.eclipse.cdt.jsoncdb.core.participant.IRawSourceFileInfo; import org.eclipse.cdt.jsoncdb.core.participant.IToolCommandlineParser; import org.eclipse.cdt.jsoncdb.core.participant.IToolCommandlineParser.IResult; import org.eclipse.cdt.jsoncdb.core.participant.IToolDetectionParticipant; @@ -100,7 +100,7 @@ public class CompileCommandsJsonParser { * the raw scanner info results for each source file (source file name -> * IResult) */ - private Map fileResults; + private Map fileResults; /** * minimized set of CompilerBuiltinsDetector to run. (detector key -> @@ -272,9 +272,9 @@ public class CompileCommandsJsonParser { java.nio.file.Path buildDir = java.nio.file.Path.of(buildRootFolder.getLocationURI()); // run each built-in detector and collect the results.. - Map builtinDetectorsResults = new HashMap<>(); + Map builtinDetectorsResults = new HashMap<>(); for (Entry entry : builtinDetectorsToRun.entrySet()) { - IRawIndexerInfo result = entry.getValue().detectBuiltins(jsonFile.getProject(), buildDir, + IRawSourceFileInfo result = entry.getValue().detectBuiltins(jsonFile.getProject(), buildDir, parseRequest.getLauncher(), parseRequest.getConsole(), monitor); // store detector key with result builtinDetectorsResults.put(entry.getKey(), result); @@ -294,8 +294,8 @@ public class CompileCommandsJsonParser { // merge built-in results with source file results for (Entry link : fileToBuiltinDetectorLinks.entrySet()) { String sourceFileName = link.getKey(); - IRawIndexerInfo fileResult = fileResults.get(sourceFileName); - IRawIndexerInfo builtinDetectorsResult = builtinDetectorsResults.get(link.getValue()); + IRawSourceFileInfo fileResult = fileResults.get(sourceFileName); + IRawSourceFileInfo builtinDetectorsResult = builtinDetectorsResults.get(link.getValue()); mergeResultsForFile(stringPooler, sourceFileName, fileResult, builtinDetectorsResult); } } @@ -303,7 +303,7 @@ public class CompileCommandsJsonParser { /** * Merges preprocessor symbols and macros for a source file with compiler * built-in preprocessor symbols and macros and passes the to the - * {@code IIndexerInfoConsumer} that was specified in the constructor. + * {@code ISourceFileInfoConsumer} that was specified in the constructor. * * @param fileResult source file preprocessor symbols and macros * @param builtinDetectorsResult compiler built-in preprocessor symbols and @@ -313,7 +313,7 @@ public class CompileCommandsJsonParser { * @param sourceFileName the name of the source file */ private void mergeResultsForFile(Function stringPooler, String sourceFileName, - IRawIndexerInfo fileResult, IRawIndexerInfo builtinDetectorsResult) { + IRawSourceFileInfo fileResult, IRawSourceFileInfo builtinDetectorsResult) { /* * Handling of -U and -D is ambivalent here. - The GCC man page states: '-U name * Cancel any previous definition of name, either built in or provided with a -D @@ -344,8 +344,8 @@ public class CompileCommandsJsonParser { List includeFiles = fileResult.getIncludeFiles(); // feed the paths and defines with the file name to the indexer.. - parseRequest.getIndexerInfoConsumer().acceptSourceFileInfo(sourceFileName, systemIncludePaths, effectiveDefines, - includePaths, macroFiles, includeFiles); + parseRequest.getSourceFileInfoConsumer().acceptSourceFileInfo(sourceFileName, systemIncludePaths, + effectiveDefines, includePaths, macroFiles, includeFiles); } private static void createMarker(IResource rc, String message) throws CoreException { @@ -417,7 +417,7 @@ public class CompileCommandsJsonParser { * Parses the {@code compile_commands.json} file in the build directory of the * build configuration if necessary and generates indexer information. If the JSON file did not change since the last invocation * of this method on the same build configuration, parsing of the file will be skipped; that is: - * Method {@link IIndexerInfoConsumer#accept()} is not invoked. + * Method {@link ISourceFileInfoConsumer#accept()} is not invoked. * @param monitor the job's progress monitor * * @return {@code true} if the {@code compile_commands.json} file did change @@ -440,7 +440,7 @@ public class CompileCommandsJsonParser { } return processJsonFile(monitor); } finally { - parseRequest.getIndexerInfoConsumer().shutdown(); + parseRequest.getSourceFileInfoConsumer().shutdown(); if (DEBUG_TIME) { long end = System.currentTimeMillis(); System.out.printf("Parsed file '%s' in %dms%n", //$NON-NLS-1$ @@ -492,7 +492,7 @@ public class CompileCommandsJsonParser { * @param file * @param result */ - private void rememberFileResult(String sourceFileName, IRawIndexerInfo result) { + private void rememberFileResult(String sourceFileName, IRawSourceFileInfo result) { fileResults.put(sourceFileName, result); } diff --git a/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/IIndexerInfoConsumer.java b/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/ISourceFileInfoConsumer.java similarity index 95% rename from cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/IIndexerInfoConsumer.java rename to cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/ISourceFileInfoConsumer.java index 230d361eed7..153c6087cff 100644 --- a/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/IIndexerInfoConsumer.java +++ b/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/ISourceFileInfoConsumer.java @@ -22,13 +22,13 @@ import java.util.Map; * * @author weber */ -public interface IIndexerInfoConsumer { +public interface ISourceFileInfoConsumer { // Cmake writes filenames with forward slashes (/) even if it runs on windows. // OTOH, IScannerInfoProvider requests info for IResourceS. // Somewhere in the calling sequence, the filenames have to be converted/mapped to IResource. Conversion *could* // be done in CompileCommandsJsonParser, but when I think of builds running // in a Linux-Docker-Container under windows, it might be better to do the conversion - // on the IIndexerInfoConsumer side which has more information on the build setup. + // on the ISourceFileInfoConsumer side which has more information on the build setup. /** Adds indexer relevant information for a single source file. * diff --git a/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/ParseRequest.java b/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/ParseRequest.java index 6b5c91f931d..59b64c031c9 100644 --- a/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/ParseRequest.java +++ b/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/ParseRequest.java @@ -23,7 +23,7 @@ import org.eclipse.core.resources.IFile; */ public final class ParseRequest { private final IFile compileCommandsJson; - private final IIndexerInfoConsumer indexerInfoConsumer; + private final ISourceFileInfoConsumer indexerInfoConsumer; private final ICommandLauncher launcher; private final IConsole console; @@ -39,7 +39,7 @@ public final class ParseRequest { * detection to or null if no console output is requested. * Ignored if workspace preferences indicate that no console output is wanted. */ - public ParseRequest(IFile compileCommandsJsonFile, IIndexerInfoConsumer indexerInfoConsumer, + public ParseRequest(IFile compileCommandsJsonFile, ISourceFileInfoConsumer indexerInfoConsumer, ICommandLauncher launcher, IConsole console) { this.compileCommandsJson = Objects.requireNonNull(compileCommandsJsonFile, "compileCommandsJsonFile"); //$NON-NLS-1$ this.indexerInfoConsumer = Objects.requireNonNull(indexerInfoConsumer, "indexerInfoConsumer"); //$NON-NLS-1$ @@ -56,7 +56,7 @@ public final class ParseRequest { /** Gets the object that receives the indexer relevant * information for each source file */ - public IIndexerInfoConsumer getIndexerInfoConsumer() { + public ISourceFileInfoConsumer getSourceFileInfoConsumer() { return indexerInfoConsumer; } diff --git a/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/internal/ParseContext.java b/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/internal/ParseContext.java index 191b2b00fc0..0db1ccdd35d 100644 --- a/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/internal/ParseContext.java +++ b/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/internal/ParseContext.java @@ -12,7 +12,7 @@ package org.eclipse.cdt.jsoncdb.core.internal; import java.util.ArrayList; import java.util.List; -import org.eclipse.cdt.jsoncdb.core.internal.builtins.RawIndexerInfo; +import org.eclipse.cdt.jsoncdb.core.internal.builtins.RawSourceFileInfo; import org.eclipse.cdt.jsoncdb.core.participant.IArglet; import org.eclipse.cdt.jsoncdb.core.participant.IToolCommandlineParser; @@ -21,7 +21,7 @@ import org.eclipse.cdt.jsoncdb.core.participant.IToolCommandlineParser; * * @author Martin Weber */ -public final class ParseContext extends RawIndexerInfo +public final class ParseContext extends RawSourceFileInfo implements IArglet.IArgumentCollector, IToolCommandlineParser.IResult { private final List args = new ArrayList<>(); diff --git a/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/internal/builtins/CompilerBuiltinsDetector.java b/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/internal/builtins/CompilerBuiltinsDetector.java index f9ce6275e03..02b386346b9 100644 --- a/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/internal/builtins/CompilerBuiltinsDetector.java +++ b/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/internal/builtins/CompilerBuiltinsDetector.java @@ -20,7 +20,7 @@ import java.util.Objects; import org.eclipse.cdt.jsoncdb.core.IParserPreferences; import org.eclipse.cdt.jsoncdb.core.IParserPreferencesAccess; import org.eclipse.cdt.jsoncdb.core.internal.Plugin; -import org.eclipse.cdt.jsoncdb.core.participant.IRawIndexerInfo; +import org.eclipse.cdt.jsoncdb.core.participant.IRawSourceFileInfo; import org.eclipse.cdt.jsoncdb.core.participant.builtins.IBuiltinsDetectionBehavior; import org.eclipse.cdt.jsoncdb.core.participant.builtins.IBuiltinsOutputProcessor; import org.eclipse.cdt.jsoncdb.core.participant.builtins.OutputSniffer; @@ -86,7 +86,7 @@ public class CompilerBuiltinsDetector { * null if no console output is requested. * @throws CoreException */ - public IRawIndexerInfo detectBuiltins(IProject project, java.nio.file.Path buildDirectory, + public IRawSourceFileInfo detectBuiltins(IProject project, java.nio.file.Path buildDirectory, ICommandLauncher launcher, IConsole console, IProgressMonitor monitor) throws CoreException { this.project = Objects.requireNonNull(project, "project"); //$NON-NLS-1$ this.buildDirectory = Objects.requireNonNull(buildDirectory, "buildDirectory"); //$NON-NLS-1$ @@ -95,7 +95,7 @@ public class CompilerBuiltinsDetector { monitor = new NullProgressMonitor(); } - RawIndexerInfo result = new RawIndexerInfo(); + RawSourceFileInfo result = new RawSourceFileInfo(); final List argList = getCompilerArguments(); argList.addAll(builtinsDetectionArgs); diff --git a/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/internal/builtins/RawIndexerInfo.java b/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/internal/builtins/RawSourceFileInfo.java similarity index 93% rename from cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/internal/builtins/RawIndexerInfo.java rename to cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/internal/builtins/RawSourceFileInfo.java index 63e6ec30263..a7c7daf95ff 100644 --- a/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/internal/builtins/RawIndexerInfo.java +++ b/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/internal/builtins/RawSourceFileInfo.java @@ -21,16 +21,16 @@ import java.util.Map.Entry; import java.util.Objects; import org.eclipse.cdt.jsoncdb.core.internal.Plugin; -import org.eclipse.cdt.jsoncdb.core.participant.IRawIndexerInfo; -import org.eclipse.cdt.jsoncdb.core.participant.IRawIndexerInfoCollector; +import org.eclipse.cdt.jsoncdb.core.participant.IRawSourceFileInfoCollector; +import org.eclipse.cdt.jsoncdb.core.participant.IRawSourceFileInfo; import org.eclipse.core.runtime.Platform; /** - * Default implementation of IRawIndexerInfo. + * Default implementation of IRawSourceFileInfo. * * @author weber */ -public class RawIndexerInfo implements IRawIndexerInfo, IRawIndexerInfoCollector { +public class RawSourceFileInfo implements IRawSourceFileInfo, IRawSourceFileInfoCollector { @SuppressWarnings("nls") private static final boolean DEBUG = Boolean diff --git a/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/participant/IArglet.java b/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/participant/IArglet.java index 5fb6a4daa8c..56c63524753 100644 --- a/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/participant/IArglet.java +++ b/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/participant/IArglet.java @@ -41,7 +41,7 @@ public interface IArglet { * * @author Martin Weber */ - interface IArgumentCollector extends IRawIndexerInfoCollector { + interface IArgumentCollector extends IRawSourceFileInfoCollector { /** * Adds a compiler argument that affects built-in detection. For the GNU * compilers, these are options like {@code --sysroot} and options that specify diff --git a/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/participant/IRawIndexerInfo.java b/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/participant/IRawSourceFileInfo.java similarity index 97% rename from cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/participant/IRawIndexerInfo.java rename to cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/participant/IRawSourceFileInfo.java index fdb675da700..981ded20dcb 100644 --- a/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/participant/IRawIndexerInfo.java +++ b/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/participant/IRawSourceFileInfo.java @@ -20,7 +20,7 @@ import java.util.Map; * * @author weber */ -public interface IRawIndexerInfo { +public interface IRawSourceFileInfo { /** * Gets the preprocessor symbols (macro definition)s. */ diff --git a/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/participant/IRawIndexerInfoCollector.java b/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/participant/IRawSourceFileInfoCollector.java similarity index 97% rename from cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/participant/IRawIndexerInfoCollector.java rename to cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/participant/IRawSourceFileInfoCollector.java index f225d67f418..e4828416ef2 100644 --- a/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/participant/IRawIndexerInfoCollector.java +++ b/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/participant/IRawSourceFileInfoCollector.java @@ -17,7 +17,7 @@ package org.eclipse.cdt.jsoncdb.core.participant; * * @author weber */ -public interface IRawIndexerInfoCollector { +public interface IRawSourceFileInfoCollector { /** * Adds a preprocessor symbol (macro definition). diff --git a/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/participant/IToolCommandlineParser.java b/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/participant/IToolCommandlineParser.java index f78d00249a8..002e22160d8 100644 --- a/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/participant/IToolCommandlineParser.java +++ b/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/participant/IToolCommandlineParser.java @@ -49,7 +49,7 @@ public interface IToolCommandlineParser { * * @see IToolCommandlineParser#processArgs(IPath, String) */ - interface IResult extends IRawIndexerInfo { + interface IResult extends IRawSourceFileInfo { /** * Gets the compiler arguments from the command-line that affect built-in * detection. For the GNU compilers, these are options like {@code --sysroot} diff --git a/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/participant/builtins/GccOutputProcessor.java b/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/participant/builtins/GccOutputProcessor.java index a04dd267ed7..ba34ef028d2 100644 --- a/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/participant/builtins/GccOutputProcessor.java +++ b/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/participant/builtins/GccOutputProcessor.java @@ -13,7 +13,7 @@ import java.util.Optional; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.eclipse.cdt.jsoncdb.core.participant.IRawIndexerInfoCollector; +import org.eclipse.cdt.jsoncdb.core.participant.IRawSourceFileInfoCollector; import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry; import org.eclipse.cdt.core.settings.model.ICSettingEntry; import org.eclipse.cdt.core.settings.model.util.CDataUtil; @@ -50,7 +50,7 @@ public final class GccOutputProcessor implements IBuiltinsOutputProcessor { @SuppressWarnings("nls") @Override - public void processLine(String line, IRawIndexerInfoCollector infoCollector) { + public void processLine(String line, IRawSourceFileInfoCollector infoCollector) { // include paths if (line.equals("#include \"...\" search starts here:")) { diff --git a/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/participant/builtins/IBuiltinsOutputProcessor.java b/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/participant/builtins/IBuiltinsOutputProcessor.java index 3f4977328f2..e75676d2211 100644 --- a/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/participant/builtins/IBuiltinsOutputProcessor.java +++ b/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/participant/builtins/IBuiltinsOutputProcessor.java @@ -9,7 +9,7 @@ package org.eclipse.cdt.jsoncdb.core.participant.builtins; -import org.eclipse.cdt.jsoncdb.core.participant.IRawIndexerInfoCollector; +import org.eclipse.cdt.jsoncdb.core.participant.IRawSourceFileInfoCollector; /** * Responsible for parsing the output that is produced when a compiler is @@ -25,5 +25,5 @@ public interface IBuiltinsOutputProcessor { * @param infoCollector the buffer that receives the new {@code LanguageSetting} * entries */ - void processLine(String line, IRawIndexerInfoCollector infoCollector); + void processLine(String line, IRawSourceFileInfoCollector infoCollector); } diff --git a/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/participant/builtins/OutputSniffer.java b/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/participant/builtins/OutputSniffer.java index 572dad8e45e..29f69f9ec22 100644 --- a/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/participant/builtins/OutputSniffer.java +++ b/cmake/org.eclipse.cdt.jsoncdb.core/src/org/eclipse/cdt/jsoncdb/core/participant/builtins/OutputSniffer.java @@ -13,7 +13,7 @@ import java.io.IOException; import java.io.OutputStream; import java.util.Objects; -import org.eclipse.cdt.jsoncdb.core.participant.IRawIndexerInfoCollector; +import org.eclipse.cdt.jsoncdb.core.participant.IRawSourceFileInfoCollector; /** * An OutputStream that passes each line written to it to a @@ -28,7 +28,7 @@ public class OutputSniffer extends OutputStream { private static final String SEP = System.lineSeparator(); private final StringBuilder buffer; private final IBuiltinsOutputProcessor processor; - private final IRawIndexerInfoCollector infoCollector; + private final IRawSourceFileInfoCollector infoCollector; private final OutputStream os; /** @@ -37,7 +37,7 @@ public class OutputSniffer extends OutputStream { * and include paths */ public OutputSniffer(IBuiltinsOutputProcessor processor, OutputStream outputStream, - IRawIndexerInfoCollector infoCollector) { + IRawSourceFileInfoCollector infoCollector) { this.processor = Objects.requireNonNull(processor, "processor"); //$NON-NLS-1$ this.infoCollector = Objects.requireNonNull(infoCollector, "infoCollector"); //$NON-NLS-1$ this.os = outputStream; diff --git a/cmake/org.eclipse.cdt.jsoncdb.nvidia.tests/src/org/eclipse/cdt/jsoncdb/nvidia/builtins/NvccOutputProcessorTest.java b/cmake/org.eclipse.cdt.jsoncdb.nvidia.tests/src/org/eclipse/cdt/jsoncdb/nvidia/builtins/NvccOutputProcessorTest.java index eaf3825bde3..21c50b3dd2c 100644 --- a/cmake/org.eclipse.cdt.jsoncdb.nvidia.tests/src/org/eclipse/cdt/jsoncdb/nvidia/builtins/NvccOutputProcessorTest.java +++ b/cmake/org.eclipse.cdt.jsoncdb.nvidia.tests/src/org/eclipse/cdt/jsoncdb/nvidia/builtins/NvccOutputProcessorTest.java @@ -20,7 +20,7 @@ import java.util.List; import java.util.Map; import java.util.Objects; -import org.eclipse.cdt.jsoncdb.core.participant.IRawIndexerInfoCollector; +import org.eclipse.cdt.jsoncdb.core.participant.IRawSourceFileInfoCollector; import org.eclipse.cdt.jsoncdb.core.participant.builtins.GccOutputProcessor; import org.eclipse.cdt.jsoncdb.core.participant.builtins.OutputSniffer; import org.junit.Before; @@ -45,7 +45,7 @@ public class NvccOutputProcessorTest { @Test public void testProcessFile() throws IOException { // pass resource content line-wise to the testee... - RawIndexerInfoMock pc = new RawIndexerInfoMock(); + RawSourceFileInfoMock pc = new RawSourceFileInfoMock(); try (InputStream is = getClass().getResourceAsStream("cbd-nvcc.output.txt"); OutputSniffer os = new OutputSniffer(testee, null, pc)) { byte[] buffer = new byte[1024]; @@ -63,7 +63,7 @@ public class NvccOutputProcessorTest { assertEquals("value", "85", pc.defines.get("__CUDACC_VER_BUILD__")); } - private static class RawIndexerInfoMock implements IRawIndexerInfoCollector { + private static class RawSourceFileInfoMock implements IRawSourceFileInfoCollector { private final Map defines = new HashMap<>(); private final List undefines = new ArrayList<>(); private final List includePaths = new ArrayList<>();