Index: stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CSharpLanguageFeatures.cs
===================================================================
--- trunk/sources/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CSharpLanguageFeatures.cs	(revision 11807)
+++ stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CSharpLanguageFeatures.cs	(revision 11937)
@@ -25,4 +25,8 @@
       : base(codeEditor, new CSharpCodeFoldingStrategy(codeEditor), new CSharpCodeCompletionStrategy(codeEditor)) {
     }
+
+    public static ILanguageFeatures Apply(CodeEditor codeEditor) {
+      return new CSharpLanguageFeatures(codeEditor);
+    }
   }
 }
Index: stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeCompletion/CSharp/CSharpCodeCompletionContext.cs
===================================================================
--- trunk/sources/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeCompletion/CSharp/CSharpCodeCompletionContext.cs	(revision 11807)
+++ stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeCompletion/CSharp/CSharpCodeCompletionContext.cs	(revision 11937)
@@ -46,5 +46,5 @@
       this.offset = offset;
 
-      var unresolvedFile = CSharpCodeCompletionHelpers.CreateCSharpUnresolvedFile(this.document);
+      var unresolvedFile = CSharpParsingHelpers.CreateCSharpUnresolvedFile(this.document);
       this.projectContent = projectContent.AddOrUpdateFiles(unresolvedFile);
 
Index: stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeCompletion/CSharp/CSharpCodeCompletionDataFactory.cs
===================================================================
--- trunk/sources/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeCompletion/CSharp/CSharpCodeCompletionDataFactory.cs	(revision 11807)
+++ stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeCompletion/CSharp/CSharpCodeCompletionDataFactory.cs	(revision 11937)
@@ -25,5 +25,7 @@
 using ICSharpCode.AvalonEdit.CodeCompletion;
 using ICSharpCode.NRefactory.Completion;
+using ICSharpCode.NRefactory.CSharp;
 using ICSharpCode.NRefactory.CSharp.Completion;
+using ICSharpCode.NRefactory.CSharp.Resolver;
 using ICSharpCode.NRefactory.TypeSystem;
 using ICompletionData = ICSharpCode.NRefactory.Completion.ICompletionData;
@@ -103,6 +105,5 @@
 
     public ICompletionData CreateImportCompletionData(IType type, bool useFullName, bool addForTypeCreation) {
-      var typeDef = type.GetDefinition();
-      return new ImportCompletionData(typeDef, context.TypeResolveContextAtCaret, useFullName);
+      return null;
     }
 
@@ -121,14 +122,16 @@
 
     #region IParameterCompletionDataFactory Members
-    public IParameterDataProvider CreateConstructorProvider(int startOffset, IType type, ICSharpCode.NRefactory.CSharp.AstNode thisInitializer) {
-      return CreateMethodDataProvider(startOffset, type.GetConstructors());
+    public IParameterDataProvider CreateConstructorProvider(int startOffset, IType type, AstNode thisInitializer) {
+      return CreateConstructorProvider(startOffset, type);
     }
 
     public IParameterDataProvider CreateConstructorProvider(int startOffset, IType type) {
-      return CreateMethodDataProvider(startOffset, type.GetConstructors());
+      var constructors = FilterMethodsForAccessibility(type, type.GetConstructors());
+      return CreateMethodDataProvider(startOffset, constructors);
     }
 
     public IParameterDataProvider CreateDelegateDataProvider(int startOffset, IType type) {
-      return CreateMethodDataProvider(startOffset, new[] { type.GetDelegateInvokeMethod() });
+      var delegates = FilterMethodsForAccessibility(type, new[] { type.GetDelegateInvokeMethod() });
+      return CreateMethodDataProvider(startOffset, delegates);
     }
 
@@ -138,5 +141,5 @@
 
     public IParameterDataProvider CreateMethodDataProvider(int startOffset, IEnumerable<IMethod> methods) {
-      return new CSharpOverloadProvider(context, startOffset, from m in methods where m != null select new CSharpInsightItem(m));
+      return new CSharpOverloadProvider(context, startOffset, methods.Where(x => x != null).Select(x => new CSharpInsightItem(x)));
     }
 
@@ -149,4 +152,11 @@
     }
     #endregion
+
+    private IEnumerable<IMethod> FilterMethodsForAccessibility(IType type, IEnumerable<IMethod> methods) {
+      var typeResolveContext = context.TypeResolveContextAtCaret;
+      var lookup = new MemberLookup(typeResolveContext.CurrentTypeDefinition, typeResolveContext.Compilation.MainAssembly);
+      bool protectedAccessAllowed = lookup.IsProtectedAccessAllowed(type);
+      return protectedAccessAllowed ? methods : methods.Where(x => !x.IsProtected);
+    }
   }
 }
