File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
EditorExtensions/CSS/Adornments Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 3
3
using System . Drawing ;
4
4
using System . Linq ;
5
5
using System . Windows . Threading ;
6
+ using Microsoft . Css . Extensions ;
6
7
using Microsoft . CSS . Core ;
7
8
using Microsoft . CSS . Editor ;
8
9
using Microsoft . CSS . Editor . Intellisense ;
@@ -46,7 +47,7 @@ public IEnumerable<ITagSpan<ColorTag>> GetTags(NormalizedSnapshotSpanCollection
46
47
private static IEnumerable < ParseItem > GetColors ( CssTree tree , SnapshotSpan span )
47
48
{
48
49
ParseItem complexItem = tree . StyleSheet . ItemFromRange ( span . Start , span . Length ) ;
49
- if ( complexItem == null || ( ! ( complexItem is AtDirective ) && ! ( complexItem is RuleBlock ) && ! ( complexItem is LessVariableDeclaration ) && ! ( complexItem is FunctionArgument ) ) )
50
+ if ( complexItem == null || ( ! ( complexItem is AtDirective ) && ! ( complexItem is RuleBlock ) && ! ( complexItem is CssVariableDeclaration ) && ! ( complexItem is FunctionArgument ) ) )
50
51
return Enumerable . Empty < ParseItem > ( ) ;
51
52
52
53
var colorCrawler = new CssItemAggregator < ParseItem > ( filter : e => e . AfterEnd > span . Start && e . Start < span . End )
@@ -55,7 +56,7 @@ private static IEnumerable<ParseItem> GetColors(CssTree tree, SnapshotSpan span)
55
56
( FunctionColor c ) => c ,
56
57
( TokenItem i ) => ( i . PreviousSibling == null || ( i . PreviousSibling . Text != "@" && i . PreviousSibling . Text != "$" ) ) // Ignore variable names that happen to be colors
57
58
&& i . TokenType == CssTokenType . Identifier
58
- && ( i . FindType < Declaration > ( ) != null || i . FindType < LessExpression > ( ) != null ) // Ignore classnames that happen to be colors
59
+ && ( i . FindType < Declaration > ( ) != null || i . FindType < CssExpression > ( ) != null ) // Ignore classnames that happen to be colors
59
60
&& Color . FromName ( i . Text ) . IsNamedColor
60
61
? i : null
61
62
} ;
You can’t perform that action at this time.
0 commit comments