public IEnumerable <ICompletionValue> GetCompletions(SassCompletionContextType type, ICompletionContext context)
        {
            switch (type)
            {
            // standard variable references
            case SassCompletionContextType.ConditionalDirectiveExpression:
            case SassCompletionContextType.EachDirectiveListValue:
            case SassCompletionContextType.FunctionBody:
            case SassCompletionContextType.PropertyValue:
            case SassCompletionContextType.StringInterpolationValue:
            case SassCompletionContextType.VariableName:
            case SassCompletionContextType.VariableValue:
            case SassCompletionContextType.WhileLoopCondition:
                return(context.Cache.GetVariables(context.Position));

            case SassCompletionContextType.FunctionArgumentDefaultValue:
            case SassCompletionContextType.IncludeDirectiveMixinArgument:
            case SassCompletionContextType.IncludeDirectiveMixinArgumentName:
            case SassCompletionContextType.IncludeDirectiveMixinArgumentValue:
            case SassCompletionContextType.MixinDirectiveMixinArgumentDefaultValue:
                // TODO: named arguments
                break;
            }

            return(Enumerable.Empty <ICompletionValue>());
        }
示例#2
0
        public IEnumerable<ICompletionValue> GetCompletions(SassCompletionContextType type, ICompletionContext context)
        {
            switch (type)
            {
                // standard variable references
                case SassCompletionContextType.ConditionalDirectiveExpression:
                case SassCompletionContextType.EachDirectiveListValue:
                case SassCompletionContextType.FunctionBody:
                case SassCompletionContextType.PropertyValue:
                case SassCompletionContextType.StringInterpolationValue:
                case SassCompletionContextType.VariableName:
                case SassCompletionContextType.VariableValue:
                case SassCompletionContextType.WhileLoopCondition:
                    return context.Cache.GetVariables(context.Position);
                case SassCompletionContextType.FunctionArgumentDefaultValue:
                case SassCompletionContextType.IncludeDirectiveMixinArgument:
                case SassCompletionContextType.IncludeDirectiveMixinArgumentName:
                case SassCompletionContextType.IncludeDirectiveMixinArgumentValue:
                case SassCompletionContextType.MixinDirectiveMixinArgumentDefaultValue:
                    // TODO: named arguments
                    break;
            }

            return Enumerable.Empty<ICompletionValue>();
        }
        public IEnumerable<ICompletionValueProvider> ValueProvidersFor(SassCompletionContextType type)
        {
            IEnumerable<ICompletionValueProvider> providers;
            if (_ValueProviders.TryGetValue(type, out providers))
                return providers;

            return Enumerable.Empty<ICompletionValueProvider>();
        }
        public IEnumerable<ICompletionValue> GetCompletions(SassCompletionContextType type, ICompletionContext context)
        {
            var schema = SchemaManager.CurrentSchema;
            if (schema == null)
                return Enumerable.Empty<ICompletionValue>();

            return schema.GetPseudos().Select(x => new PseudoCompletionValue(x.Name, x.Description));
        }
示例#5
0
        public IEnumerable <ICompletionValue> GetCompletions(SassCompletionContextType type, ICompletionContext context)
        {
            switch (type)
            {
            case SassCompletionContextType.IncludeDirectiveMixinName:
                return(context.Cache.GetMixins(context.Position));
            }

            return(Enumerable.Empty <ICompletionValue>());
        }
示例#6
0
        public IEnumerable<ICompletionValue> GetCompletions(SassCompletionContextType type, ICompletionContext context)
        {
            switch (type)
            {
                case SassCompletionContextType.IncludeDirectiveMixinName:
                    return context.Cache.GetMixins(context.Position);
            }

            return Enumerable.Empty<ICompletionValue>();
        }
