Not signed in (Sign In)

Categories

Vanilla 1.1.1 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorfletch
    • CommentTimeMar 29th 2008
     permalink
    does anyone know how to have attributes in XML show up to be a different color than the tag name? my xml docs all look bland - really only 2 colors (tags and strings).

    given:
    <tag attrib="value" attrib2="value2" />

    it would be nice if the words attrib and attrib2 were different colors than <tag />
    • CommentAuthorque
    • CommentTimeMar 29th 2008 edited
     permalink

    Highlighling depends on theme you are using. Just try another one, compare them add add missed rule to yours.

    • CommentAuthorfletch
    • CommentTimeMar 29th 2008
     permalink
    Using blackboard. i tried a bunch and none seem to do it. do you know one in particular that does?

    i think it might be up a level higher than the color theme, at the language syntax level. however, i've not spent enough time with regexp to deal with that
    •  
      CommentAuthorJack Sleight
    • CommentTimeMar 29th 2008 edited
     permalink

    Quite a few do it,take a look at Active4D. This is the code you need:

    title     : 'Tag attribute'
    scope     : 'entity.other.attribute-name'
    settings  : {
    	foreground  : '#963DFF'
    }
    
    • CommentAuthorfletch
    • CommentTimeMar 29th 2008
     permalink
    well, that sure does look like it. I"ve added this to the blackboard.itTheme, hoever, and no dice. I even went back to the Active4D theme and cut/paste directly. i'll keep playing and see if i can find the secret.
  1.  permalink

    The trick is that other selector in the theme is stronger and is overriding yours. The selector is here:

    /******************************************************/ /* meta.tag */ /******************************************************/ { title : 'meta.tag' scope : 'meta.tag, meta.tag entity' settings : { foreground : '#7F90AA' } }

    The “meta.tag entity” is stronger than yours “entity.other.attribute-name”. So you have to remove the “meta.tag entity” from the scope selector in meta.tag rule and it should work.

    • CommentAuthorque
    • CommentTimeMar 30th 2008
     permalink

    /******************************************************/ /* Markup tag attribute name */ /******************************************************/ { title : 'Markup tag attribute name' scope : 'meta.tag.xml entity.other.attribute-name.xml' settings : { foreground : '#D5E0F3' } }