OSDN Git Service
Add support for multiple hyperlink targets
This changeset makes the Go To Declaration hyperlink resolver produce
a list of possible jump targets. Therefore, if you for example point
at @android:string/ok, you will get a popup listing all the various
string.xml files that define a translation for this string. If there
is a current configuration (which would be the case if you are
pointing at a resource url from a layout file, but not from a Java
file or a manifest file) then the declaration which best matches the
configuration is listed first, followed by everything else in
alphabetical order by the folder name.
This uses the resource maps which the IDE is already maintaining for
rendering, so it can compute the set of hyperlinks cheaply.
In addition, the hyperlink resolver now goes to the direct declaration
of the given resource. This definition can in turn reference another
resource url.
There is one exception to the instant resolution of files: ids. In
layouts it's common to define ids in place (via @+id), and these are
not available in the resource map. Therefore, if no id is found
defined in a value folder, then the search is deferred until the link
is actually clicked. The search will now search not just the base
layout folder, but all layout folders, starting with the same folder
as the link source, followed by all configuration-compatible folders,
followed by all folders.
Change-Id: I20fd4f5836e41e5a9839124b7be3a3230f5198f4