This adds a new scalability preference that aborts parsing when too many
Tokens are created for a single translation unit. This is a heuristic
that fairly close predicts the files that will be too complex for the
indexer to handle.
The token counter is disabled by default.
When it is enabled, the default token limit is 25,000,000. This value
was determined by counting the number of Tokens produced for each
translation unit in the boost-1.55.0 sources:
sqlite> select * from counts where count > 10000000;
count location
-----------------------------------------------------------------
100000001 libs/local_function/test/all_decl.cpp
100000001 libs/local_function/test/all_decl_seq.cpp
100000001 libs/local_function/test/all_decl_seq_nova.cpp
100000001 libs/preprocessor/doc/examples/array_arithmetic.c
99808587 libs/function_types/build/preprocess_arity_loops.cpp
62380381 libs/preprocessor/doc/examples/delay.c
58096841 libs/serialization/performance/xml/string256_test.cpp
58096828 libs/serialization/performance/xml/int256_test.cpp
52898416 libs/mpi/src/python/collectives.cpp
52573708 boost/spirit/home/support/char_encoding/ \
unicode/create_tables.cpp
21315014 libs/utility/binary_test.cpp
18799536 libs/math/test/test_rational_instances/ \
test_rational_double1.cpp
17758615 libs/mpl/test/string.cpp
13100401 libs/container/bench/bench_set.cpp
11976021 libs/local_function/example/const_block.cpp
11381198 libs/math/test/test_tr1.cpp
10432186 libs/parameter/test/preprocessor.cpp
This value means that the indexer will process all files in boost
without running out of memory on a 1Gb heap.
Change-Id: Ia9fc73dfb38454cc8735f537e3ac6e661864fb4f
Signed-off-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-on: https://git.eclipse.org/r/22386
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
Tested-by: Doug Schaefer <dschaefer@qnx.com>
The Open Declaration (F3), etc. actions use code in the ASTProvider. If
the provider is not able to get an AST then the actions are disabled.
The implementation of the ASTProvider has an "instanceof CEditor" check
the result being that ASTProvider can only be used when the editor is a
CEditor.
This breaks our use case where we have a CEditor embedded as a tab in a
multi-pane editor (see org.eclipse.papyrus.infra.core.sasheditor
.editor.AbstractMultiPageSashEditor).
This patch modifies the ASTProvider to use #getAdapter instead of only
the instanceof check. I've kept the common case (where the editor is a
CEditor) unchanged and added the new code as extra handling.
I've also introduced a public interface, ITranslationUnitProvider, to
avoid forcing clients to adapt to the internal CEditor class. The only
part of CEditor that ASTProvider cares about is the ITranslationUnit.
The existing implementation has an unchecked cast. The new interface
provides the required type directly.
Change-Id: Ie7e68e8909928374fa11fe2b8a857f09d042fb5c
Signed-off-by: Andrew Eidsness <andrewe@jfront.com>
Reviewed-on: https://git.eclipse.org/r/20026
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
When the language settings providers functionality is enabled, also
check for build settings customization, not just the language setting
entries.
Change-Id: Ia9fec3bc377617dc9f2264dd924941879f1b64b0
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/20297
Tested-by: Hudson CI
Reviewed-by: Andrew Gvozdev <angvoz.dev@gmail.com>
IP-Clean: Andrew Gvozdev <angvoz.dev@gmail.com>
Tested-by: Andrew Gvozdev <angvoz.dev@gmail.com>
The existing PDOMBinding and PDOMName implementations do not allow
references between linkages. This feature is needed so that the new Qt
linkage can reference elements in the C++ linkage. It will also allow
the C++ implementation for extern "C" to be cleaned up (see
PDOM.getCrossLanguageBindings).
Prior to this change, a PDOMBinding held three lists of names. One for
each of declarations, definitions, and references. This change adds a
fourth list for external references. External references are stored as
a linked list of nodes. Each node holds:
- The linkage id.
- A pointer to the next node (or 0 for end-of-list).
- A pointer to the record of first name in the list.
The linkage id is held separately because a PDOMName does not have any
field of it's own for linkage. By grouping elements in this way, we can
reuse most of the existing list-related code.
External references are accessed through a new PDOMIterator class. This
is needed so that we can advance to the next linkage node when we get to
the end of one node's list of names.
This also adds a unit test for the new API.
Change-Id: Ie2b14848db7409905beda0cec752080d5f42eec8
Signed-off-by: Andrew Eidsness <eclipse@jfront.com>
Reviewed-on: https://git.eclipse.org/r/18979
Tested-by: Hudson CI
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>