Bug 87153 - Request to make the AllTypesCache public
Summary: Request to make the AllTypesCache public
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.1 M6   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-04 11:01 EST by Channing Walton CLA
Modified: 2005-03-08 02:21 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Channing Walton CLA 2005-03-04 11:01:54 EST
Hi,
I would like to request that the AllTypesCache be made public.

The reason is that any plugin that needs to find Java types quickly has no
choice but to use the AllTypesCache because using the search API is too slow.
My example is that I need to highlight java types in an editor. Searching for
potential matches whilst the user is typing takes too long, but using the
AllTypesCache makes it possible.
There are a few other plugins I've come across that need it too.

Channing
Comment 1 Philipe Mulet CLA 2005-03-04 11:21:36 EST
The AllTypesCache is an unbounded cache which doesn't scale well. This is why we
are reconsidering this part of the problem, but it will not be surfaced as is.

One thing that would help is to understand you usecase. Why are you trying to
match anything in editor using it ? Feels to me that the DOM AST API is
something which could help you quite a bit here; as it carries resolved
information about all referenced type.
Comment 2 Channing Walton CLA 2005-03-04 11:37:33 EST
Hi,
my editor is a wiki editor (eclipsewiki.sourceforge.net) which supports links to
Java types. Any text matching a fully qualified type name in the same project as
the wiki document is highlighted.
So as the user is typing, the editor's scanner is checking for types matching
the text at the current cursor position. For large projects this becomes very
expensive unless I use the AllTypesCache.

Channing
Comment 3 Philipe Mulet CLA 2005-03-04 11:41:44 EST
Jerome - pls point Channing at suitable existing APIs (codeselect, dom ast, ...)
Comment 4 Jerome Lanneluc CLA 2005-03-07 12:58:35 EST
Channing, you should use the DOM AST (see org.eclipse.jdt.core.dom.ASTParser) to
have resolved information (using ASTParser.setResolveBindings(true)).
If you want to know if a type (an ITypeBinding) is part of the same project, you
can use #getJavaElement() on this type and #getJavaProject() on the returned
Java element.

OK to close ?
Comment 5 Channing Walton CLA 2005-03-07 17:50:38 EST
Thanks, I'll have a look at this. OK to close.

Channing
Comment 6 Jerome Lanneluc CLA 2005-03-08 02:21:37 EST
Closing