示例#7
0
        public IEnumerable <ICompletionValueProvider> ValueProvidersFor(SassCompletionContextType type)
        {
            IEnumerable <ICompletionValueProvider> providers;

            if (_ValueProviders.TryGetValue(type, out providers))
            {
                return(providers);
            }

            return(Enumerable.Empty <ICompletionValueProvider>());
        }
        public IEnumerable <ICompletionValue> GetCompletions(SassCompletionContextType type, ICompletionContext context)
        {
            var schema = SchemaManager.CurrentSchema;

            if (schema == null)
            {
                return(Enumerable.Empty <ICompletionValue>());
            }

            return(schema.GetPseudos().Select(x => new PseudoCompletionValue(x.Name, x.Description)));
        }
        public IEnumerable<ICompletionValue> GetCompletions(SassCompletionContextType type, ICompletionContext context)
        {
            if (type != SassCompletionContextType.ImportDirectiveFile)
                return Enumerable.Empty<ICompletionValue>();

            var directory = Resolve(context);
            if (directory == null)
                return Enumerable.Empty<ICompletionValue>();

            return GetValues(directory);
        }
 public IEnumerable<ICompletionValue> GetCompletions(SassCompletionContextType type, ICompletionContext context)
 {
     switch (type)
     {
         case SassCompletionContextType.XmlDocumentationComment:
             yield return new KeywordCompletionValue("reference");
             break;
         case SassCompletionContextType.FileReferenceFileAttribute:
             yield return new KeywordCompletionValue("file") { CompletionText = "file=\"" };
             break;
     }
 }
        public IEnumerable <ICompletionValue> GetCompletions(SassCompletionContextType type, ICompletionContext context)
        {
            if (type != SassCompletionContextType.ImportDirectiveFile)
            {
                return(Enumerable.Empty <ICompletionValue>());
            }

            var directory = Resolve(context);

            if (directory == null)
            {
                return(Enumerable.Empty <ICompletionValue>());
            }

            return(GetValues(directory));
        }
示例#12
0
        public IEnumerable<ICompletionValue> GetCompletions(SassCompletionContextType type, ICompletionContext context)
        {
            var schema = SchemaManager.CurrentSchema;
            if (schema != null)
            {
                switch (type)
                {
                    case SassCompletionContextType.PropertyDeclaration:
                    case SassCompletionContextType.PropertyName:
                        return GetPropertyNames(context, schema);
                    case SassCompletionContextType.PropertyValue:
                        return GetPropertyValues(context, schema);
                }
            }

            return NO_RESULTS;
        }
        public IEnumerable <ICompletionValue> GetCompletions(SassCompletionContextType type, ICompletionContext context)
        {
            switch (type)
            {
            case SassCompletionContextType.XmlDocumentationComment:
                yield return(new KeywordCompletionValue("reference"));

                break;

            case SassCompletionContextType.FileReferenceFileAttribute:
                yield return(new KeywordCompletionValue("file")
                {
                    CompletionText = "file=\""
                });

                break;
            }
        }
示例#14
0
        public IEnumerable <ICompletionValue> GetCompletions(SassCompletionContextType type, ICompletionContext context)
        {
            var schema = SchemaManager.CurrentSchema;

            if (schema != null)
            {
                switch (type)
                {
                case SassCompletionContextType.PropertyDeclaration:
                case SassCompletionContextType.PropertyName:
                    return(GetPropertyNames(context, schema));

                case SassCompletionContextType.PropertyValue:
                    return(GetPropertyValues(context, schema));
                }
            }

            return(NO_RESULTS);
        }
