protected override void AddVirtuals (List<IMember> alreadyInserted, CompletionDataWrapper col, string modifiers, IType curType, int declarationBegin)
		{
			base.AddVirtuals (alreadyInserted, col, modifiers, curType, declarationBegin);
			foreach (var member in GetProtocolMembers (curType)) {
				if (alreadyInserted.Contains (member))
					continue;
				if (BaseExportCodeGenerator.IsImplemented (curType, member))
					continue;
				alreadyInserted.Add (member);
				var data = new ProtocolCompletionData (this, declarationBegin, member);
				col.Add (data);
			}
		}
示例#2
0
 protected override void AddVirtuals(List <IMember> alreadyInserted, CompletionDataWrapper col, string modifiers, IType curType, int declarationBegin)
 {
     base.AddVirtuals(alreadyInserted, col, modifiers, curType, declarationBegin);
     foreach (var member in GetProtocolMembers(curType))
     {
         if (alreadyInserted.Contains(member))
         {
             continue;
         }
         if (BaseExportCodeGenerator.IsImplemented(curType, member))
         {
             continue;
         }
         alreadyInserted.Add(member);
         var data = new ProtocolCompletionData(this, declarationBegin, member);
         col.Add(data);
     }
 }
		protected override IEnumerable<CompletionData> CreateCompletionData (CompletionEngine engine, SemanticModel semanticModel, int position, ITypeSymbol returnType, Accessibility seenAccessibility, SyntaxToken startToken, SyntaxToken tokenBeforeReturnType, bool afterKeyword, CancellationToken cancellationToken)
		{
			var result = new List<CompletionData> ();
			ISet<ISymbol> overridableMembers;
			if (!TryDetermineOverridableMembers (semanticModel, tokenBeforeReturnType, seenAccessibility, out overridableMembers, cancellationToken)) {
				return result;
			}
			if (returnType != null) {
				overridableMembers = FilterOverrides (overridableMembers, returnType);
			}
			var curType = semanticModel.GetEnclosingSymbol<INamedTypeSymbol> (startToken.SpanStart, cancellationToken);
			var declarationBegin = afterKeyword ? startToken.SpanStart : position - 1;
			foreach (var m in overridableMembers) {
				var data = new ProtocolCompletionData (this, factory, declarationBegin, curType, m, afterKeyword);
				result.Add (data);
			}
			return result;
		}
示例#4
0
        protected override IEnumerable <CompletionData> CreateCompletionData(CompletionEngine engine, SemanticModel semanticModel, int position, ITypeSymbol returnType, Accessibility seenAccessibility, SyntaxToken startToken, SyntaxToken tokenBeforeReturnType, bool afterKeyword, CancellationToken cancellationToken)
        {
            var            result = new List <CompletionData> ();
            ISet <ISymbol> overridableMembers;

            if (!TryDetermineOverridableMembers(semanticModel, tokenBeforeReturnType, seenAccessibility, out overridableMembers, cancellationToken))
            {
                return(result);
            }
            if (returnType != null)
            {
                overridableMembers = FilterOverrides(overridableMembers, returnType);
            }
            var curType          = semanticModel.GetEnclosingSymbol <INamedTypeSymbol> (startToken.SpanStart, cancellationToken);
            var declarationBegin = afterKeyword ? startToken.SpanStart : position - 1;

            foreach (var m in overridableMembers)
            {
                var data = new ProtocolCompletionData(this, factory, declarationBegin, curType, m, afterKeyword);
                result.Add(data);
            }
            return(result);
        }