1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-05 00:36:16 +02:00

Patch for Bogda Gheorghe: (44366 & 45324)

- Moved off all dependency calculations to the Indexer thread,
created a new UpdateDependency job
- Modified CSearchOperation to only lock the workspace when
tagging resources with markers.
This commit is contained in:
Doug Schaefer 2003-10-27 20:57:47 +00:00
parent 5df215664c
commit 92669e0062
21 changed files with 1121 additions and 894 deletions

View file

@ -1,298 +1,301 @@
2003-10-03 Sean Evoy
Fix for critical bug 44134.
The problem lies in how the makefile is generated when a build target
references other projects. The makefile creates a command to change to
the build directory of the referenced project and call $(MAKE) there, i.e.
cd <dep_project_build_dir>; $(MAKE) clean all
The problem arises when the directory change fails. As of RC0, the command
after the semi-colon is evaluated. Unfortunately, it evaluates to a recursive
make call in the build directory of the build target and 'make' will keep
invoking more 'make's until Eclipse runs out of memory. With a manual build,
the user can still cancel the build. When autobuild is turned on, they cannot.
The only way to shut down Eclipse under that scenario is to kill it, and when
it restarts, autobuild is still enabled and the problem repeats.
The solution is to NOT perform the 'make' command if the 'cd' fails, i.e.
cd <dep_project_build_dir> && $(MAKE) clean all
When the dependencies are generated this way, the 'cd' will fail as will the
build. The final tweak is to ignore the 'cd' failure and allow the rest of
the build to continue, i.e.
-cd <dep_project_build_dir> && $(MAKE) clean all
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
2003-10-01 Sean Evoy
Final fix for bugs 44020.
The problem lay with the way that new projects were being created when the
root configuration of the project had tool references overriding options.
What the new configuration should have been doing is making a personal copy
of the tool reference and its options. Instead, they were all sharing the
parents. Seems simple enough now that I found it.
OptionReference provides a method to retreive its option (so new
OptionReferences can be cloned).
* src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java
Configuration now behaves correctly when it is created from another configuration.
* src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
2003-10-01 Sean Evoy
Fix for bugs 43490 (trivial), 44020, and 43980.
Added a new field to the schema for a tool. The attribute manages a list of
project natures that the tool should be filtered against in the build model
and UI.
* schema/ManagedBuildTools.exsd
Updated the ITool interface and its mplementors to pay attention to this new
attribute when loading from a plugin file. Clients can querry for a numeric
constant indicating the filter.
* src/org/eclipse/cdt/managedbuilder/core/ITool.java
* src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java
* src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
All the methods in managed build manager that access information stored in a tool
first check that the tool is valid for the project nature.
* src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
Put a safety check in the option reference constructor when reading one in from
a project file. I the option reference is to an option not managed by the build
model, the constructor does not add itself to the runtime representation of the
model.
* src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java
In preparation for 44020, each new target created is assigned a truly random ID.
* src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
2003-09-30 Sean Evoy
Fix for bug 41826.
Finished the use case for changing header files and triggering a build. I had
to add a new attribute to the build model schema to allow a build information
client to determine that a file is considered a header file.
* schema/ManagedBuildTools.exsd
The ITool, and its implementors now have a method to test if an extension is
considered to belong to a header file. The Tool also pays attention to the new
attribute when it reads itself in from the plugin file.
* src/org/eclipse/cdt/managedbuilder/core/ITool.java
* src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java
* src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
There is a method for clients of this information on the BuildInfo interface and
its implementor.
* src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java
* src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
The builder had to be tweaked in order to behave correctly on a build of an
empty project or non-managed projects.
* src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
The makefile generator had to be tweaked to properly add folders that are effected
by header file changes.
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
2003-09-26 Sean Evoy
A partial implementation for bug 41826. This patch contains the logic to properly
respond in the face of the following project changes:
1. A generated project element, such as the build target or an intermediate file,
is deleted in the build project, or any projects it references.
2. The build settings change in the build project or any projects it
references.
In order to actually do this correctly, I had to stop being so precious during the
build. The makefile generator was was calculating the "build needed" state as it
walked the change delta. However, the Eclipse core has already determined that I
need to do a build. Further, as I discovered earlier, it doesn't always pass what
has changed in referenced projects as part of the delta. Essentially, that means I
will never be able to fully calculate the change set in the makefile generator's
delta visitor, and to even approximate a decent set of cases, the logic would quickly
bog down in complexity.
The solution is to trust Eclipse and alway invoke make when my incremental builder
is called. At worst, if there is no significant change, make will execute and
report nothing to be done.
The modified makefile builder no longer asks the makefile generator if it should
build. It also no longer cares if the change set is empty (make will report that).
Since it responds to changes in referenced project's build information, it also
scrubs all relevant projects after building. Since a build might involve building
referenced project elements, those projects get their project views refreshed after
build. The build markers for referenced projects are removed prior to build.
* src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
The makefile generator has been simplified. The resource delta visitor logic no
longer trie to decide if a build should occur. The method to ask has been removed.
The class no longer throws an exception if the change set is empty. I am also a bit
more careful to call make with the right targets if a referenced project is built.
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
2003-09-26 Sean Evoy
I added a fix to the builder and makefile generator to properly handle the following case.
Project A depends on Project B. Something changes in project B and the user requests
that A be built. Inthis case, the incremental builder is invoked, but it is passed a
0-length delta on the top resource. Now, the logic of the builder is to treat that case as a
build event that triggers no makefile regeneration, just an invocation of make.
Now handles the case where there is no flag applied to the make command and just
passes the targets as arguments.
* src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
The makefile generator now considers the case where the delta is for a project resource
and has no children. If so, it flags that a build is needed but no makefile generation
occurs. It also throws a new exception if the top makefile is not saved.
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
2003-09-25 Sean Evoy
A patch to resolve the problem with refreshing the project after a build, or
bug 42522 if you care about those sorts of things. The managed make builder was
calling refresh at inside a bad if statement. I corrected that and projects
refresh correctly. Of course, if you have the wrong binary parser selected you are
hosed. You will also notice that the string constants have been changed to
resolve to a different name. The standard builder uses this name and I wanted
to minimize the possibility of problems later.
* src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
Prepended "Managed" to the externalized string identifiers to avoid future overlap
with the standard build system. Had to update the makefile generator to use the
new identifiers.
* src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
Changed the signature of the 'getMakeArguments' to return a string instead of an
array so the builder can invoke make with the user-specified args. I also changed
the logic of the getMakeCommand method in the implementor so that it only returns
a string containing the command itself.
* src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java
* src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
Explicitly trim all arrays to size before converting them to String[] for Options
and Tools.
*src/org/eclipse/cdt/managedbuilder/internal/core/Option.java
* src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java
Fixed a missing bit of logic in the Configuration when a user-object option is
deleted. Now the build model really does get rid of the the value.
* src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
2003-09-25 Sean Evoy
This patch contains a lot of changes needed to implement fixes for 42648 and
43122.
For 42648, the schema for the the target had to be modified to include a
comma-separated list of valid host platforms.
* schema/ManagedBuildTools.exsd
The target had to be updated to properly read in and understand this info, and
the interface had to be updated to return a list to the clients in the UI. The
target was also changed slightly. It now uses a safer accessor method to get at
the list of tools it maintains. I have also stopped persisting non-variant info
to the project file on serialize. There are elements of the target that are not
subject to change by the user (yet) so they should not be saved.
* src/org/eclipse/cdt/managedbuilder/core/ITarget.java
* src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
For 43122, I started by simply adding a tool reference to the configurations.
The tool reference had option references for debug and optimization levels. It
should have worked, but the model was not handling the inheritance properly. The
JUnit tests were not finding it because of how they were configured. It was most
evident in the UI. So, the way configurations and tool reference search for
overridden option references had to be modified. While I was in there, I cleaned
up some of the accessor and iteration code in ToolReference and OptionReference.
For the configuration, the only significant change was a new search method to
find all option references for a given tool, no matter where they are stored.
The method had to consider what was overridden in a child config, what was added by
a child config, and what the parent (or parents) define.
* src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
Option reference now pays attention to overidden values in the plugin file. Until
now, it only handled the overrides in the project file.
* src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java
The ToolReference now distinguishes between local option references which it
manages directly, and option references held by tool references in the parent(s)
of its owner. It only serializes its own references, but when asked for options
relating to the tool it references, it replies with all option references in its
hierarchy.
* src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
2003-09-25 Bogdan Gheorghe
Modified ResourceDeltaVisitor.visit() to use the new mechanism to get the
projects that dependend a file.
Modified addSourceDependencies() to use the new mechanism to perform a DependencyQueryJob
* src/org/eclipse/cdt/managedbuilder/internal/core/MakeFileGenerator.java
2003-09-24 Sean Evoy
Changed the implementor of IScannerInfo to answer only absolute paths when asked for
includes paths. Users will specify the includes paths in the managed build UI in such a way
that the compiler will not complain. Either they will use absolute paths, or they will specify
them relative to the build directory. In the second case, it is easier for the managed builder
to convert the paths relative to this directory into absolute paths before replying tha it is for
the client to figure this out.
* src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
2003-09-23 Sean Evoy
All the work in this patch is for critical bug 43292. In order to manage
configurations, there had to be a method through ITarget to remove
configurations. Also, to support the naming of newly created configurations,
I added a name method to the IConfiguration interface. Finally, the ITarget
needed to support setting (and resetting) the make command to use when building.
* src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java
* src/org/eclipse/cdt/managedbuilder/core/ITarget.java
* src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
2003-09-19 Sean Evoy
Added a new field to the target specification in the build model to
hard-code the binary parser for project creation. There is a new getter
method in the interface and the implementor contains additional code to
extract the information from a project file or plugin manifest. The
interface also contains new strings to make changing the specification
easier in the future.
* schema/ManagedBuildTools.exsd
* src/org/eclipse/cdt/managedbuilder/core/ITarget.java
* src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
Fix for bug 41720: libraries are now found for Solaris and Linux
executables. The problem was the executable had no extension and
the client of the build model passed null instead of the empty string.
* src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
2003-09-16 Sean Evoy
Patch contains a fix for bug 43017. Renamed the "addDeps" method to a
more descriptive "addSourceDependencies". Added a flag when the
inter-project dependencies are calculated so that clean and all are
properly passed to the make invocation. Finally, I replaced the hard-coded
'make' with $(MAKE)
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
It also contains some more work on 41826, specifically on the logic to
implement a rebuild when the build settings change. The builder checks for
a build model change whenever a build is requested and responds appropriately.
The make targets (i.e. 'clean' and 'all') are also calculated differently now.
* src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
The build model was modified to set a dirty flag when an option changes. I also
made a change to avoid an NPE when the build info was loaded.
* src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java
* src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
* src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java
2003-09-15 Sean Evoy
First submission of code to new project. Moved the managed builder
source code out of the cdt.core project. This includes the code to
implement the build model, along with the shema and extension point
declaration. Moved the builder, scnanaer info provider and managed
nature definitions into the package as well.
There are 2 new classes to handle the externalized strings:
* src/org/eclipse/cdt/managedbuilder/core/ManagedBuilderCorePlugin.java
2003-10-23 Bogdan Gheorghe
Updated the indexManager.perfomConcurrentJob call in MakefileGenerator
2003-10-03 Sean Evoy
Fix for critical bug 44134.
The problem lies in how the makefile is generated when a build target
references other projects. The makefile creates a command to change to
the build directory of the referenced project and call $(MAKE) there, i.e.
cd <dep_project_build_dir>; $(MAKE) clean all
The problem arises when the directory change fails. As of RC0, the command
after the semi-colon is evaluated. Unfortunately, it evaluates to a recursive
make call in the build directory of the build target and 'make' will keep
invoking more 'make's until Eclipse runs out of memory. With a manual build,
the user can still cancel the build. When autobuild is turned on, they cannot.
The only way to shut down Eclipse under that scenario is to kill it, and when
it restarts, autobuild is still enabled and the problem repeats.
The solution is to NOT perform the 'make' command if the 'cd' fails, i.e.
cd <dep_project_build_dir> && $(MAKE) clean all
When the dependencies are generated this way, the 'cd' will fail as will the
build. The final tweak is to ignore the 'cd' failure and allow the rest of
the build to continue, i.e.
-cd <dep_project_build_dir> && $(MAKE) clean all
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
2003-10-01 Sean Evoy
Final fix for bugs 44020.
The problem lay with the way that new projects were being created when the
root configuration of the project had tool references overriding options.
What the new configuration should have been doing is making a personal copy
of the tool reference and its options. Instead, they were all sharing the
parents. Seems simple enough now that I found it.
OptionReference provides a method to retreive its option (so new
OptionReferences can be cloned).
* src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java
Configuration now behaves correctly when it is created from another configuration.
* src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
2003-10-01 Sean Evoy
Fix for bugs 43490 (trivial), 44020, and 43980.
Added a new field to the schema for a tool. The attribute manages a list of
project natures that the tool should be filtered against in the build model
and UI.
* schema/ManagedBuildTools.exsd
Updated the ITool interface and its mplementors to pay attention to this new
attribute when loading from a plugin file. Clients can querry for a numeric
constant indicating the filter.
* src/org/eclipse/cdt/managedbuilder/core/ITool.java
* src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java
* src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
All the methods in managed build manager that access information stored in a tool
first check that the tool is valid for the project nature.
* src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
Put a safety check in the option reference constructor when reading one in from
a project file. I the option reference is to an option not managed by the build
model, the constructor does not add itself to the runtime representation of the
model.
* src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java
In preparation for 44020, each new target created is assigned a truly random ID.
* src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
2003-09-30 Sean Evoy
Fix for bug 41826.
Finished the use case for changing header files and triggering a build. I had
to add a new attribute to the build model schema to allow a build information
client to determine that a file is considered a header file.
* schema/ManagedBuildTools.exsd
The ITool, and its implementors now have a method to test if an extension is
considered to belong to a header file. The Tool also pays attention to the new
attribute when it reads itself in from the plugin file.
* src/org/eclipse/cdt/managedbuilder/core/ITool.java
* src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java
* src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
There is a method for clients of this information on the BuildInfo interface and
its implementor.
* src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java
* src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
The builder had to be tweaked in order to behave correctly on a build of an
empty project or non-managed projects.
* src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
The makefile generator had to be tweaked to properly add folders that are effected
by header file changes.
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
2003-09-26 Sean Evoy
A partial implementation for bug 41826. This patch contains the logic to properly
respond in the face of the following project changes:
1. A generated project element, such as the build target or an intermediate file,
is deleted in the build project, or any projects it references.
2. The build settings change in the build project or any projects it
references.
In order to actually do this correctly, I had to stop being so precious during the
build. The makefile generator was was calculating the "build needed" state as it
walked the change delta. However, the Eclipse core has already determined that I
need to do a build. Further, as I discovered earlier, it doesn't always pass what
has changed in referenced projects as part of the delta. Essentially, that means I
will never be able to fully calculate the change set in the makefile generator's
delta visitor, and to even approximate a decent set of cases, the logic would quickly
bog down in complexity.
The solution is to trust Eclipse and alway invoke make when my incremental builder
is called. At worst, if there is no significant change, make will execute and
report nothing to be done.
The modified makefile builder no longer asks the makefile generator if it should
build. It also no longer cares if the change set is empty (make will report that).
Since it responds to changes in referenced project's build information, it also
scrubs all relevant projects after building. Since a build might involve building
referenced project elements, those projects get their project views refreshed after
build. The build markers for referenced projects are removed prior to build.
* src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
The makefile generator has been simplified. The resource delta visitor logic no
longer trie to decide if a build should occur. The method to ask has been removed.
The class no longer throws an exception if the change set is empty. I am also a bit
more careful to call make with the right targets if a referenced project is built.
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
2003-09-26 Sean Evoy
I added a fix to the builder and makefile generator to properly handle the following case.
Project A depends on Project B. Something changes in project B and the user requests
that A be built. Inthis case, the incremental builder is invoked, but it is passed a
0-length delta on the top resource. Now, the logic of the builder is to treat that case as a
build event that triggers no makefile regeneration, just an invocation of make.
Now handles the case where there is no flag applied to the make command and just
passes the targets as arguments.
* src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
The makefile generator now considers the case where the delta is for a project resource
and has no children. If so, it flags that a build is needed but no makefile generation
occurs. It also throws a new exception if the top makefile is not saved.
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
2003-09-25 Sean Evoy
A patch to resolve the problem with refreshing the project after a build, or
bug 42522 if you care about those sorts of things. The managed make builder was
calling refresh at inside a bad if statement. I corrected that and projects
refresh correctly. Of course, if you have the wrong binary parser selected you are
hosed. You will also notice that the string constants have been changed to
resolve to a different name. The standard builder uses this name and I wanted
to minimize the possibility of problems later.
* src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
Prepended "Managed" to the externalized string identifiers to avoid future overlap
with the standard build system. Had to update the makefile generator to use the
new identifiers.
* src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
Changed the signature of the 'getMakeArguments' to return a string instead of an
array so the builder can invoke make with the user-specified args. I also changed
the logic of the getMakeCommand method in the implementor so that it only returns
a string containing the command itself.
* src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java
* src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
Explicitly trim all arrays to size before converting them to String[] for Options
and Tools.
*src/org/eclipse/cdt/managedbuilder/internal/core/Option.java
* src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java
Fixed a missing bit of logic in the Configuration when a user-object option is
deleted. Now the build model really does get rid of the the value.
* src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
2003-09-25 Sean Evoy
This patch contains a lot of changes needed to implement fixes for 42648 and
43122.
For 42648, the schema for the the target had to be modified to include a
comma-separated list of valid host platforms.
* schema/ManagedBuildTools.exsd
The target had to be updated to properly read in and understand this info, and
the interface had to be updated to return a list to the clients in the UI. The
target was also changed slightly. It now uses a safer accessor method to get at
the list of tools it maintains. I have also stopped persisting non-variant info
to the project file on serialize. There are elements of the target that are not
subject to change by the user (yet) so they should not be saved.
* src/org/eclipse/cdt/managedbuilder/core/ITarget.java
* src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
For 43122, I started by simply adding a tool reference to the configurations.
The tool reference had option references for debug and optimization levels. It
should have worked, but the model was not handling the inheritance properly. The
JUnit tests were not finding it because of how they were configured. It was most
evident in the UI. So, the way configurations and tool reference search for
overridden option references had to be modified. While I was in there, I cleaned
up some of the accessor and iteration code in ToolReference and OptionReference.
For the configuration, the only significant change was a new search method to
find all option references for a given tool, no matter where they are stored.
The method had to consider what was overridden in a child config, what was added by
a child config, and what the parent (or parents) define.
* src/org/eclipse/cdt/managedbuilder/internal/core/Configuration.java
Option reference now pays attention to overidden values in the plugin file. Until
now, it only handled the overrides in the project file.
* src/org/eclipse/cdt/managedbuilder/internal/core/OptionReference.java
The ToolReference now distinguishes between local option references which it
manages directly, and option references held by tool references in the parent(s)
of its owner. It only serializes its own references, but when asked for options
relating to the tool it references, it replies with all option references in its
hierarchy.
* src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
2003-09-25 Bogdan Gheorghe
Modified ResourceDeltaVisitor.visit() to use the new mechanism to get the
projects that dependend a file.
Modified addSourceDependencies() to use the new mechanism to perform a DependencyQueryJob
* src/org/eclipse/cdt/managedbuilder/internal/core/MakeFileGenerator.java
2003-09-24 Sean Evoy
Changed the implementor of IScannerInfo to answer only absolute paths when asked for
includes paths. Users will specify the includes paths in the managed build UI in such a way
that the compiler will not complain. Either they will use absolute paths, or they will specify
them relative to the build directory. In the second case, it is easier for the managed builder
to convert the paths relative to this directory into absolute paths before replying tha it is for
the client to figure this out.
* src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
2003-09-23 Sean Evoy
All the work in this patch is for critical bug 43292. In order to manage
configurations, there had to be a method through ITarget to remove
configurations. Also, to support the naming of newly created configurations,
I added a name method to the IConfiguration interface. Finally, the ITarget
needed to support setting (and resetting) the make command to use when building.
* src/org/eclipse/cdt/managedbuilder/core/IConfiguration.java
* src/org/eclipse/cdt/managedbuilder/core/ITarget.java
* src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
2003-09-19 Sean Evoy
Added a new field to the target specification in the build model to
hard-code the binary parser for project creation. There is a new getter
method in the interface and the implementor contains additional code to
extract the information from a project file or plugin manifest. The
interface also contains new strings to make changing the specification
easier in the future.
* schema/ManagedBuildTools.exsd
* src/org/eclipse/cdt/managedbuilder/core/ITarget.java
* src/org/eclipse/cdt/managedbuilder/internal/core/Target.java
Fix for bug 41720: libraries are now found for Solaris and Linux
executables. The problem was the executable had no extension and
the client of the build model passed null instead of the empty string.
* src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
2003-09-16 Sean Evoy
Patch contains a fix for bug 43017. Renamed the "addDeps" method to a
more descriptive "addSourceDependencies". Added a flag when the
inter-project dependencies are calculated so that clean and all are
properly passed to the make invocation. Finally, I replaced the hard-coded
'make' with $(MAKE)
* src/org/eclipse/cdt/managedbuilder/internal/core/MakefileGenerator.java
It also contains some more work on 41826, specifically on the logic to
implement a rebuild when the build settings change. The builder checks for
a build model change whenever a build is requested and responds appropriately.
The make targets (i.e. 'clean' and 'all') are also calculated differently now.
* src/org/eclipse/cdt/managedbuilder/internal/core/GeneratedMakefileBuilder.java
The build model was modified to set a dirty flag when an option changes. I also
made a change to avoid an NPE when the build info was loaded.
* src/org/eclipse/cdt/managedbuilder/core/IManagedBuildInfo.java
* src/org/eclipse/cdt/managedbuilder/internal/core/ManagedBuildInfo.java
* src/org/eclipse/cdt/managedbuilder/core/ManagedBuildManager.java
2003-09-15 Sean Evoy
First submission of code to new project. Moved the managed builder
source code out of the cdt.core project. This includes the code to
implement the build model, along with the shema and extension point
declaration. Moved the builder, scnanaer info provider and managed
nature definitions into the package as well.
There are 2 new classes to handle the externalized strings:
* src/org/eclipse/cdt/managedbuilder/core/ManagedBuilderCorePlugin.java
* src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties

