예제 #1
0
        string[] ITextEditorFactory.GetSyntaxProperties(string mimeType, string name)
        {
            var mode = SyntaxHighlightingService.GetSyntaxHighlightingDefinition(null, mimeType);

            if (mode == null)
            {
                return(null);
            }
            // TODO: EditorTheme - remove the syntax properties or translate them to new language properties/services
//			System.Collections.Generic.List<string> value;
//			if (!mode.Properties.TryGetValue (name, out value))
            return(null);
//			return value.ToArray ();
        }
예제 #2
0
        void UpdateSemanticHighlighting()
        {
            var oldSemanticHighighting = Document.SyntaxMode as SemanticHighlightingSyntaxMode;

            if (semanticHighlighting == null)
            {
                if (oldSemanticHighighting != null)
                {
                    Document.SyntaxMode = oldSemanticHighighting.UnderlyingSyntaxMode;
                }
            }
            else
            {
                if (oldSemanticHighighting == null)
                {
                    var def = SyntaxHighlightingService.GetSyntaxHighlightingDefinition(FileName, this.MimeType);
                    Document.SyntaxMode = new SemanticHighlightingSyntaxMode(this, def != null ? (ISyntaxHighlighting) new SyntaxHighlighting(def, Document) : DefaultSyntaxHighlighting.Instance, semanticHighlighting);
                }
                else
                {
                    oldSemanticHighighting.UpdateSemanticHighlighting(semanticHighlighting);
                }
            }
        }