Community
Participate
Working Groups
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
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.
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
Jerome - pls point Channing at suitable existing APIs (codeselect, dom ast, ...)
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 ?
Thanks, I'll have a look at this. OK to close. Channing
Closing