View file

@ -161,7 +161,7 @@ public class MakefileGenerator {
pathCollector,
indexManager),
ICSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
null);
null, null);
// We will get back an array of resource names relative to the workspace
String[] deps = pathCollector.getPaths();
@ -341,7 +341,7 @@ public class MakefileGenerator {
// ASk the dep generator to find all the deps for this resource
ArrayList dependencies = new ArrayList();
try {
indexManager.performConcurrentJob(new DependencyQueryJob(project, (IFile)resource, indexManager, dependencies), ICSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, null);
indexManager.performConcurrentJob(new DependencyQueryJob(project, (IFile)resource, indexManager, dependencies), ICSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, null, null);
} catch (Exception e) {
continue;
}

View file

@ -15,7 +15,6 @@ import java.util.Arrays;
import java.util.Iterator;
import java.util.Set;
import junit.extensions.TestDecorator;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
@ -143,7 +142,7 @@ import org.eclipse.core.runtime.Platform;
String[] depTest2Model = {File.separator + "DepTestProject" + File.separator + "d.h", File.separator + "DepTestProject" + File.separator + "DepTest2.h"};
ArrayList includes = new ArrayList();
indexManager.performConcurrentJob(new DependencyQueryJob(testProject,depTest,indexManager,includes),ICSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,null);
indexManager.performConcurrentJob(new DependencyQueryJob(testProject,depTest,indexManager,includes),ICSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,null,null);
String[] depTestModelLocal = convertToLocalPath(depTestModel);
String[] depTestIncludes = new String[includes.size()];
@ -166,7 +165,7 @@ import org.eclipse.core.runtime.Platform;
}
ArrayList includes2 = new ArrayList();
indexManager.performConcurrentJob(new DependencyQueryJob(testProject,depTest2,indexManager,includes2),ICSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,null);
indexManager.performConcurrentJob(new DependencyQueryJob(testProject,depTest2,indexManager,includes2),ICSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,null,null);
String[] depTest2ModelLocal = convertToLocalPath(depTest2Model);
String[] depTest2Includes = new String[includes2.size()];
@ -345,7 +344,7 @@ import org.eclipse.core.runtime.Platform;
String[] preDepTestModel = {File.separator + "DepTestProject" + File.separator + "DepTest.h", File.separator + "DepTestProject" + File.separator + "Inc1.h", File.separator + "DepTestProject" + File.separator + "a.h", File.separator + "DepTestProject" + File.separator + "c.h", File.separator + "DepTestProject" + File.separator + "d.h"};
ArrayList includes = new ArrayList();
indexManager.performConcurrentJob(new DependencyQueryJob(testProject,depTestC,indexManager,includes),ICSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,null);
indexManager.performConcurrentJob(new DependencyQueryJob(testProject,depTestC,indexManager,includes),ICSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,null, null);
String[] preDepTestModelLocal = convertToLocalPath(preDepTestModel);
String[] preDepTestIncludes = new String[includes.size()];
@ -374,7 +373,7 @@ import org.eclipse.core.runtime.Platform;
testProject.refreshLocal(IResource.DEPTH_INFINITE,null);
indexManager.performConcurrentJob(new DependencyQueryJob(testProject,depTestC,indexManager,includes2),ICSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,null);
indexManager.performConcurrentJob(new DependencyQueryJob(testProject,depTestC,indexManager,includes2),ICSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,null, null);
String[] postDepTestModelLocal = convertToLocalPath(postDepTestModel);
@ -412,7 +411,7 @@ import org.eclipse.core.runtime.Platform;
String[] preDepTestModel = {File.separator + "DepTestProject" + File.separator + "DepTest3.h", File.separator + "DepTestProject" + File.separator + "a.h", File.separator + "DepTestProject" + File.separator + "c.h"};
ArrayList includes = new ArrayList();
indexManager.performConcurrentJob(new DependencyQueryJob(testProject,depTest3C,indexManager,includes),ICSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,null);
indexManager.performConcurrentJob(new DependencyQueryJob(testProject,depTest3C,indexManager,includes),ICSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,null, null);
String[] preDepTestModelLocal = convertToLocalPath(preDepTestModel);
String[] preDepTestIncludes = new String[includes.size()];
@ -441,7 +440,7 @@ import org.eclipse.core.runtime.Platform;
testProject.refreshLocal(IResource.DEPTH_INFINITE,null);
indexManager.performConcurrentJob(new DependencyQueryJob(testProject,depTest3C,indexManager,includes2),ICSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,null);
indexManager.performConcurrentJob(new DependencyQueryJob(testProject,depTest3C,indexManager,includes2),ICSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,null, null);
String[] postDepTestModelLocal = convertToLocalPath(postDepTestModel);
@ -583,7 +582,7 @@ import org.eclipse.core.runtime.Platform;
indexManager
),
ICSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
null );
null, null );
}
private void editCode(IFile tempFile, String beforeString, String afterString) throws IOException, CoreException, InterruptedException{

View file

@ -123,6 +123,8 @@ public class WorkingCopyTests extends TestCase {
// DestroyWorkingCopy
wc.destroy();
assertFalse(wc.exists());
assertFalse(wc.exists());
Thread.sleep(1000);
}
}

