- Timestamp:
- 02/06/15 12:44:09 (10 years ago)
- Location:
- stable
- Files:
-
- 2 deleted
- 5 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
-
stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeCompletion/CSharp/CSharpCodeCompletionContext.cs
r11800 r11937 46 46 this.offset = offset; 47 47 48 var unresolvedFile = CSharp CodeCompletionHelpers.CreateCSharpUnresolvedFile(this.document);48 var unresolvedFile = CSharpParsingHelpers.CreateCSharpUnresolvedFile(this.document); 49 49 this.projectContent = projectContent.AddOrUpdateFiles(unresolvedFile); 50 50 -
stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeCompletion/CSharp/CSharpCodeCompletionDataFactory.cs
r11722 r11937 25 25 using ICSharpCode.AvalonEdit.CodeCompletion; 26 26 using ICSharpCode.NRefactory.Completion; 27 using ICSharpCode.NRefactory.CSharp; 27 28 using ICSharpCode.NRefactory.CSharp.Completion; 29 using ICSharpCode.NRefactory.CSharp.Resolver; 28 30 using ICSharpCode.NRefactory.TypeSystem; 29 31 using ICompletionData = ICSharpCode.NRefactory.Completion.ICompletionData; … … 103 105 104 106 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; 107 108 } 108 109 … … 121 122 122 123 #region IParameterCompletionDataFactory Members 123 public IParameterDataProvider CreateConstructorProvider(int startOffset, IType type, ICSharpCode.NRefactory.CSharp.AstNode thisInitializer) {124 return Create MethodDataProvider(startOffset, type.GetConstructors());124 public IParameterDataProvider CreateConstructorProvider(int startOffset, IType type, AstNode thisInitializer) { 125 return CreateConstructorProvider(startOffset, type); 125 126 } 126 127 127 128 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); 129 131 } 130 132 131 133 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); 133 136 } 134 137 … … 138 141 139 142 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))); 141 144 } 142 145 … … 149 152 } 150 153 #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 } 151 161 } 152 162 } -
stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeCompletion/CSharp/CSharpCodeCompletionStrategy.cs
r11802 r11937 56 56 completionContext.ProjectContent, 57 57 completionContext.TypeResolveContextAtCaret 58 ) { EolMarker = Environment.NewLine };58 ); 59 59 60 60 char completionChar = completionContext.Document.GetCharAt(completionContext.Offset - 1); … … 119 119 ); 120 120 121 var unresolvedFile = CSharp CodeCompletionHelpers.CreateCSharpUnresolvedFile(document);121 var unresolvedFile = CSharpParsingHelpers.CreateCSharpUnresolvedFile(document); 122 122 projectContent = projectContent.AddOrUpdateFiles(unresolvedFile); 123 123 } -
stable/HeuristicLab.CodeEditor/3.4/LanguageFeatures/CodeCompletion/CSharp/CSharpOverloadProvider.cs
r11700 r11937 115 115 116 116 int parameterIndex = pce.GetCurrentParameterIndex(startOffset, completionContext.Offset); 117 if (parameterIndex < 0 ) {117 if (parameterIndex < 0 || !items.Any()) { 118 118 RequestClose = true; 119 119 return; … … 161 161 #endregion 162 162 163 164 163 public event PropertyChangedEventHandler PropertyChanged; 165 166 164 private void OnPropertyChanged(string propertyName) { 167 165 var args = new PropertyChangedEventArgs(propertyName);
Note: See TracChangeset
for help on using the changeset viewer.