Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/06/15 12:44:09 (10 years ago)
Author:
jkarder
Message:

#2077: merged r11807:11811, r11816, r11819, r11822, r11825, r11834, r11835, r11836, r11933 and r11936 into stable

Location:
stable
Files:
2 deleted
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeCompletion/CSharp/CSharpCodeCompletionContext.cs

    r11800 r11937  
    4646      this.offset = offset;
    4747
    48       var unresolvedFile = CSharpCodeCompletionHelpers.CreateCSharpUnresolvedFile(this.document);
     48      var unresolvedFile = CSharpParsingHelpers.CreateCSharpUnresolvedFile(this.document);
    4949      this.projectContent = projectContent.AddOrUpdateFiles(unresolvedFile);
    5050
  • stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeCompletion/CSharp/CSharpCodeCompletionDataFactory.cs

    r11722 r11937  
    2525using ICSharpCode.AvalonEdit.CodeCompletion;
    2626using ICSharpCode.NRefactory.Completion;
     27using ICSharpCode.NRefactory.CSharp;
    2728using ICSharpCode.NRefactory.CSharp.Completion;
     29using ICSharpCode.NRefactory.CSharp.Resolver;
    2830using ICSharpCode.NRefactory.TypeSystem;
    2931using ICompletionData = ICSharpCode.NRefactory.Completion.ICompletionData;
     
    103105
    104106    public ICompletionData CreateImportCompletionData(IType type, bool useFullName, bool addForTypeCreation) {
    105       var typeDef = type.GetDefinition();
    106       return new ImportCompletionData(typeDef, context.TypeResolveContextAtCaret, useFullName);
     107      return null;
    107108    }
    108109
     
    121122
    122123    #region IParameterCompletionDataFactory Members
    123     public IParameterDataProvider CreateConstructorProvider(int startOffset, IType type, ICSharpCode.NRefactory.CSharp.AstNode thisInitializer) {
    124       return CreateMethodDataProvider(startOffset, type.GetConstructors());
     124    public IParameterDataProvider CreateConstructorProvider(int startOffset, IType type, AstNode thisInitializer) {
     125      return CreateConstructorProvider(startOffset, type);
    125126    }
    126127
    127128    public IParameterDataProvider CreateConstructorProvider(int startOffset, IType type) {
    128       return CreateMethodDataProvider(startOffset, type.GetConstructors());
     129      var constructors = FilterMethodsForAccessibility(type, type.GetConstructors());
     130      return CreateMethodDataProvider(startOffset, constructors);
    129131    }
    130132
    131133    public IParameterDataProvider CreateDelegateDataProvider(int startOffset, IType type) {
    132       return CreateMethodDataProvider(startOffset, new[] { type.GetDelegateInvokeMethod() });
     134      var delegates = FilterMethodsForAccessibility(type, new[] { type.GetDelegateInvokeMethod() });
     135      return CreateMethodDataProvider(startOffset, delegates);
    133136    }
    134137
     
    138141
    139142    public IParameterDataProvider CreateMethodDataProvider(int startOffset, IEnumerable<IMethod> methods) {
    140       return new CSharpOverloadProvider(context, startOffset, from m in methods where m != null select new CSharpInsightItem(m));
     143      return new CSharpOverloadProvider(context, startOffset, methods.Where(x => x != null).Select(x => new CSharpInsightItem(x)));
    141144    }
    142145
     
    149152    }
    150153    #endregion
     154
     155    private IEnumerable<IMethod> FilterMethodsForAccessibility(IType type, IEnumerable<IMethod> methods) {
     156      var typeResolveContext = context.TypeResolveContextAtCaret;
     157      var lookup = new MemberLookup(typeResolveContext.CurrentTypeDefinition, typeResolveContext.Compilation.MainAssembly);
     158      bool protectedAccessAllowed = lookup.IsProtectedAccessAllowed(type);
     159      return protectedAccessAllowed ? methods : methods.Where(x => !x.IsProtected);
     160    }
    151161  }
    152162}
  • stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeCompletion/CSharp/CSharpCodeCompletionStrategy.cs

    r11802 r11937  
    5656        completionContext.ProjectContent,
    5757        completionContext.TypeResolveContextAtCaret
    58       ) { EolMarker = Environment.NewLine };
     58        );
    5959
    6060      char completionChar = completionContext.Document.GetCharAt(completionContext.Offset - 1);
     
    119119      );
    120120
    121       var unresolvedFile = CSharpCodeCompletionHelpers.CreateCSharpUnresolvedFile(document);
     121      var unresolvedFile = CSharpParsingHelpers.CreateCSharpUnresolvedFile(document);
    122122      projectContent = projectContent.AddOrUpdateFiles(unresolvedFile);
    123123    }
  • stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeCompletion/CSharp/CSharpOverloadProvider.cs

    r11700 r11937  
    115115
    116116      int parameterIndex = pce.GetCurrentParameterIndex(startOffset, completionContext.Offset);
    117       if (parameterIndex < 0) {
     117      if (parameterIndex < 0 || !items.Any()) {
    118118        RequestClose = true;
    119119        return;
     
    161161    #endregion
    162162
    163 
    164163    public event PropertyChangedEventHandler PropertyChanged;
    165 
    166164    private void OnPropertyChanged(string propertyName) {
    167165      var args = new PropertyChangedEventArgs(propertyName);
  • stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeCompletion/CodeCompletionStrategy.cs

    r11800 r11937  
    4040    }
    4141
    42     public virtual void RunBackgroundParser() {
    43       backgroundParser.Start();
     42    public virtual void Initialize() {
     43      if (backgroundParser.Status == TaskStatus.Created)
     44        backgroundParser.Start();
    4445    }
    4546
Note: See TracChangeset for help on using the changeset viewer.