示例#15
0
 IEnumerable<string> GetKeywords(SassCompletionContextType type)
 {
     switch (type)
     {
         case SassCompletionContextType.AtDirectiveName:
             yield return "@warn";
             yield return "@debug";
             break;
         case SassCompletionContextType.ConditionalDirective:
             yield return "@if";
             yield return "@else";
             yield return "@else if";
             break;
         case SassCompletionContextType.CssDirective:
             yield return "@media";
             yield return "@page";
             foreach (var cssDirective in GetCssDirectives())
                 yield return cssDirective;
             break;
         case SassCompletionContextType.EachDirective:
             yield return "@each";
             break;
         case SassCompletionContextType.ExtendDirective:
             yield return "@extend";
             break;
         case SassCompletionContextType.ExtendDirectiveOptionalFlag:
             yield return "!optional";
             break;
         case SassCompletionContextType.ForLoopDirective:
             yield return "@for";
             break;
         case SassCompletionContextType.ForLoopFromKeyword:
             yield return "from";
             break;
         case SassCompletionContextType.ForLoopRangeKeyword:
             yield return "to";
             yield return "through";
             break;
         case SassCompletionContextType.FunctionBody:
             yield return "@return";
             break;
         case SassCompletionContextType.FunctionDirective:
             yield return "@function";
             break;
         case SassCompletionContextType.ImportDirective:
             yield return "@import";
             break;
         case SassCompletionContextType.IncludeDirective:
             yield return "@include";
             break;
         case SassCompletionContextType.KeyframesDirective:
             yield return "@keyframes";
             break;
         case SassCompletionContextType.KeyframesNamedRange:
             yield return "from";
             yield return "to";
             break;
         case SassCompletionContextType.MixinDirective:
             yield return "@mixin";
             break;
         case SassCompletionContextType.MixinBody:
             yield return "@content";
             break;
         case SassCompletionContextType.VariableDefaultFlag:
             yield return "!default";
             break;
         case SassCompletionContextType.WhileLoopDirective:
             yield return "@while";
             break;
     }
 }
示例#16
0
 public IEnumerable <ICompletionValue> GetCompletions(SassCompletionContextType type, ICompletionContext context)
 {
     return(SystemFunctions.Concat(context.Cache.GetFunctions(context.Position)));
 }
示例#17
0
 public IEnumerable<ICompletionValue> GetCompletions(SassCompletionContextType type, ICompletionContext context)
 {
     return SystemFunctions.Concat(context.Cache.GetFunctions(context.Position));
 }
示例#18
0
 public IEnumerable <ICompletionValue> GetCompletions(SassCompletionContextType type, ICompletionContext context)
 {
     return(GetKeywords(type).Select(name => new KeywordCompletionValue(name)));
 }
示例#19
0
        IEnumerable <string> GetKeywords(SassCompletionContextType type)
        {
            switch (type)
            {
            case SassCompletionContextType.AtDirectiveName:
                yield return("@warn");

                yield return("@debug");

                break;

            case SassCompletionContextType.ConditionalDirective:
                yield return("@if");

                yield return("@else");

                yield return("@else if");

                break;

            case SassCompletionContextType.CssDirective:
                yield return("@media");

                yield return("@page");

                foreach (var cssDirective in GetCssDirectives())
                {
                    yield return(cssDirective);
                }
                break;

            case SassCompletionContextType.EachDirective:
                yield return("@each");

                break;

            case SassCompletionContextType.ExtendDirective:
                yield return("@extend");

                break;

            case SassCompletionContextType.ExtendDirectiveOptionalFlag:
                yield return("!optional");

                break;

            case SassCompletionContextType.ForLoopDirective:
                yield return("@for");

                break;

            case SassCompletionContextType.ForLoopFromKeyword:
                yield return("from");

                break;

            case SassCompletionContextType.ForLoopRangeKeyword:
                yield return("to");

                yield return("through");

                break;

            case SassCompletionContextType.FunctionBody:
                yield return("@return");

                break;

            case SassCompletionContextType.FunctionDirective:
                yield return("@function");

                break;

            case SassCompletionContextType.ImportDirective:
                yield return("@import");

                break;

            case SassCompletionContextType.IncludeDirective:
                yield return("@include");

                break;

            case SassCompletionContextType.KeyframesDirective:
                yield return("@keyframes");

                break;

            case SassCompletionContextType.KeyframesNamedRange:
                yield return("from");

                yield return("to");

                break;

            case SassCompletionContextType.MixinDirective:
                yield return("@mixin");

                break;

            case SassCompletionContextType.MixinBody:
                yield return("@content");

                break;

            case SassCompletionContextType.VariableDefaultFlag:
                yield return("!default");

                break;

            case SassCompletionContextType.WhileLoopDirective:
                yield return("@while");

                break;
            }
        }
示例#20
0
 public IEnumerable<ICompletionValue> GetCompletions(SassCompletionContextType type, ICompletionContext context)
 {
     return GetKeywords(type).Select(name => new KeywordCompletionValue(name));
 }