private EpochFunctionSignature CreateSignature(ITextBuffer textBuffer, string basename, Parser.FunctionOverload methodSig, string methodDoc, ITrackingSpan span) { EpochFunctionSignature sig = new EpochFunctionSignature(textBuffer, basename, methodSig, methodDoc, null); textBuffer.Changed += new EventHandler <TextContentChangedEventArgs>(sig.OnSubjectBufferChanged); List <IParameter> paramList = new List <IParameter>(); int locusSearchStart = 0; for (int i = 0; i < methodSig.Parameters.Count; ++i) { string param = methodSig.Parameters[i].ToString(); int locusStart = methodSig.Format(basename).IndexOf(param, locusSearchStart); if (locusStart >= 0) { Span locus = new Span(locusStart, param.Length); locusSearchStart = locusStart + param.Length; paramList.Add(new EpochParameter("Parameter documentation goes here.", locus, param, sig)); } } sig.Parameters = new ReadOnlyCollection <IParameter>(paramList); sig.ApplicableToSpan = span; sig.ComputeCurrentParameter(); return(sig); }
internal EpochFunctionSignature(ITextBuffer subjectBuffer, string basename, Parser.FunctionOverload content, string doc, ReadOnlyCollection <IParameter> parameters) { m_subjectBuffer = subjectBuffer; m_content = content.Format(basename); m_documentation = doc; m_parameters = parameters; m_subjectBuffer.Changed += new EventHandler <TextContentChangedEventArgs>(OnSubjectBufferChanged); }