protected override async Task <CompletionDataList> GetElementCompletions(CancellationToken token)
        {
            var list = new CompletionDataList();
            var path = GetElementPath();

            if (path.Elements.Count > 0)
            {
                IXmlCompletionProvider schema = FindSchema(path);
                if (schema == null)
                {
                    schema = inferredCompletionData;
                }

                if (schema != null)
                {
                    var completionData = await schema.GetChildElementCompletionData(path, token);

                    if (completionData != null)
                    {
                        list.AddRange(completionData);
                    }
                }
            }
            else if (defaultSchemaCompletionData != null)
            {
                list.AddRange(await defaultSchemaCompletionData.GetElementCompletionData(defaultNamespacePrefix, token));
            }
            else if (inferredCompletionData != null)
            {
                list.AddRange(await inferredCompletionData.GetElementCompletionData(token));
            }
            AddMiscBeginTags(list);
            return(list);
        }
        protected override void GetElementCompletions(CompletionDataList list)
        {
            var path = GetElementPath();

            if (path.Elements.Count > 0)
            {
                IXmlCompletionProvider schema = FindSchema(path);
                if (schema == null)
                {
                    schema = inferredCompletionData;
                }
                if (schema != null)
                {
                    var completionData = schema.GetChildElementCompletionData(path);
                    if (completionData != null)
                    {
                        list.AddRange(completionData);
                    }
                }
            }
            else if (defaultSchemaCompletionData != null)
            {
                list.AddRange(defaultSchemaCompletionData.GetElementCompletionData(defaultNamespacePrefix));
            }
            else if (inferredCompletionData != null)
            {
                list.AddRange(inferredCompletionData.GetElementCompletionData());
            }
            AddMiscBeginTags(list);
        }
Beispiel #3
0
		void ResolveProvider ()
		{
			try {
				HtmlSchema hs = HtmlSchemaService.GetSchema (substituteProvider);
				if (hs != null)
					provider = hs.CompletionProvider;
			} catch (StackOverflowException) {
				MonoDevelop.Core.LoggingService.LogWarning (
				    "HTML doctype '{0}' contains a substitute schema reference that is either cyclical or too deep, and hence cannot be resolved.'", 
				    name);
			}
			if (provider == null) {
				provider = new EmptyXmlCompletionProvider ();
				MonoDevelop.Core.LoggingService.LogWarning (
				    "HTML doctype '{0}' cannot find substitute schema '{1}'", name, substituteProvider);
			}
			substituteProvider = null;
		}
        protected override CompletionDataList GetAttributeCompletions(IAttributedXObject attributedOb,
                                                                      Dictionary <string, string> existingAtts)
        {
            var path = GetElementPath();

            if (path.Elements.Count > 0)
            {
                IXmlCompletionProvider schema = FindSchema(path);
                if (schema == null)
                {
                    schema = inferredCompletionData;
                }
                if (schema != null)
                {
                    return(schema.GetAttributeCompletionData(path));
                }
            }
            return(null);
        }
        protected override Task <CompletionDataList> GetAttributeCompletions(IAttributedXObject attributedOb,
                                                                             Dictionary <string, string> existingAtts, CancellationToken token)
        {
            var path = GetElementPath();

            if (path.Elements.Count > 0)
            {
                IXmlCompletionProvider schema = FindSchema(path);
                if (schema == null)
                {
                    schema = inferredCompletionData;
                }

                if (schema != null)
                {
                    return(schema.GetAttributeCompletionData(path, token));
                }
            }
            return(Task.FromResult(new CompletionDataList()));
        }
Beispiel #6
0
 void ResolveProvider()
 {
     try {
         HtmlSchema hs = HtmlSchemaService.GetSchema(substituteProvider);
         if (hs != null)
         {
             provider = hs.CompletionProvider;
         }
     } catch (StackOverflowException) {
         MonoDevelop.Core.LoggingService.LogWarning(
             "HTML doctype '{0}' contains a substitute schema reference that is either cyclical or too deep, and hence cannot be resolved.'",
             name);
     }
     if (provider == null)
     {
         provider = new EmptyXmlCompletionProvider();
         MonoDevelop.Core.LoggingService.LogWarning(
             "HTML doctype '{0}' cannot find substitute schema '{1}'", name, substituteProvider);
     }
     substituteProvider = null;
 }
Beispiel #7
0
 public HtmlSchema(string name, string docType, IXmlCompletionProvider provider)
 {
     this.docType  = docType;
     this.name     = name;
     this.provider = provider;
 }
Beispiel #8
0
		public HtmlSchema (string name, string docType, IXmlCompletionProvider provider)
		{
			this.docType = docType;
			this.name = name;
			this.provider = provider;
		}