Index: stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeCompletion/CSharp/CSharpCodeCompletionHelpers.cs
===================================================================
--- trunk/sources/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeCompletion/CSharp/CSharpCodeCompletionHelpers.cs	(revision 11807)
+++ 	(revision )
@@ -1,35 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using ICSharpCode.NRefactory.CSharp;
-using ICSharpCode.NRefactory.CSharp.TypeSystem;
-using ICSharpCode.NRefactory.Editor;
-
-namespace HeuristicLab.CodeEditor {
-  internal class CSharpCodeCompletionHelpers {
-    public static CSharpUnresolvedFile CreateCSharpUnresolvedFile(IDocument document) {
-      var parser = new CSharpParser();
-      var syntaxTree = parser.Parse(document, document.FileName);
-      syntaxTree.Freeze();
-      return syntaxTree.ToTypeSystem();
-    }
-  }
-}
Index: stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeCompletion/CSharp/CSharpCodeCompletionStrategy.cs
===================================================================
--- trunk/sources/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeCompletion/CSharp/CSharpCodeCompletionStrategy.cs	(revision 11807)
+++ stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeCompletion/CSharp/CSharpCodeCompletionStrategy.cs	(revision 11937)
@@ -56,5 +56,5 @@
         completionContext.ProjectContent,
         completionContext.TypeResolveContextAtCaret
-      ) { EolMarker = Environment.NewLine };
+        );
 
       char completionChar = completionContext.Document.GetCharAt(completionContext.Offset - 1);
@@ -119,5 +119,5 @@
       );
 
-      var unresolvedFile = CSharpCodeCompletionHelpers.CreateCSharpUnresolvedFile(document);
+      var unresolvedFile = CSharpParsingHelpers.CreateCSharpUnresolvedFile(document);
       projectContent = projectContent.AddOrUpdateFiles(unresolvedFile);
     }
Index: stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeCompletion/CSharp/CSharpOverloadProvider.cs
===================================================================
--- trunk/sources/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeCompletion/CSharp/CSharpOverloadProvider.cs	(revision 11807)
+++ stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeCompletion/CSharp/CSharpOverloadProvider.cs	(revision 11937)
@@ -115,5 +115,5 @@
 
       int parameterIndex = pce.GetCurrentParameterIndex(startOffset, completionContext.Offset);
