/// <summary> Find function names in this module that start with /// the specified string, and append them to the specified List. /// /// If partialName contains parenthesis then we look for an exact match /// </summary> private void appendFunctionNamesMatching(System.Collections.IList functionNameList, SourceFile m, String partialName) { int exactHitAt = - 1; // trim off the trailing parenthesis, if any int parenAt = partialName.LastIndexOf('('); if (parenAt > - 1) partialName = partialName.Substring(0, (parenAt) - (0)); String[] names = m.getFunctionNames(m_session); for (int i = 0; i < names.Length; i++) { String functionName = names[i]; if (functionName.Equals(partialName)) { exactHitAt = i; break; } else if (functionName.StartsWith(partialName)) functionNameList.Add(new ModuleFunctionPair(m.Id, functionName)); } // exact match? if (exactHitAt > - 1) { functionNameList.Clear(); functionNameList.Add(new ModuleFunctionPair(m.Id, names[exactHitAt])); } }
internal virtual void listFunctionsFor(System.Text.StringBuilder sb, SourceFile m) { String[] names = m.getFunctionNames(m_session); if (names == null) return ; ArrayUtil.sort(names); System.Collections.IDictionary args = new System.Collections.Hashtable(); args["sourceFile"] = m.Name + "#" + m.Id; //$NON-NLS-1$ //$NON-NLS-2$ sb.Append(LocalizationManager.getLocalizedTextString("functionsInSourceFile", args)); //$NON-NLS-1$ sb.Append(m_newline); for (int j = 0; j < names.Length; j++) { String fname = names[j]; sb.Append(' '); sb.Append(fname); sb.Append(' '); sb.Append(m.getLineForFunctionName(m_session, fname)); sb.Append(m_newline); } }