diff --git a/lib/provider.coffee b/lib/provider.coffee old mode 100644 new mode 100755 index 7bd6e8a..993aaf1 --- a/lib/provider.coffee +++ b/lib/provider.coffee @@ -24,16 +24,17 @@ module.exports = scopes = request.scopeDescriptor.getScopesArray() isSass = hasScope(scopes, 'source.sass') - if @isCompletingValue(request) - completions = @getPropertyValueCompletions(request) - else if @isCompletingPseudoSelector(request) - completions = @getPseudoSelectorCompletions(request) - else - if isSass and @isCompletingNameOrTag(request) - completions = @getPropertyNameCompletions(request) - .concat(@getTagCompletions(request)) - else if not isSass and @isCompletingName(request) - completions = @getPropertyNameCompletions(request) + unless @isCompletingCustomProperty(request) + if @isCompletingValue(request) + completions = @getPropertyValueCompletions(request) + else if @isCompletingPseudoSelector(request) + completions = @getPseudoSelectorCompletions(request) + else + if isSass and @isCompletingNameOrTag(request) + completions = @getPropertyNameCompletions(request) + .concat(@getTagCompletions(request)) + else if not isSass and @isCompletingName(request) + completions = @getPropertyNameCompletions(request) if not isSass and @isCompletingTagSelector(request) tagCompletions = @getTagCompletions(request) @@ -55,6 +56,12 @@ module.exports = {@pseudoSelectors, @properties, @tags} = JSON.parse(content) unless error? return + isCompletingCustomProperty: ({scopeDescriptor}) -> + scopes = scopeDescriptor.getScopesArray() + + hasScope(scopes, 'variable.css') or + hasScope(scopes, 'meta.function.variable.css') + isCompletingValue: ({scopeDescriptor, bufferPosition, prefix, editor}) -> scopes = scopeDescriptor.getScopesArray()