diff options
author | Tor Norbye <tnorbye@google.com> | 2011-03-23 16:42:13 -0700 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2011-03-25 17:18:45 -0700 |
commit | dc8c93e4847780de24531711b7f3f22b2936b491 (patch) | |
tree | 86c3c8ee12c590eb084382e218dcf8b1872792f3 /layoutlib_api/src | |
parent | 241972d2cf76b3b79fa2c56d4299ea280a8f7ba2 (diff) | |
download | sdk-dc8c93e4847780de24531711b7f3f22b2936b491.zip sdk-dc8c93e4847780de24531711b7f3f22b2936b491.tar.gz sdk-dc8c93e4847780de24531711b7f3f22b2936b491.tar.bz2 |
Code completion in style definitions & other improvements
This changeset adds code completion support to resource files where
<style> elements are defined. In particular, you get two types of
completion:
- Completion on names: <style><item name="|" >
Here you get offered ALL matching attribute names from any view
descriptors.
- Completion on values: <style><item name="android:gravity">|</item>
Here you get offered all values that correspond to the attribute
named as the value of the name attribute of the surrounding item
element.
Unrelated to styles, code completion will now also move the caret
outside the attribute value quotes when you enter one of the value
alternatives (unless the value is a flag type or a resource token).
Also, run-on attributes are also handled more gracefully: if you
complete properties with the caret immediately following another
attribute, a separating space is added into the match as a prefix such
that the new attribute is separated and the XML valid.
There are a lot of diffs in this changeset. In order to allow the
ResourcesContentAssist to extend code completion to add its style-
specific logic, the content assist code had to be split up a bit.
Doing completion in text nodes, or potential text nodes (e.g. if you
have <item>|</item> you should get text completion at that caret
offset even though there is no text node child of the item element
until you insert actual text there) also required some changes.
There are many new unit tests. I also changed the golden file format
slightly to show the caret in the before-view such that it's more
obvious how the caret was affected by inserting the new item.
Change-Id: Ia985db7e848fea33e93ac8a70b2c3b4dbfd9056a
Diffstat (limited to 'layoutlib_api/src')
0 files changed, 0 insertions, 0 deletions