-      if (parameterIndex < 0) {
+      if (parameterIndex < 0 || !items.Any()) {
         RequestClose = true;
         return;
@@ -161,7 +161,5 @@
     #endregion
 
-
     public event PropertyChangedEventHandler PropertyChanged;
-
     private void OnPropertyChanged(string propertyName) {
       var args = new PropertyChangedEventArgs(propertyName);
Index: stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeCompletion/CSharp/CompletionData/ImportCompletionData.cs
===================================================================
--- trunk/sources/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeCompletion/CSharp/CompletionData/ImportCompletionData.cs	(revision 11807)
+++ 	(revision )
@@ -1,40 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using ICSharpCode.NRefactory.CSharp.Refactoring;
-using ICSharpCode.NRefactory.CSharp.Resolver;
-using ICSharpCode.NRefactory.CSharp.TypeSystem;
-using ICSharpCode.NRefactory.TypeSystem;
-
-namespace HeuristicLab.CodeEditor {
-  internal class ImportCompletionData : EntityCompletionData {
-    public ImportCompletionData(ITypeDefinition typeDefinition, CSharpTypeResolveContext contextAtCaret, bool useFullName)
-      : base(typeDefinition) {
-      Description = string.Format("using {0};", typeDefinition.Namespace);
-      if (useFullName) {
-        var builder = new TypeSystemAstBuilder(new CSharpResolver(contextAtCaret));
-        CompletionText = builder.ConvertType(typeDefinition).ToString();
-      } else {
-        CompletionText = typeDefinition.Namespace;
-      }
-    }
-  }
-}
Index: stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeCompletion/CodeCompletionStrategy.cs
===================================================================
--- trunk/sources/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeCompletion/CodeCompletionStrategy.cs	(revision 11807)
+++ stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeCompletion/CodeCompletionStrategy.cs	(revision 11937)
@@ -40,6 +40,7 @@
     }
 
-    public virtual void RunBackgroundParser() {
-      backgroundParser.Start();
+    public virtual void Initialize() {
+      if (backgroundParser.Status == TaskStatus.Created)
+        backgroundParser.Start();
     }
 
Index: stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeFolding/CSharp/CSharpCodeFoldingContext.cs
===================================================================
--- trunk/sources/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeFolding/CSharp/CSharpCodeFoldingContext.cs	(revision 11807)
+++ stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeFolding/CSharp/CSharpCodeFoldingContext.cs	(revision 11937)
@@ -25,15 +25,13 @@
 namespace HeuristicLab.CodeEditor {
   internal class CSharpCodeFoldingContext {
-    public readonly IDocument Document;
-    public readonly SyntaxTree SyntaxTree;
+    private readonly IDocument document;
+    public IDocument Document { get { return document; } }
+
+    private readonly SyntaxTree syntaxTree;
+    public SyntaxTree SyntaxTree { get { return syntaxTree; } }
 
     public CSharpCodeFoldingContext(IDocument document) {
-      Document = new ReadOnlyDocument(document, document.FileName);
-
-      var parser = new CSharpParser();
-      var syntaxTree = parser.Parse(document, document.FileName);
-      syntaxTree.Freeze();
-
-      SyntaxTree = syntaxTree;
+      this.document = new ReadOnlyDocument(document, document.FileName);
+      syntaxTree = CSharpParsingHelpers.CreateSyntaxTree(this.document);
     }
   }
Index: stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeFolding/CSharp/CSharpCodeFoldingStrategy.cs
===================================================================
--- trunk/sources/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeFolding/CSharp/CSharpCodeFoldingStrategy.cs	(revision 11807)
+++ stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeFolding/CSharp/CSharpCodeFoldingStrategy.cs	(revision 11937)
@@ -22,20 +22,8 @@
 using System.Linq;
 using CSharpBinding.Parser;
-using ICSharpCode.NRefactory.CSharp;
-using ICSharpCode.NRefactory.TypeSystem;
 
 namespace HeuristicLab.CodeEditor {
   internal class CSharpCodeFoldingStrategy : CodeFoldingStrategy {
-    private IProjectContent projectContent = new CSharpProjectContent();
-
-    public CSharpCodeFoldingStrategy(CodeEditor codeEditor)
-      : base(codeEditor) {
-      codeEditor.InternalAssembliesLoaded += (sender, args) => {
-        projectContent = projectContent.AddAssemblyReferences(args.Value);
-      };
-      codeEditor.InternalAssembliesUnloaded += (sender, args) => {
-        projectContent = projectContent.RemoveAssemblyReferences(args.Value);
-      };
-    }
+    public CSharpCodeFoldingStrategy(CodeEditor codeEditor) : base(codeEditor) { }
 
     protected override CodeFoldingResult GetCodeFoldingResult(out int firstErrorOffset) {
Index: stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/Helpers/CSharpParsingHelpers.cs
===================================================================
--- stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/Helpers/CSharpParsingHelpers.cs	(revision 11937)
+++ stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/Helpers/CSharpParsingHelpers.cs	(revision 11937)
@@ -0,0 +1,41 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using ICSharpCode.NRefactory.CSharp;
+using ICSharpCode.NRefactory.CSharp.TypeSystem;
+using ICSharpCode.NRefactory.Editor;
+
+namespace HeuristicLab.CodeEditor {
+  internal class CSharpParsingHelpers {
+    public static SyntaxTree CreateSyntaxTree(IDocument document) {
+      var parser = new CSharpParser();
+      var syntaxTree = parser.Parse(document, document.FileName);
+      return syntaxTree;
+    }
+
+    public static CSharpUnresolvedFile CreateCSharpUnresolvedFile(IDocument document) {
+      var syntaxTree = CreateSyntaxTree(document);
+      syntaxTree.Freeze();
+      var unresolvedFile = syntaxTree.ToTypeSystem();
+      return unresolvedFile;
+    }
+  }
+}
Index: stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/Interfaces/ICodeCompletionStrategy.cs
===================================================================
--- trunk/sources/HeuristicLab.CodeEditor/3.4/LanguageFeatures/Interfaces/ICodeCompletionStrategy.cs	(revision 11807)
+++ stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/Interfaces/ICodeCompletionStrategy.cs	(revision 11937)
@@ -23,5 +23,5 @@
   internal interface ICodeCompletionStrategy {
     void DoCodeCompletion(bool controlSpace);
-    void RunBackgroundParser();
+    void Initialize();
   }
 }
Index: stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/LanguageFeatures.cs
===================================================================
--- trunk/sources/HeuristicLab.CodeEditor/3.4/LanguageFeatures/LanguageFeatures.cs	(revision 11807)
+++ stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/LanguageFeatures.cs	(revision 11937)
@@ -63,5 +63,5 @@
 
     private void LoadedHandler(object sender, EventArgs e) {
-      codeCompletionStrategy.RunBackgroundParser();
+      codeCompletionStrategy.Initialize();
     }
 
Index: stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/XmlLanguageFeatures.cs
===================================================================
--- trunk/sources/HeuristicLab.CodeEditor/3.4/LanguageFeatures/XmlLanguageFeatures.cs	(revision 11807)
+++ stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/XmlLanguageFeatures.cs	(revision 11937)
@@ -25,4 +25,8 @@
       : base(codeEditor, new XmlCodeFoldingStrategy(codeEditor), null) {
     }
+
+    public static ILanguageFeatures Apply(CodeEditor codeEditor) {
+      return new XmlLanguageFeatures(codeEditor);
+    }
   }
 }