View file

@ -24,7 +24,6 @@ import org.eclipse.cdt.core.search.ICSearchPattern;
import org.eclipse.cdt.core.search.ICSearchResultCollector;
import org.eclipse.cdt.core.search.ICSearchScope;
import org.eclipse.cdt.core.search.SearchEngine;
import org.eclipse.cdt.internal.core.search.indexing.IndexManager;
import org.eclipse.cdt.internal.ui.search.CSearchResultCollector;
import org.eclipse.cdt.testplugin.FileManager;
import org.eclipse.core.internal.resources.ResourceException;

View file

@ -13,19 +13,23 @@
*/
package org.eclipse.cdt.core.search.tests;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Set;
import java.util.TreeSet;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.search.BasicSearchMatch;
import org.eclipse.cdt.core.search.ICSearchPattern;
import org.eclipse.cdt.core.search.IMatch;
import org.eclipse.cdt.core.search.SearchEngine;
import org.eclipse.cdt.internal.core.CharOperation;
import org.eclipse.cdt.internal.core.search.AcceptMatchOperation;
import org.eclipse.cdt.internal.core.search.matching.FieldDeclarationPattern;
import org.eclipse.cdt.internal.core.search.matching.MatchLocator;
import org.eclipse.cdt.internal.core.search.matching.NamespaceDeclarationPattern;
import org.eclipse.cdt.internal.core.search.matching.OrPattern;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Path;
/**
@ -322,9 +326,20 @@ public class OtherPatternTests extends BaseSearchTest {
resultCollector.setProgressMonitor( monitor );
resultCollector.aboutToStart();
MatchLocator matchLocator = new MatchLocator( pattern, resultCollector, scope, monitor );
matchLocator.locateMatches( new String [] { path }, workspace, null );
resultCollector.done();
ArrayList matchesList = new ArrayList();
MatchLocator matchLocator = new MatchLocator( pattern, resultCollector, scope, monitor );
matchLocator.locateMatches( new String [] { path }, workspace, null, matchesList);
AcceptMatchOperation acceptMatchOp = new AcceptMatchOperation(resultCollector, matchesList);
try {
CCorePlugin.getWorkspace().run(acceptMatchOp,null);
} catch (CoreException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//
//resultCollector.done();
Set matches = resultCollector.getSearchResults();
assertEquals( matches.size(), 4 );

View file

@ -1,57 +1,60 @@
2003-09-25 Bogdan Gheorghe
- As a result of folding the dependency service into the indexer
have removed the following files:
* src/org/eclipse/cdt/internal/core/sourcedependency/AddFileToDependencyTree.java
* src/org/eclipse/cdt/internal/core/sourcedependency/DependencyManager.java
* src/org/eclipse/cdt/internal/core/sourcedependency/DependencyRequest.java
* src/org/eclipse/cdt/internal/core/sourcedependency/DependencyRequestor.java
* src/org/eclipse/cdt/internal/core/sourcedependency/DependencySelector.java
* src/org/eclipse/cdt/internal/core/sourcedependency/DependencyTree.java
* src/org/eclipse/cdt/internal/core/sourcedependency/EntireProjectDependencyTree.java
* src/org/eclipse/cdt/internal/core/sourcedependency/IDependencyTree.java
* src/org/eclipse/cdt/internal/core/sourcedependency/IPreprocessorOutput.java
* src/org/eclipse/cdt/internal/core/sourcedependency/ISourceDependency.java
* src/org/eclipse/cdt/internal/core/sourcedependency/PreprocessorOutput.java
* src/org/eclipse/cdt/internal/core/sourcedependency/RemoveFromDependencyTree.java
* src/org/eclipse/cdt/internal/core/sourcedependency/impl/IncludeEntry.java
* src/org/eclipse/cdt/internal/core/sourcedependency/impl/IncludeEntryHashedArray.java
* src/org/eclipse/cdt/internal/core/sourcedependency/impl/InMemoryTree.java
2003-09-22 Bogdan Gheorghe
- Took out enable section for DependencyManager
2003-09-11 Bogdan Gheorghe
- Added null guard to DependencyManager.getDependencyTree(),
DependencyTree.getFileDependencies()
2003-09-08 Andrew Niefer
- Modified calls to ParserFactory to specify which language to use
- Modified IDependencyTree.add to take ParserLanguage as a parameter so that it can
be passed on when creating the preprocessor
2003-07-23 Bogdan Gheorghe
Added initial dependency implementation
* src/org/eclipse/cdt/internal/core/sourcedependency/AddFileToDependencyTree.java
* src/org/eclipse/cdt/internal/core/sourcedependency/DependencyManager.java
* src/org/eclipse/cdt/internal/core/sourcedependency/DenpendencyQueryJob.java
* src/org/eclipse/cdt/internal/core/sourcedependency/DependencyRequest.java
* src/org/eclipse/cdt/internal/core/sourcedependency/DependencyRequestor.java
* src/org/eclipse/cdt/internal/core/sourcedependency/DependencyTree.java
* src/org/eclipse/cdt/internal/core/sourcedependency/EntireProjectDependencyTree.java
* src/org/eclipse/cdt/internal/core/sourcedependency/IDependencyTree.java
* src/org/eclipse/cdt/internal/core/sourcedependency/IPreprocessorOutput.java
* src/org/eclipse/cdt/internal/core/sourcedependency/ISourceDependency.java
* src/org/eclipse/cdt/internal/core/sourcedependency/PreprocessorOutput.java
* src/org/eclipse/cdt/internal/core/sourcedependency/impl/IncludeEntry.java
* src/org/eclipse/cdt/internal/core/sourcedependency/impl/IncludeEntryHashedArray.java
* src/org/eclipse/cdt/internal/core/sourcedependency/impl/InMemoryTree.java
* src/org/eclipse/cdt/internal/core/sourcedependency/impl/Node.java
-
2003-10-23 Bogdan Gheorghe
- Added UpdateDependency job
2003-09-25 Bogdan Gheorghe
- As a result of folding the dependency service into the indexer
have removed the following files:
* src/org/eclipse/cdt/internal/core/sourcedependency/AddFileToDependencyTree.java
* src/org/eclipse/cdt/internal/core/sourcedependency/DependencyManager.java
* src/org/eclipse/cdt/internal/core/sourcedependency/DependencyRequest.java
* src/org/eclipse/cdt/internal/core/sourcedependency/DependencyRequestor.java
* src/org/eclipse/cdt/internal/core/sourcedependency/DependencySelector.java
* src/org/eclipse/cdt/internal/core/sourcedependency/DependencyTree.java
* src/org/eclipse/cdt/internal/core/sourcedependency/EntireProjectDependencyTree.java
* src/org/eclipse/cdt/internal/core/sourcedependency/IDependencyTree.java
* src/org/eclipse/cdt/internal/core/sourcedependency/IPreprocessorOutput.java
* src/org/eclipse/cdt/internal/core/sourcedependency/ISourceDependency.java
* src/org/eclipse/cdt/internal/core/sourcedependency/PreprocessorOutput.java
* src/org/eclipse/cdt/internal/core/sourcedependency/RemoveFromDependencyTree.java
* src/org/eclipse/cdt/internal/core/sourcedependency/impl/IncludeEntry.java
* src/org/eclipse/cdt/internal/core/sourcedependency/impl/IncludeEntryHashedArray.java
* src/org/eclipse/cdt/internal/core/sourcedependency/impl/InMemoryTree.java
2003-09-22 Bogdan Gheorghe
- Took out enable section for DependencyManager
2003-09-11 Bogdan Gheorghe
- Added null guard to DependencyManager.getDependencyTree(),
DependencyTree.getFileDependencies()
2003-09-08 Andrew Niefer
- Modified calls to ParserFactory to specify which language to use
- Modified IDependencyTree.add to take ParserLanguage as a parameter so that it can
be passed on when creating the preprocessor
2003-07-23 Bogdan Gheorghe
Added initial dependency implementation
* src/org/eclipse/cdt/internal/core/sourcedependency/AddFileToDependencyTree.java
* src/org/eclipse/cdt/internal/core/sourcedependency/DependencyManager.java
* src/org/eclipse/cdt/internal/core/sourcedependency/DenpendencyQueryJob.java
* src/org/eclipse/cdt/internal/core/sourcedependency/DependencyRequest.java
* src/org/eclipse/cdt/internal/core/sourcedependency/DependencyRequestor.java
* src/org/eclipse/cdt/internal/core/sourcedependency/DependencyTree.java
* src/org/eclipse/cdt/internal/core/sourcedependency/EntireProjectDependencyTree.java
* src/org/eclipse/cdt/internal/core/sourcedependency/IDependencyTree.java
* src/org/eclipse/cdt/internal/core/sourcedependency/IPreprocessorOutput.java
* src/org/eclipse/cdt/internal/core/sourcedependency/ISourceDependency.java
* src/org/eclipse/cdt/internal/core/sourcedependency/PreprocessorOutput.java
* src/org/eclipse/cdt/internal/core/sourcedependency/impl/IncludeEntry.java
* src/org/eclipse/cdt/internal/core/sourcedependency/impl/IncludeEntryHashedArray.java
* src/org/eclipse/cdt/internal/core/sourcedependency/impl/InMemoryTree.java
* src/org/eclipse/cdt/internal/core/sourcedependency/impl/Node.java
-

View file

@ -0,0 +1,101 @@
/*
* Created on Oct 13, 2003
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
package org.eclipse.cdt.internal.core.sourcedependency;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.search.ICSearchConstants;
import org.eclipse.cdt.core.search.ICSearchScope;
import org.eclipse.cdt.core.search.SearchEngine;
import org.eclipse.cdt.internal.core.search.PathCollector;
import org.eclipse.cdt.internal.core.search.PatternSearchJob;
import org.eclipse.cdt.internal.core.search.indexing.IndexManager;
import org.eclipse.cdt.internal.core.search.matching.CSearchPattern;
import org.eclipse.cdt.internal.core.search.processing.IJob;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
/**
* @author bgheorgh
*
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
public class UpdateDependency implements IJob {
PathCollector pathCollector;
IResource resource;
/**
* @param resource
*/
public UpdateDependency(IResource resource) {
this.resource = resource;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.search.processing.IJob#belongsTo(java.lang.String)
*/
public boolean belongsTo(String jobFamily) {
// TODO Auto-generated method stub
return false;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.search.processing.IJob#cancel()
*/
public void cancel() {
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.search.processing.IJob#execute(org.eclipse.core.runtime.IProgressMonitor)
*/
public boolean execute(IProgressMonitor progress) {
PathCollector pathCollector = new PathCollector();
//SubProgressMonitor subMonitor = (progressMonitor == null ) ? null : new SubProgressMonitor( progressMonitor, 5 );
ICSearchScope scope = SearchEngine.createWorkspaceScope();
CSearchPattern pattern = CSearchPattern.createPattern(resource.getLocation().toOSString(),ICSearchConstants.INCLUDE, ICSearchConstants.REFERENCES,ICSearchConstants.EXACT_MATCH,true);
IndexManager indexManager = CCorePlugin.getDefault().getCoreModel().getIndexManager();
indexManager.performConcurrentJob(
new PatternSearchJob(
(CSearchPattern) pattern,
scope,
pathCollector,
indexManager
),
ICSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
null,
this );
String[] iPath = pathCollector.getPaths();
for (int i=0;i<iPath.length; i++){
IPath pathToReindex = new Path(iPath[i]);
IWorkspaceRoot workRoot = resource.getWorkspace().getRoot();
IFile fileToReindex = workRoot.getFile(pathToReindex);
if (fileToReindex!=null && fileToReindex.exists() ) {
// if (VERBOSE)
// System.out.println("Going to reindex " + fileToReindex.getName());
indexManager.addSource(fileToReindex,fileToReindex.getProject().getProject().getFullPath());
}
}
return false;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.search.processing.IJob#isReadyToRun()
*/
public boolean isReadyToRun() {
return true;
}
}

View file

@ -1,230 +1,235 @@
2003-10-01 Bogdan Gheorghe
- Modified BlockIndexOutput.addInclude to properly flush an
include block once it's full.
- Flushing the CDT log after every merge
- Logging I/O Exceptions in AddFileToIndex
- Changed valid source file extensions in SourceIndexer to
use CModelManager file extensions
2003-09-30 Bogdan Gheorghe
Changed logging for SourceIndexer to log file in cdt.core
2003-09-25 Bogdan Gheorghe
Integrated the dependency service into the indexer. Changes
as follows:
org.eclipse.cdt.internal.core.index.impl:
* IIndex - added getFileDependencies methods
* IIndexerOutput - modified to allow dep inputs into the index
* BlocksIndexInput - modified to allow the reading of the new index (which includes dep entries)
* BlocksIndexOutput - added facilities to write includes to the index
* GammaCompressedIndexBlock - modified with addIncludeEntry() and nextEntry()
* IncludeEntry - new file
* IncludeEntryHashedArray - new file
* Index - Added getFileDepenendencies to query includeEntries from the index
* IndexBlock - modified to reflect changes in GammaCompressedIndexBlock
* IndexerOutput - added new methods from IIndexerOutput
* IndexInput - modified to allow reading of includes from index files
* IndexSummary - modified to save/read new format which contains include info
* InMemoryIndex - modified InMemoryIndex to keep track of includes
* MergeFactory - modified MergeFactory to accomodate new index file format
* SimpleIndexInput - modified to use the new functions for includes in InMemoryIndex
* Util - Added a quickSort for includeEntry[]
org.eclipse.cdt.internal.core.search.indexing:
* AbstractIndexer - modified to getResourceFile being indexed, added bestIncludePrefix
to find include table entries, addInclude() which accepts IASTInclusion node and adds it
to the index
* IIndexConstants - added includeRef constant
* IndexManager - got rid of all dependency table references
* SourceIndexer - modified to return resource being indexed
* SourceIndexerRequestor - Added inclusion handling code; stack for includes
2003-09-22 Bogdan Gheorghe
Took out the old CTags Indexer. Modified IndexAllProject to get
the project path straight from the resource (bypassing the CModelManager).
Commented out the enable section in IndexManager.
Modified
* org.eclipse.cdt.internal.core.search.indexing.IndexAllProject
* org.eclipse.cdt.internal.core.search.indexing.IndexManager
Deleted
* org.eclipse.cdt.core.index.IndexModel
* org.eclipse.cdt.core.index.ITagEntry
* org.eclipse.cdt.core.index.TagFlags
* org.eclipse.cdt.internal.core.index.CTagsCmd
* org.eclipse.cdt.internal.core.index.CTagsEntry
* org.eclipse.cdt.internal.core.index.CTagsFileReader
* org.eclipse.cdt.internal.core.index.CTagsFileWriter
* org.eclipse.cdt.internal.core.index.CTagsHeader
* org.eclipse.cdt.internal.core.index.CTagsRunner
* org.eclipse.cdt.internal.core.index.IndexManager
* org.eclipse.cdt.internal.core.index.RequestList
2003-09-16 Andrew Niefer
- add parameter references to index
- modify CharOperation.match to allow escaping wildcards (bug43063)
- modify AbstractIndexer.bestPrefix to handle wildcard escaping in name (bug43063)
2003-09-13 Andrew Niefer
- add Typedefs to index as Types with suffix T (bug42902)
- added addTypedefReference to AbstractIndexer
- modified bestTypePrefix in AbstractIndexer
- added TYPEDEF_DECL, TYPEDEF_SUFFIX to IIndexConstants
- modified acceptTypedefReference in SourceIndexerRequestor
2003-09-09 Andrew Niefer
Enumerator references
- Added createEnumeratorFullyQualifiedName in AbstractIndexer
- Added addEnumeratorReference in AbstractIndexer
- implemented acceptEnumeratorReference in SourceIndexerRequestor
2003-09-08 Andrew Niefer
- Modified calls to ParserFactory to specify which language to use
2003-09-05 Andrew Niefer
- Modified how AbstractIndexer creates the fully qualified name for an enumerator (spec 7.2-10)
2003-08-26 Bogdan Gheorghe
- Removed header file extensions from being indexed (they
will be indexed via inclusion)
2003-08-20 Bogdan Gheorghe
- Added debug tracing in AbstractIndexer
- Added additional file extensions to supported indexed files
- Changed the parser instantiation to pass in retrieved build
info
- Added function decl index entry based on enterFunctionBody
- Added method decl index entry based on enterMethodBody
- Added forward decl refs
2003-08-14 Bogdan Gheorghe
- Added forward declarations to index
2003-08-12 Bogdan Gheorghe
- Changed var prefix in AbstractIndexer to pass in fully
qualified names
2003-08-11 Bogdan Gheorghe
- Added macro declarations to the index
- Added macro prefix to AbstractIndexer
2003-08-07 Bogdan Gheorghe
- Added shutdown cleanup routine in IndexManager
2003-07-28 Andrew Niefer
- added support for '?' wildcards in AbstractIndexer.bestPrefix
2003-07-25 Bogdan Gheorghe
- Changed parser to COMPLETE mode
- Added functionRef, methodRef, typeRef, namespaceRef, fieldRef
Modified:
* index/org/eclipse/cdt/internal/core/search/indexing/AbstractIndexer.java
* index/org/eclipse/cdt/internal/core/search/indexing/IIndexConstants.java
* index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexer.java
* index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexerRequestor.java
2003-07-24 Andrew Niefer
- added TYPE_ALL, FUNCTION_ALL, METHOD_ALL, NAMESPACE_ALL, FIELD_ALL constants to IIndexConstants
- modified AbstractIndexer prefix functions to properly handle searching for all occurences
2003-07-23 Andrew Niefer
Modified
*index/org/eclipse/cdt/internal/core/search/indexing/AbstractIndexer.java
-changed so that the index prefixes contain the qualified names of the
elements in reverse order.
-Added functions:
bestVariablePrefix
bestNamespacePrefix
bestFieldPrefix
bestFunctionPrefix
bestMethodPrefix
2003-07-21 Bogdan Gheorghe
Added additional declarations to index: enums, enumerators, namespace,
functions, vars, methods, fields, typedefs.
Fixed IndexManager to prevent individually added files from
being added to the index if indexing is not enabled for the project
Modified:
* index/org/eclipse/cdt/internal/core/search/indexing/AbstractIndexer.java
* index/org/eclipse/cdt/internal/core/search/indexing/IIndexConstants.java
* index/org/eclipse/cdt/internal/core/search/indexing/IndexManager.java
* index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexerRequestor.java
2003-07-10 Bogdan Gheorghe
Added bestTypeDeclarationPrefix to AbstractIndexer to allow the
search engine to create a query string for the index.
Changed encoding in AbstractIndexer to encode fully qualified names.
* index/org/eclipse/cdt/internal/core/search/indexing/AbstractIndexer.java
2003-07-03 Bogdan Gheorghe
Updated copyright notices.
2003-06-25 Bogdan Gheorghe
Added new Indexer framework:
* index/org/eclipse/cdt/internal/core/index/IDocument.java
* index/org/eclipse/cdt/internal/core/index/IEntryResult.java
* index/org/eclipse/cdt/internal/core/index/IIndex.java
* index/org/eclipse/cdt/internal/core/index/IIndexer.java
* index/org/eclipse/cdt/internal/core/index/IIndexerOutput.java
* index/org/eclipse/cdt/internal/core/index/IQueryResult.java
* index/org/eclipse/cdt/internal/core/index/impl/Block.java
* index/org/eclipse/cdt/internal/core/index/impl/BlocksIndexInput.java
* index/org/eclipse/cdt/internal/core/index/impl/BlocksIndexOutput.java
* index/org/eclipse/cdt/internal/core/index/impl/CodeByteStream.java
* index/org/eclipse/cdt/internal/core/index/impl/EntryResult.java
* index/org/eclipse/cdt/internal/core/index/impl/Field.java
* index/org/eclipse/cdt/internal/core/index/impl/GammaCompressedIndexBlock.java
* index/org/eclipse/cdt/internal/core/index/impl/IFileDocument.java
* index/org/eclipse/cdt/internal/core/index/impl/IIndexConstants.java
* index/org/eclipse/cdt/internal/core/index/impl/Index.java
* index/org/eclipse/cdt/internal/core/index/impl/IndexBlock.java
* index/org/eclipse/cdt/internal/core/index/impl/IndexedFile.java
* index/org/eclipse/cdt/internal/core/index/impl/IndexedFileHashedArray.java
* index/org/eclipse/cdt/internal/core/index/impl/IndexerOutput.java
* index/org/eclipse/cdt/internal/core/index/impl/IndexInput.java
* index/org/eclipse/cdt/internal/core/index/impl/IndexOutput.java
* index/org/eclipse/cdt/internal/core/index/impl/IndexSummary.java
* index/org/eclipse/cdt/internal/core/index/impl/InMemoryIndex.java
* index/org/eclipse/cdt/internal/core/index/impl/Int.java
* index/org/eclipse/cdt/internal/core/index/impl/MergeFactory.java
* index/org/eclipse/cdt/internal/core/index/impl/PropertyDocument.java
* index/org/eclipse/cdt/internal/core/index/impl/SafeRandomAccessFile.java
* index/org/eclipse/cdt/internal/core/index/impl/SimpleIndexInput.java
* index/org/eclipse/cdt/internal/core/index/impl/Util.java
* index/org/eclipse/cdt/internal/core/index/impl/WordEntry.java
* index/org/eclipse/cdt/internal/core/index/impl/WordEntryHashedArray.java
* index/org/eclipse/cdt/internal/core/search/CharOperation.java
* index/org/eclipse/cdt/internal/core/search/HashtableOfInt.java
* index/org/eclipse/cdt/internal/core/search/SimpleLookupTable.java
* index/org/eclipse/cdt/internal/core/search/Util.java
* index/org/eclipse/cdt/internal/core/search/message.properties
* index/org/eclipse/cdt/internal/core/search/indexing/AbstractIndexer.java
* index/org/eclipse/cdt/internal/core/search/indexing/AddCompilationUnitToIndex.java
* index/org/eclipse/cdt/internal/core/search/indexing/AddFileToIndex.java
* index/org/eclipse/cdt/internal/core/search/indexing/AddFolderToIndex.java
* index/org/eclipse/cdt/internal/core/search/indexing/IIndexConstants.java
* index/org/eclipse/cdt/internal/core/search/indexing/IndexAllProject.java
* index/org/eclipse/cdt/internal/core/search/indexing/IndexManager.java
* index/org/eclipse/cdt/internal/core/search/indexing/IndexRequest.java
* index/org/eclipse/cdt/internal/core/search/indexing/ReadWriteMonitor.java
* index/org/eclipse/cdt/internal/core/search/indexing/RemoveFolderFromIndex.java
* index/org/eclipse/cdt/internal/core/search/indexing/RemoveFromIndex.java
* index/org/eclipse/cdt/internal/core/search/indexing/SaveIndex.java
* index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexer.java
* index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexerRequestor.java
2003-10-22 Bogdan Gheorghe
Added updateDependencies() to the IndexManager to request
a new UpdateDependency job.
2003-10-01 Bogdan Gheorghe
- Modified BlockIndexOutput.addInclude to properly flush an
include block once it's full.
- Flushing the CDT log after every merge
- Logging I/O Exceptions in AddFileToIndex
- Changed valid source file extensions in SourceIndexer to
use CModelManager file extensions
2003-09-30 Bogdan Gheorghe
Changed logging for SourceIndexer to log file in cdt.core
2003-09-25 Bogdan Gheorghe
Integrated the dependency service into the indexer. Changes
as follows:
org.eclipse.cdt.internal.core.index.impl:
* IIndex - added getFileDependencies methods
* IIndexerOutput - modified to allow dep inputs into the index
* BlocksIndexInput - modified to allow the reading of the new index (which includes dep entries)
* BlocksIndexOutput - added facilities to write includes to the index
* GammaCompressedIndexBlock - modified with addIncludeEntry() and nextEntry()
* IncludeEntry - new file
* IncludeEntryHashedArray - new file
* Index - Added getFileDepenendencies to query includeEntries from the index
* IndexBlock - modified to reflect changes in GammaCompressedIndexBlock
* IndexerOutput - added new methods from IIndexerOutput
* IndexInput - modified to allow reading of includes from index files
* IndexSummary - modified to save/read new format which contains include info
* InMemoryIndex - modified InMemoryIndex to keep track of includes
* MergeFactory - modified MergeFactory to accomodate new index file format
* SimpleIndexInput - modified to use the new functions for includes in InMemoryIndex
* Util - Added a quickSort for includeEntry[]
org.eclipse.cdt.internal.core.search.indexing:
* AbstractIndexer - modified to getResourceFile being indexed, added bestIncludePrefix
to find include table entries, addInclude() which accepts IASTInclusion node and adds it
to the index
* IIndexConstants - added includeRef constant
* IndexManager - got rid of all dependency table references
* SourceIndexer - modified to return resource being indexed
* SourceIndexerRequestor - Added inclusion handling code; stack for includes
2003-09-22 Bogdan Gheorghe
Took out the old CTags Indexer. Modified IndexAllProject to get
the project path straight from the resource (bypassing the CModelManager).
Commented out the enable section in IndexManager.
Modified
* org.eclipse.cdt.internal.core.search.indexing.IndexAllProject
* org.eclipse.cdt.internal.core.search.indexing.IndexManager
Deleted
* org.eclipse.cdt.core.index.IndexModel
* org.eclipse.cdt.core.index.ITagEntry
* org.eclipse.cdt.core.index.TagFlags
* org.eclipse.cdt.internal.core.index.CTagsCmd
* org.eclipse.cdt.internal.core.index.CTagsEntry
* org.eclipse.cdt.internal.core.index.CTagsFileReader
* org.eclipse.cdt.internal.core.index.CTagsFileWriter
* org.eclipse.cdt.internal.core.index.CTagsHeader
* org.eclipse.cdt.internal.core.index.CTagsRunner
* org.eclipse.cdt.internal.core.index.IndexManager
* org.eclipse.cdt.internal.core.index.RequestList
2003-09-16 Andrew Niefer
- add parameter references to index
- modify CharOperation.match to allow escaping wildcards (bug43063)
- modify AbstractIndexer.bestPrefix to handle wildcard escaping in name (bug43063)
2003-09-13 Andrew Niefer
- add Typedefs to index as Types with suffix T (bug42902)
- added addTypedefReference to AbstractIndexer
- modified bestTypePrefix in AbstractIndexer
- added TYPEDEF_DECL, TYPEDEF_SUFFIX to IIndexConstants
- modified acceptTypedefReference in SourceIndexerRequestor
2003-09-09 Andrew Niefer
Enumerator references
- Added createEnumeratorFullyQualifiedName in AbstractIndexer
- Added addEnumeratorReference in AbstractIndexer
- implemented acceptEnumeratorReference in SourceIndexerRequestor
2003-09-08 Andrew Niefer
- Modified calls to ParserFactory to specify which language to use
2003-09-05 Andrew Niefer
- Modified how AbstractIndexer creates the fully qualified name for an enumerator (spec 7.2-10)
2003-08-26 Bogdan Gheorghe
- Removed header file extensions from being indexed (they
will be indexed via inclusion)
2003-08-20 Bogdan Gheorghe
- Added debug tracing in AbstractIndexer
- Added additional file extensions to supported indexed files
- Changed the parser instantiation to pass in retrieved build
info
- Added function decl index entry based on enterFunctionBody
- Added method decl index entry based on enterMethodBody
- Added forward decl refs
2003-08-14 Bogdan Gheorghe
- Added forward declarations to index
2003-08-12 Bogdan Gheorghe
- Changed var prefix in AbstractIndexer to pass in fully
qualified names
2003-08-11 Bogdan Gheorghe
- Added macro declarations to the index
- Added macro prefix to AbstractIndexer
2003-08-07 Bogdan Gheorghe
- Added shutdown cleanup routine in IndexManager
2003-07-28 Andrew Niefer
- added support for '?' wildcards in AbstractIndexer.bestPrefix
2003-07-25 Bogdan Gheorghe
- Changed parser to COMPLETE mode
- Added functionRef, methodRef, typeRef, namespaceRef, fieldRef
Modified:
* index/org/eclipse/cdt/internal/core/search/indexing/AbstractIndexer.java
* index/org/eclipse/cdt/internal/core/search/indexing/IIndexConstants.java
* index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexer.java
* index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexerRequestor.java
2003-07-24 Andrew Niefer
- added TYPE_ALL, FUNCTION_ALL, METHOD_ALL, NAMESPACE_ALL, FIELD_ALL constants to IIndexConstants
- modified AbstractIndexer prefix functions to properly handle searching for all occurences
2003-07-23 Andrew Niefer
Modified
*index/org/eclipse/cdt/internal/core/search/indexing/AbstractIndexer.java
-changed so that the index prefixes contain the qualified names of the
elements in reverse order.
-Added functions:
bestVariablePrefix
bestNamespacePrefix
bestFieldPrefix
bestFunctionPrefix
bestMethodPrefix
2003-07-21 Bogdan Gheorghe
Added additional declarations to index: enums, enumerators, namespace,
functions, vars, methods, fields, typedefs.
Fixed IndexManager to prevent individually added files from
being added to the index if indexing is not enabled for the project
Modified:
* index/org/eclipse/cdt/internal/core/search/indexing/AbstractIndexer.java
* index/org/eclipse/cdt/internal/core/search/indexing/IIndexConstants.java
* index/org/eclipse/cdt/internal/core/search/indexing/IndexManager.java
* index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexerRequestor.java
2003-07-10 Bogdan Gheorghe
Added bestTypeDeclarationPrefix to AbstractIndexer to allow the
search engine to create a query string for the index.
Changed encoding in AbstractIndexer to encode fully qualified names.
* index/org/eclipse/cdt/internal/core/search/indexing/AbstractIndexer.java
2003-07-03 Bogdan Gheorghe
Updated copyright notices.
2003-06-25 Bogdan Gheorghe
Added new Indexer framework:
* index/org/eclipse/cdt/internal/core/index/IDocument.java
* index/org/eclipse/cdt/internal/core/index/IEntryResult.java
* index/org/eclipse/cdt/internal/core/index/IIndex.java
* index/org/eclipse/cdt/internal/core/index/IIndexer.java
* index/org/eclipse/cdt/internal/core/index/IIndexerOutput.java
* index/org/eclipse/cdt/internal/core/index/IQueryResult.java
* index/org/eclipse/cdt/internal/core/index/impl/Block.java
* index/org/eclipse/cdt/internal/core/index/impl/BlocksIndexInput.java
* index/org/eclipse/cdt/internal/core/index/impl/BlocksIndexOutput.java
* index/org/eclipse/cdt/internal/core/index/impl/CodeByteStream.java
* index/org/eclipse/cdt/internal/core/index/impl/EntryResult.java
* index/org/eclipse/cdt/internal/core/index/impl/Field.java
* index/org/eclipse/cdt/internal/core/index/impl/GammaCompressedIndexBlock.java
* index/org/eclipse/cdt/internal/core/index/impl/IFileDocument.java
* index/org/eclipse/cdt/internal/core/index/impl/IIndexConstants.java
* index/org/eclipse/cdt/internal/core/index/impl/Index.java
* index/org/eclipse/cdt/internal/core/index/impl/IndexBlock.java
* index/org/eclipse/cdt/internal/core/index/impl/IndexedFile.java
* index/org/eclipse/cdt/internal/core/index/impl/IndexedFileHashedArray.java
* index/org/eclipse/cdt/internal/core/index/impl/IndexerOutput.java
* index/org/eclipse/cdt/internal/core/index/impl/IndexInput.java
* index/org/eclipse/cdt/internal/core/index/impl/IndexOutput.java
* index/org/eclipse/cdt/internal/core/index/impl/IndexSummary.java
* index/org/eclipse/cdt/internal/core/index/impl/InMemoryIndex.java
* index/org/eclipse/cdt/internal/core/index/impl/Int.java
* index/org/eclipse/cdt/internal/core/index/impl/MergeFactory.java
* index/org/eclipse/cdt/internal/core/index/impl/PropertyDocument.java
* index/org/eclipse/cdt/internal/core/index/impl/SafeRandomAccessFile.java
* index/org/eclipse/cdt/internal/core/index/impl/SimpleIndexInput.java
* index/org/eclipse/cdt/internal/core/index/impl/Util.java
* index/org/eclipse/cdt/internal/core/index/impl/WordEntry.java
* index/org/eclipse/cdt/internal/core/index/impl/WordEntryHashedArray.java
* index/org/eclipse/cdt/internal/core/search/CharOperation.java
* index/org/eclipse/cdt/internal/core/search/HashtableOfInt.java
* index/org/eclipse/cdt/internal/core/search/SimpleLookupTable.java
* index/org/eclipse/cdt/internal/core/search/Util.java
* index/org/eclipse/cdt/internal/core/search/message.properties
* index/org/eclipse/cdt/internal/core/search/indexing/AbstractIndexer.java
* index/org/eclipse/cdt/internal/core/search/indexing/AddCompilationUnitToIndex.java
* index/org/eclipse/cdt/internal/core/search/indexing/AddFileToIndex.java
* index/org/eclipse/cdt/internal/core/search/indexing/AddFolderToIndex.java
* index/org/eclipse/cdt/internal/core/search/indexing/IIndexConstants.java
* index/org/eclipse/cdt/internal/core/search/indexing/IndexAllProject.java
* index/org/eclipse/cdt/internal/core/search/indexing/IndexManager.java
* index/org/eclipse/cdt/internal/core/search/indexing/IndexRequest.java
* index/org/eclipse/cdt/internal/core/search/indexing/ReadWriteMonitor.java
* index/org/eclipse/cdt/internal/core/search/indexing/RemoveFolderFromIndex.java
* index/org/eclipse/cdt/internal/core/search/indexing/RemoveFromIndex.java
* index/org/eclipse/cdt/internal/core/search/indexing/SaveIndex.java
* index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexer.java
* index/org/eclipse/cdt/internal/core/search/indexing/SourceIndexerRequestor.java

View file

@ -21,6 +21,7 @@ import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import org.eclipse.cdt.internal.core.model.CModelManager;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IPath;
@ -360,6 +361,37 @@ public class Util {
if (CharOperation.pathMatch(exclusionPatterns[i], path, true, '/'))
return true;
return false;
}
/**
* @param string
* @return
*/
public static boolean isCCFileName(String fileName) {
String[] sourceExtensions = CModelManager.sourceExtensions;
String[] headerExtensions = CModelManager.headerExtensions;
int dot =fileName.lastIndexOf(".");
//No extension, give benefit of doubt
if (dot == -1)
return true;
//Extract extension
String extension = "";
if (dot + 1 <= fileName.length())
extension = fileName.substring(dot + 1);
for (int i=0; i<sourceExtensions.length; i++){
if (sourceExtensions[i].equals(extension))
return true;
}
for (int i=0; i<headerExtensions.length; i++){
if (headerExtensions[i].equals(extension))
return true;
}
return false;
}
}

View file

@ -97,15 +97,14 @@ public class IndexAllProject extends IndexRequest {
if (isCancelled) return false;
switch(proxy.getType()) {
case IResource.FILE :
//TODO: BOG Put the file name checking back
//if (Util.isCCFileName(proxy.getName())) {
if (Util.isCCFileName(proxy.getName())) {
IResource resource = proxy.requestResource();
if (resource.getLocation() != null && (patterns == null || !Util.isExcluded(resource, patterns))) {
String name = new IFileDocument((IFile) resource).getName();
indexedFileNames.put(name, resource);
}
//}
// return false;
}
return false;
case IResource.FOLDER :
if (patterns != null && Util.isExcluded(proxy.requestResource(), patterns))

View file

@ -31,8 +31,10 @@ import org.eclipse.cdt.internal.core.search.IndexSelector;
import org.eclipse.cdt.internal.core.search.SimpleLookupTable;
import org.eclipse.cdt.internal.core.search.processing.IJob;
import org.eclipse.cdt.internal.core.search.processing.JobManager;
import org.eclipse.cdt.internal.core.sourcedependency.UpdateDependency;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
@ -103,7 +105,6 @@ public class IndexManager extends JobManager implements IIndexConstants {
* Note: the actual operation is performed in background
*/
public void addSource(IFile resource, IPath indexedContainer){
if (CCorePlugin.getDefault() == null) return;
AddCompilationUnitToIndex job = new AddCompilationUnitToIndex(resource, indexedContainer, this);
if (this.awaitingJobsCount() < MAX_FILES_IN_MEMORY) {
@ -113,6 +114,13 @@ public class IndexManager extends JobManager implements IIndexConstants {
request(job);
}
public void updateDependencies(IResource resource){
if (CCorePlugin.getDefault() == null) return;
UpdateDependency job = new UpdateDependency(resource);
request(job);
}
String computeIndexName(IPath path) {
String name = (String) indexNames.get(path);
if (name == null) {

View file

@ -5,7 +5,6 @@ package org.eclipse.cdt.internal.core.model;
* All Rights Reserved.
*/
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.model.CModelException;
import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.model.IArchiveContainer;
@ -15,20 +14,12 @@ import org.eclipse.cdt.core.model.ICElementDelta;
import org.eclipse.cdt.core.model.ICModel;
import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.core.model.IParent;
import org.eclipse.cdt.core.search.ICSearchConstants;
import org.eclipse.cdt.core.search.ICSearchScope;
import org.eclipse.cdt.core.search.SearchEngine;
import org.eclipse.cdt.internal.core.search.PathCollector;
import org.eclipse.cdt.internal.core.search.PatternSearchJob;
import org.eclipse.cdt.internal.core.search.indexing.IndexManager;
import org.eclipse.cdt.internal.core.search.matching.CSearchPattern;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceDelta;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
/**
* This class is used by <code>CModelManager</code> to convert
@ -511,35 +502,8 @@ public class DeltaProcessor {
String fileExtension = resource.getFileExtension();
if ((fileExtension != null) &&
(isValidHeader(fileExtension)))
{
PathCollector pathCollector = new PathCollector();
//SubProgressMonitor subMonitor = (progressMonitor == null ) ? null : new SubProgressMonitor( progressMonitor, 5 );
ICSearchScope scope = SearchEngine.createWorkspaceScope();
CSearchPattern pattern = CSearchPattern.createPattern(resource.getLocation().toOSString(),ICSearchConstants.INCLUDE, ICSearchConstants.REFERENCES,ICSearchConstants.EXACT_MATCH,true);
IndexManager indexManager = CCorePlugin.getDefault().getCoreModel().getIndexManager();
indexManager.performConcurrentJob(
new PatternSearchJob(
(CSearchPattern) pattern,
scope,
pathCollector,
indexManager
),
ICSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
null );
String[] iPath = pathCollector.getPaths();
for (int i=0;i<iPath.length; i++){
IPath pathToReindex = new Path(iPath[i]);
IWorkspaceRoot workRoot = element.getCProject().getProject().getWorkspace().getRoot();
IFile fileToReindex = workRoot.getFile(pathToReindex);
if (fileToReindex!=null && fileToReindex.exists() ) {
if (VERBOSE)
System.out.println("Going to reindex " + fileToReindex.getName());
this.indexManager.addSource(fileToReindex,fileToReindex.getProject().getProject().getFullPath());
}
}
(isValidHeader(fileExtension))){
indexManager.updateDependencies(resource);
}
}

View file

@ -1,241 +1,258 @@
2003-10-06 Bogdan Gheorghe
- added createCFileSearchScope() to SearchEngine.java to improve
code complete performance
2003-10-01 Andrew Niefer
- fix bug 44026 by checking scope before reporting match in MatchLocator.report
2003-10-01 Andrew Niefer
- fix BasicSearchMatch.equals() for bug43988
2003-09-30 Bogdan Gheorghe
- changed logging in JobManager to use new ICLogConstants
2003-09-30 Andrew Niefer
-fix bug43862 - Cannot find macro delcarations using all occurences.
* modified CSearchPattern.createMacroPattern
2003-09-29 Andrew Niefer
- fix bug 43062 outline is confused on operator methods containing spaces
- modify CSearchPattern.scanForNames to use same naming convention as TokenDuple.toString()
- modify MatchLocator.report to use IASTOffsetableNamedElement.getNameEndOffset()
2003-09-29 Andrew Niefer
-bug42911 - Search: cannot find beyond use of data member
- fix NPE's in BasicSearchMatch.equals & hashCode
2003-09-29 Andrew Niefer
-fix NPE if IScannerInfoProvider returns null IScannerInfo
2003-09-25 Andrew Niefer
- bug43129 - Cannot search for definitions of global variables
- check definitions for variables, fields, enumerators and namespaces
- handle enter/exitLinkageSpecification
* search/org/eclipse/cdt/internal/core/search/matching/MatchLocator.java
* search/org/eclipse/cdt/internal/core/search/matching/CSearchPattern.java
2003-09-25 Bogdan Gheorghe
- added SearchFor INCLUDE in ICSearchConstants
- added acceptIncludeDeclaration to IIndexSearchRequestor
- modified PathCollector to acceptIncludeDeclarations
- modified CSearchPattern to create an IncludePattern
- added IncludePattern.java
2003-09-25 Andrew Niefer
- partial fix for 43664 Modify Matchlocator to not try and create a link if we have no
resource, instead just use the path
2003-09-23 Andrew Niefer
fix bug 43498 Search with ? fails on first letter of second word
-modifications to CSearchPattern.scanForNames()
-add getSimpleName to MethodDeclarationPattern
2003-09-19 Andrew Niefer
fix bug 43327 Code Complete finds local variables
- modified MatchLocator to not report local declarations when boolean is set
- modified SearchEngine.search to take an additional parameter "excludeLocalDeclarations"
2003-09-15 Andrew Niefer
- modify CSearchPattern to handle escaping wildcards (bug43063)
- modify enterFunctionBody and enterMethodBody to fix bug42979
- search for Parameter References
2003-09-13 Andrew Niefer
-Searching for Typedefs: (bug42902)
- modified setElementInfo in BasicSearchResultCollector
- added TYPEDEF to ICSearchConstants
- modified CSearchPattern & ClassDeclarationPattern
- implemented acceptTypedef* in MatchLocator
- modified BasicSearchMatch to implement Comparable
2003-09-11 Andrew Niefer
- Modified ICSearchResultCollector.createMatch to not take a parent parameter
- modified BasicSearchResultCollector to create the parent string from the fully qualified name of the node
- modified MatchLocator to keep track of most recent declaration for reporting purposes
- modified MatchLocator.report to use the most recent declaration
2003-09-09 Andrew Niefer
pattern matching on function parameters:
- modified scanForParameters in CSearchPattern
- added getParamString in CSearchPattern
- modified matchLevel in MethodDeclarationPattern
Enumeration references
- modified acceptEnumeratorReference in MatchLocator
2003-09-05 Andrew Niefer
- fix searching for enumerators
2003-09-03 Andrew Niefer
- added CLASS_STRUCT to the SearchFor constants
- Modified CSearchPattern to handle CLASS_STRUCT
2003-08-26 Bogdan Gheorghe
- Added debug tracing statements to SearchEngine
- Modified scanForNames in CSearchPattern to treat append
a token after "~" to allow for destructors search
- Added scope checking to MatchLocator
- Added debug trace statements to MatchLocator
2003-08-20 Bogdan Gheorghe
- Changed matching and reporting functions to handle nodes
of type IElaboratedTypeSpecifier
2003-08-12 Bogdan Gheorghe
- Rolled field and variable search patterns into one pattern, in
order to allow for qualified var searches
2003-08-11 Andrew Niefer
- Added Macro ICSearchConstant
- Added acceptMacro to IIndexSearchRequestor and PathCollector
- Added MacroDeclaration Pattern
- Rolled method and function patterns into one method pattern
- Added WorkingCopy support to search
2003-08-08 Bogdan Gheorghe
- Added CreateSearchScope to create a search scope out of
CElements
- Filled out CSearchScope to enable:
- adding a project to scope, include referenced projects
- adding individual CElements to scope
2003-08-08 Andrew Niefer
- add function parameter information to search results
2003-08-06 Andrew Niefer
- Create OrPattern which matches for search if any of its constituent patterns matches
- modified MatchLocator to support the OrPattern
- searching for All occurences now uses the OrPattern
2003-08-01 Andrew Niefer
- Modified BasicSearchResultCollector to only accept matches it has not already seen
- fixed bug in finding a resource when entering includes
2003-07-29 Andrew Niefer
Refactoring Search result collection:
- Modified ICSearchResultCollector
- Modified IMatch
- Modified MatchLocator to reflect changes in ICSearchResultCollector
- Created BasicSearchMatch implements IMatch
- Created BasicSearchResultCollector implements ICSearchResultCollector
2003-07-28 Andrew Niefer
- added abstract CSearchPattern.resetIndexInfo fix bug with searching with globally
qualified names
- fixed bug in CSearchPattern.matchQualifications to do with globally qualified names
- fixed bug in CSearchPattern.createFunctionPattern to do with parameter lists.
2003-07-25 Bogdan Gheorghe
- Added refs to PathCollector
- Filled in feedIndexRequestor for the new search patterns
- Fixed the FunctionDeclarationPattern to work with no parms
2003-07-24 Andrew Niefer
- Implemented decodeIndexEntry & matchIndexEntry for all patterns
- changed MatchLocator to use a COMPLETE_PARSE.
2003-07-23 Andrew Niefer
-Changed ICSearchPattern.matchLevel to take a ISourceElementCallbackDelegate
-Changed ICSearchResultCollector.createMatch to take a ISourceElementCallbackDelegate
-first implementations of:
-CSearchPattern.createFunctionPattern
-CSearchPattern.createVariablePattern
-CSearchPattern.createMethodPattern
-preliminary matching for remaining patterns
-handling of remaining parser callbacks
-generating index Prefixes for the patterns
2003-07-14 Andrew Niefer
-Modified SearchFor instances in ICSearchConstants to more closely match what we are searching for
-added IMatch interface, it represents matches found by the search engine, implementors can store
whatever information they like, see ICSearchResultCollector::createMatch
-added createMatch to the ICSearchResultCollector interface, the result collector is responsible for
implementing IMatch to store whatever data they want out of the AST nodes.
-added skeleton patterns:
search/org/eclipse/cdt/internal/core/search/matching/FieldDeclarationPattern.java
search/org/eclipse/cdt/internal/core/search/matching/FunctionDeclarationPattern.java
search/org/eclipse/cdt/internal/core/search/matching/MethodDeclarationPattern.java
search/org/eclipse/cdt/internal/core/search/matching/NamespaceDeclarationPattern.java
search/org/eclipse/cdt/internal/core/search/matching/VariableDeclarationPattern.java
-added beginnings of CSearchPattern::create*Pattern functions
-modifications to MatchLocator to keep track of current scope
-added CSearchPattern::matchQualifications
2003-07-10 Bogdan Gheorghe
Provided implementation for ICSearchScope.java, CSearchScope.java
Hooked up new CWorkspaceScope, PathCollector, PatternSearchJob in SearchEngine.java
Provided implementation for PatternSearchJob.java - PatternSearchJob is where the first part
of the search occurs - using an IndexSelector to filter the indexes, it gets the indexes from
the IndexManager and then uses the passed in pattern to find the index matched. Once it finds
an index match it adds the file path to the PathCollector.
Modified CSearchPattern - added support to find index entries.
Modified ClassDeclarationPattern - added support to decode, match and report
index entries.
Added:
* search/org/eclipse/cdt/internal/core/search/CWorkspaceScope.java
* search/org/eclipse/cdt/internal/core/search/IIndexSearchRequestor.java
* search/org/eclipse/cdt/internal/core/search/IndexSelector.java
* search/org/eclipse/cdt/internal/core/search/PathCollector.java
Modified:
* search/org/eclipse/cdt/core/search/ICSearchScope.java
* search/org/eclipse/cdt/core/search/SearchEngine.java
* search/org/eclipse/cdt/internal/core/search/CSearchScope.java
* search/org/eclipse/cdt/internal/core/search/PatternSearchJob.java
* search/org/eclipse/cdt/internal/core/search/matching/ClassDeclarationPattern.java
* search/org/eclipse/cdt/internal/core/search/matching/CSearchPattern.java
2003-07-04 Andrew Niefer
Modified ICSearchConstants to use new nested classes SearchFor and LimitTo instead of int
for stronger type safety
Updated MatchLocator to invoke parser to do actual search.
2003-06-27 Andrew Niefer
Modified:
search/org.eclipse.cdt.core.search.matching/MatchLocator.java
- enter/exitInclusion
- enterClassSpecifier
search/org.eclipse.cdt.core.search.matching/CSearchPattern.java
- createClassPattern
- matchesName
search/org.eclipse.cdt.core.search.matching/ClassDeclarationPattern.java
- matchLevel
search/org.eclipse.cdt.core.search/ICSearchPattern.java
search/org.eclipse.cdt.core.search/ICSearchResultCollector.java
search/org.eclipse.cdt.core.search/SearchEngine.java
2003-06-25 Bogdan Gheorghe
Modified:
* search/org/eclipse/cdt/core/search/ICSearchConstants.java
* search/org/eclipse/cdt/internal/core/search/Utils.java
- moved to index/org/eclipse/cdt/internal/core/search/Utils.java
* search/org/eclipse/cdt/internal/core/search/matching/CSearchPattern.java
* search/org/eclipse/cdt/internal/core/search/processing/IJob.java
2003-10-23 Bogdan Gheorghe
- Added AcceptMatchOperation to get around Bug 45324. The search
operation is no longer a WorkspaceModifyOperation (which used to
lock the workspace for the duration of search). Instead, we now
lock the workspace only when we tag the resources with markers.
- Modified SearchEngine : we now receive a list of matches
from the search that we pass into the AcceptMatchOperation.
- Modified MatchLocator to add matches to passed in list instead
of reporting them right away
- Modified JobManager: -added in jobToIgnore parm to unblock dependency
jobs
2003-10-06 Bogdan Gheorghe
- added createCFileSearchScope() to SearchEngine.java to improve
code complete performance
2003-10-01 Andrew Niefer
- fix bug 44026 by checking scope before reporting match in MatchLocator.report
2003-10-01 Andrew Niefer
- fix BasicSearchMatch.equals() for bug43988
2003-09-30 Bogdan Gheorghe
- changed logging in JobManager to use new ICLogConstants
2003-09-30 Andrew Niefer
-fix bug43862 - Cannot find macro delcarations using all occurences.
* modified CSearchPattern.createMacroPattern
2003-09-29 Andrew Niefer
- fix bug 43062 outline is confused on operator methods containing spaces
- modify CSearchPattern.scanForNames to use same naming convention as TokenDuple.toString()
- modify MatchLocator.report to use IASTOffsetableNamedElement.getNameEndOffset()
2003-09-29 Andrew Niefer
-bug42911 - Search: cannot find beyond use of data member
- fix NPE's in BasicSearchMatch.equals & hashCode
2003-09-29 Andrew Niefer
-fix NPE if IScannerInfoProvider returns null IScannerInfo
2003-09-25 Andrew Niefer
- bug43129 - Cannot search for definitions of global variables
- check definitions for variables, fields, enumerators and namespaces
- handle enter/exitLinkageSpecification
* search/org/eclipse/cdt/internal/core/search/matching/MatchLocator.java
* search/org/eclipse/cdt/internal/core/search/matching/CSearchPattern.java
2003-09-25 Bogdan Gheorghe
- added SearchFor INCLUDE in ICSearchConstants
- added acceptIncludeDeclaration to IIndexSearchRequestor
- modified PathCollector to acceptIncludeDeclarations
- modified CSearchPattern to create an IncludePattern
- added IncludePattern.java
2003-09-25 Andrew Niefer
- partial fix for 43664 Modify Matchlocator to not try and create a link if we have no
resource, instead just use the path
2003-09-23 Andrew Niefer
fix bug 43498 Search with ? fails on first letter of second word
-modifications to CSearchPattern.scanForNames()
-add getSimpleName to MethodDeclarationPattern
2003-09-19 Andrew Niefer
fix bug 43327 Code Complete finds local variables
- modified MatchLocator to not report local declarations when boolean is set
- modified SearchEngine.search to take an additional parameter "excludeLocalDeclarations"
2003-09-15 Andrew Niefer
- modify CSearchPattern to handle escaping wildcards (bug43063)
- modify enterFunctionBody and enterMethodBody to fix bug42979
- search for Parameter References
2003-09-13 Andrew Niefer
-Searching for Typedefs: (bug42902)
- modified setElementInfo in BasicSearchResultCollector
- added TYPEDEF to ICSearchConstants
- modified CSearchPattern & ClassDeclarationPattern
- implemented acceptTypedef* in MatchLocator
- modified BasicSearchMatch to implement Comparable
2003-09-11 Andrew Niefer
- Modified ICSearchResultCollector.createMatch to not take a parent parameter
- modified BasicSearchResultCollector to create the parent string from the fully qualified name of the node
- modified MatchLocator to keep track of most recent declaration for reporting purposes
- modified MatchLocator.report to use the most recent declaration
2003-09-09 Andrew Niefer
pattern matching on function parameters:
- modified scanForParameters in CSearchPattern
- added getParamString in CSearchPattern
- modified matchLevel in MethodDeclarationPattern
Enumeration references
- modified acceptEnumeratorReference in MatchLocator
2003-09-05 Andrew Niefer
- fix searching for enumerators
2003-09-03 Andrew Niefer
- added CLASS_STRUCT to the SearchFor constants
- Modified CSearchPattern to handle CLASS_STRUCT
2003-08-26 Bogdan Gheorghe
- Added debug tracing statements to SearchEngine
- Modified scanForNames in CSearchPattern to treat append
a token after "~" to allow for destructors search
- Added scope checking to MatchLocator
- Added debug trace statements to MatchLocator
2003-08-20 Bogdan Gheorghe
- Changed matching and reporting functions to handle nodes
of type IElaboratedTypeSpecifier
2003-08-12 Bogdan Gheorghe
- Rolled field and variable search patterns into one pattern, in
order to allow for qualified var searches
2003-08-11 Andrew Niefer
- Added Macro ICSearchConstant
- Added acceptMacro to IIndexSearchRequestor and PathCollector
- Added MacroDeclaration Pattern
- Rolled method and function patterns into one method pattern
- Added WorkingCopy support to search
2003-08-08 Bogdan Gheorghe
- Added CreateSearchScope to create a search scope out of
CElements
- Filled out CSearchScope to enable:
- adding a project to scope, include referenced projects
- adding individual CElements to scope
2003-08-08 Andrew Niefer
- add function parameter information to search results
2003-08-06 Andrew Niefer
- Create OrPattern which matches for search if any of its constituent patterns matches
- modified MatchLocator to support the OrPattern
- searching for All occurences now uses the OrPattern
2003-08-01 Andrew Niefer
- Modified BasicSearchResultCollector to only accept matches it has not already seen
- fixed bug in finding a resource when entering includes
2003-07-29 Andrew Niefer
Refactoring Search result collection:
- Modified ICSearchResultCollector
- Modified IMatch
- Modified MatchLocator to reflect changes in ICSearchResultCollector
- Created BasicSearchMatch implements IMatch
- Created BasicSearchResultCollector implements ICSearchResultCollector
2003-07-28 Andrew Niefer
- added abstract CSearchPattern.resetIndexInfo fix bug with searching with globally
qualified names
- fixed bug in CSearchPattern.matchQualifications to do with globally qualified names
- fixed bug in CSearchPattern.createFunctionPattern to do with parameter lists.
2003-07-25 Bogdan Gheorghe
- Added refs to PathCollector
- Filled in feedIndexRequestor for the new search patterns
- Fixed the FunctionDeclarationPattern to work with no parms
2003-07-24 Andrew Niefer
- Implemented decodeIndexEntry & matchIndexEntry for all patterns
- changed MatchLocator to use a COMPLETE_PARSE.
2003-07-23 Andrew Niefer
-Changed ICSearchPattern.matchLevel to take a ISourceElementCallbackDelegate
-Changed ICSearchResultCollector.createMatch to take a ISourceElementCallbackDelegate
-first implementations of:
-CSearchPattern.createFunctionPattern
-CSearchPattern.createVariablePattern
-CSearchPattern.createMethodPattern
-preliminary matching for remaining patterns
-handling of remaining parser callbacks
-generating index Prefixes for the patterns
2003-07-14 Andrew Niefer
-Modified SearchFor instances in ICSearchConstants to more closely match what we are searching for
-added IMatch interface, it represents matches found by the search engine, implementors can store
whatever information they like, see ICSearchResultCollector::createMatch
-added createMatch to the ICSearchResultCollector interface, the result collector is responsible for
implementing IMatch to store whatever data they want out of the AST nodes.
-added skeleton patterns:
search/org/eclipse/cdt/internal/core/search/matching/FieldDeclarationPattern.java
search/org/eclipse/cdt/internal/core/search/matching/FunctionDeclarationPattern.java
search/org/eclipse/cdt/internal/core/search/matching/MethodDeclarationPattern.java
search/org/eclipse/cdt/internal/core/search/matching/NamespaceDeclarationPattern.java
search/org/eclipse/cdt/internal/core/search/matching/VariableDeclarationPattern.java
-added beginnings of CSearchPattern::create*Pattern functions
-modifications to MatchLocator to keep track of current scope
-added CSearchPattern::matchQualifications
2003-07-10 Bogdan Gheorghe
Provided implementation for ICSearchScope.java, CSearchScope.java
Hooked up new CWorkspaceScope, PathCollector, PatternSearchJob in SearchEngine.java
Provided implementation for PatternSearchJob.java - PatternSearchJob is where the first part
of the search occurs - using an IndexSelector to filter the indexes, it gets the indexes from
the IndexManager and then uses the passed in pattern to find the index matched. Once it finds
an index match it adds the file path to the PathCollector.
Modified CSearchPattern - added support to find index entries.
Modified ClassDeclarationPattern - added support to decode, match and report
index entries.
Added:
* search/org/eclipse/cdt/internal/core/search/CWorkspaceScope.java
* search/org/eclipse/cdt/internal/core/search/IIndexSearchRequestor.java
* search/org/eclipse/cdt/internal/core/search/IndexSelector.java
* search/org/eclipse/cdt/internal/core/search/PathCollector.java
Modified:
* search/org/eclipse/cdt/core/search/ICSearchScope.java
* search/org/eclipse/cdt/core/search/SearchEngine.java
* search/org/eclipse/cdt/internal/core/search/CSearchScope.java
* search/org/eclipse/cdt/internal/core/search/PatternSearchJob.java
* search/org/eclipse/cdt/internal/core/search/matching/ClassDeclarationPattern.java
* search/org/eclipse/cdt/internal/core/search/matching/CSearchPattern.java
2003-07-04 Andrew Niefer
Modified ICSearchConstants to use new nested classes SearchFor and LimitTo instead of int
for stronger type safety
Updated MatchLocator to invoke parser to do actual search.
2003-06-27 Andrew Niefer
Modified:
search/org.eclipse.cdt.core.search.matching/MatchLocator.java
- enter/exitInclusion
- enterClassSpecifier
search/org.eclipse.cdt.core.search.matching/CSearchPattern.java
- createClassPattern
- matchesName
search/org.eclipse.cdt.core.search.matching/ClassDeclarationPattern.java
- matchLevel
search/org.eclipse.cdt.core.search/ICSearchPattern.java
search/org.eclipse.cdt.core.search/ICSearchResultCollector.java
search/org.eclipse.cdt.core.search/SearchEngine.java
2003-06-25 Bogdan Gheorghe
Modified:
* search/org/eclipse/cdt/core/search/ICSearchConstants.java
* search/org/eclipse/cdt/internal/core/search/Utils.java
- moved to index/org/eclipse/cdt/internal/core/search/Utils.java
* search/org/eclipse/cdt/internal/core/search/matching/CSearchPattern.java
* search/org/eclipse/cdt/internal/core/search/processing/IJob.java
* search/org/eclipse/cdt/internal/core/search/processing/JobManager.java

View file

@ -23,6 +23,7 @@ import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.internal.core.Util;
import org.eclipse.cdt.internal.core.model.CModelManager;
import org.eclipse.cdt.internal.core.model.IWorkingCopy;
import org.eclipse.cdt.internal.core.search.AcceptMatchOperation;
import org.eclipse.cdt.internal.core.search.CSearchScope;
import org.eclipse.cdt.internal.core.search.CWorkspaceScope;
import org.eclipse.cdt.internal.core.search.PathCollector;
@ -32,6 +33,7 @@ import org.eclipse.cdt.internal.core.search.matching.CSearchPattern;
import org.eclipse.cdt.internal.core.search.matching.MatchLocator;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
@ -164,7 +166,7 @@ public class SearchEngine implements ICSearchConstants{
/* search is starting */
collector.aboutToStart();
ArrayList matches = new ArrayList();
try{
//initialize progress monitor
IProgressMonitor progressMonitor = collector.getProgressMonitor();
@ -188,7 +190,8 @@ public class SearchEngine implements ICSearchConstants{
indexManager
),
ICSearchConstants.WAIT_UNTIL_READY_TO_SEARCH,
subMonitor );
subMonitor,
null );
subMonitor = (progressMonitor == null ) ? null : new SubProgressMonitor( progressMonitor, 95 );
@ -199,9 +202,12 @@ public class SearchEngine implements ICSearchConstants{
throw new OperationCanceledException();
//TODO: BOG Filter Working Copies...
matchLocator.locateMatches( pathCollector.getPaths(), workspace, this.workingCopies);
matchLocator.locateMatches( pathCollector.getPaths(), workspace, this.workingCopies, matches);
} finally {
collector.done();
AcceptMatchOperation acceptMatchOp = new AcceptMatchOperation(collector, matches);
try {
CCorePlugin.getWorkspace().run(acceptMatchOp,null);
} catch (CoreException e) {}
}
}
}

View file

@ -0,0 +1,48 @@
/*
* Created on Oct 20, 2003
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
package org.eclipse.cdt.internal.core.search;
import java.util.ArrayList;
import java.util.Iterator;
import org.eclipse.cdt.core.search.ICSearchResultCollector;
import org.eclipse.cdt.core.search.IMatch;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
/**
* @author bgheorgh
*
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
public class AcceptMatchOperation implements IWorkspaceRunnable {
ICSearchResultCollector collector;
ArrayList matches;
/**
* @param collector
*/
public AcceptMatchOperation(ICSearchResultCollector collector, ArrayList matches) {
this.collector = collector;
this.matches = matches;
}
/* (non-Javadoc)
* @see org.eclipse.core.resources.IWorkspaceRunnable#run(org.eclipse.core.runtime.IProgressMonitor)
*/
public void run(IProgressMonitor monitor) throws CoreException {
Iterator i = matches.iterator();
while (i.hasNext()){
IMatch match = (IMatch) i.next();
collector.acceptMatch(match);
}
collector.done();
}
}

View file

@ -18,6 +18,7 @@ import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.io.Reader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
@ -97,6 +98,8 @@ import org.eclipse.core.runtime.Path;
*/
public class MatchLocator implements ISourceElementRequestor, ICSearchConstants {
ArrayList matchStorage;
public static boolean VERBOSE = false;
/**
@ -328,8 +331,9 @@ public class MatchLocator implements ISourceElementRequestor, ICSearchConstants
}
}
public void locateMatches( String [] paths, IWorkspace workspace, IWorkingCopy[] workingCopies ){
public void locateMatches( String [] paths, IWorkspace workspace, IWorkingCopy[] workingCopies,ArrayList matches ){
matchStorage = matches;
workspaceRoot = (workspace != null) ? workspace.getRoot() : null;
HashMap wcPaths = new HashMap();
@ -495,7 +499,9 @@ public class MatchLocator implements ISourceElementRequestor, ICSearchConstants
match = resultCollector.createMatch( currentPath, offset, end, object );
}
if( match != null ){
resultCollector.acceptMatch( match );
//Save till later
//resultCollector.acceptMatch( match );
matchStorage.add(match);
}
} catch (CoreException e) {

View file

@ -188,8 +188,9 @@ public abstract class JobManager implements Runnable {
public boolean performConcurrentJob(
IJob searchJob,
int waitingPolicy,
IProgressMonitor progress) {
IProgressMonitor progress,
IJob jobToIgnore) {
if (VERBOSE)
JobManager.verbose("STARTING concurrent job - " + searchJob); //$NON-NLS-1$
if (!searchJob.isReadyToRun()) {
@ -250,7 +251,8 @@ public abstract class JobManager implements Runnable {
}
this.awaitingClients++;
}
while ((awaitingWork = awaitingJobsCount()) > 0) {
while (((awaitingWork = awaitingJobsCount()) > 0)
&& (!jobShouldBeIgnored(jobToIgnore))) {
if (subProgress != null && subProgress.isCanceled())
throw new OperationCanceledException();
currentJob = currentJob();
@ -295,6 +297,20 @@ public abstract class JobManager implements Runnable {
return status;
}
/**
* @param jobToIgnore
* @return
*/
private boolean jobShouldBeIgnored(IJob jobToIgnore) {
if (jobToIgnore == null)
return false;
if (currentJob() == jobToIgnore)
return true;
return false;
}
public abstract String processName();
public synchronized void request(IJob job) {

View file

@ -27,6 +27,7 @@ import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.actions.WorkspaceModifyOperation;
@ -36,7 +37,7 @@ import org.eclipse.ui.actions.WorkspaceModifyOperation;
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
public class CSearchOperation extends WorkspaceModifyOperation implements ICSearchConstants{
public class CSearchOperation implements IRunnableWithProgress,ICSearchConstants{
public CSearchOperation(IWorkspace workspace, String pattern, boolean caseSensitive, List searchFor, LimitTo limitTo, ICSearchScope scope, String scopeDescription, CSearchResultCollector collector) {
this( workspace, limitTo, scope, scopeDescription, collector );
_stringPattern = pattern;
@ -56,8 +57,7 @@ public class CSearchOperation extends WorkspaceModifyOperation implements ICSear
/* (non-Javadoc)
* @see org.eclipse.ui.actions.WorkspaceModifyOperation#execute(org.eclipse.core.runtime.IProgressMonitor)
*/
protected void execute(IProgressMonitor monitor)
throws CoreException, InvocationTargetException, InterruptedException
public void run(IProgressMonitor monitor)throws InvocationTargetException
{
_collector.setProgressMonitor( monitor );
@ -79,6 +79,8 @@ public class CSearchOperation extends WorkspaceModifyOperation implements ICSear
}
engine.search( _workspace, pattern, _scope, _collector, false );
}
/**
@ -147,5 +149,6 @@ public class CSearchOperation extends WorkspaceModifyOperation implements ICSear
private LimitTo _limitTo;
private List _searchFor;
}

View file

@ -54,6 +54,7 @@ public class CSearchResultCollector extends BasicSearchResultCollector{
_matchCount = 0;
_view = SearchUI.getSearchResultView();
CSearchResultLabelProvider labelProvider = new CSearchResultLabelProvider();
labelProvider.setOrder( CSearchResultLabelProvider.SHOW_PATH );

View file

@ -513,7 +513,7 @@ public class CCompletionProcessor implements IContentAssistProcessor {
//Get file's dependencies
try {
IndexManager indexMan = CCorePlugin.getDefault().getCoreModel().getIndexManager();
indexMan.performConcurrentJob(new DependencyQueryJob(project, (IFile)actualFile, indexMan, dependencies), ICSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, null);
indexMan.performConcurrentJob(new DependencyQueryJob(project, (IFile)actualFile, indexMan, dependencies), ICSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, null, null);
} catch (Exception e) {
}
}