public override CompletionMethod[] GetMethodOverloads(Vector2 pos) { //Vector2 originalPos = pos; if (parserInterface.lastSourceFile == null) { Reparse(); } pos = editor.doc.IncrementPosition(pos, -1); pos = editor.doc.IncrementPosition(pos, -1); pos = editor.doc.GoToEndOfWhitespace(pos, -1); //char nextChar = editor.doc.GetCharAt(pos); if (editor.doc.GetCharAt(pos) == '>') { ExpressionResolver.editor = editor; pos = ExpressionResolver.SimpleMoveToEndOfScope(pos, -1, ExpressionBracketType.Generic); pos = editor.doc.GoToEndOfWhitespace(pos, -1); if (useUnityscript) { if (editor.doc.GetCharAt(pos) == '.') { pos = editor.doc.IncrementPosition(pos, -1); } } pos = editor.doc.GoToEndOfWhitespace(pos, -1); //GameObject go; //go.GetComponent<Vector3>(); } Vector2 endWordPos = pos; pos = editor.doc.GoToEndOfWord(pos, -1); Vector2 startWordPos = editor.doc.IncrementPosition(pos, 1); pos = editor.doc.GoToEndOfWhitespace(pos, -1); // //Debug.Log(editor.doc.GetCharAt(pos)); bool hasDot = false; if (editor.doc.GetCharAt(pos) == '.') { if (useUnityscript) { if (editor.doc.GetCharAt(editor.doc.IncrementPosition(pos, 1)) != '<') { hasDot = true; } } else { hasDot = true; } } UIDELine startLine = editor.doc.RealLineAt((int)startWordPos.y); string functionName = startLine.rawText.Substring((int)startWordPos.x, ((int)endWordPos.x - (int)startWordPos.x) + 1); pos = editor.doc.IncrementPosition(pos, -1); pos = editor.doc.GoToEndOfWhitespace(pos, -1); string str = editor.syntaxRule.ResolveExpressionAt(pos, -1); if (useUnityscript) { str = str.Replace(".<", "<"); } //Debug.Log(str); CompletionMethod[] methods = new CompletionMethod[0]; ChainResolver sigChainResolver = new ChainResolver(editor, pos); //Handle constructors bool isDirectConstructor = str == "new|"; bool isIndirectConstructor = !isDirectConstructor && str.StartsWith("new|"); if (isIndirectConstructor && hasDot) { isIndirectConstructor = false; } if (isIndirectConstructor) { ChainItem item = null; item = sigChainResolver.ResolveChain(str + "." + functionName); if (item == null || item.finalLinkType == null) { return(methods); } methods = sigChainResolver.GetConstructors(item.finalLinkType); return(methods); } else if (isDirectConstructor) { ChainItem item = null; item = sigChainResolver.ResolveChain(functionName); if (item == null || item.finalLinkType == null) { return(methods); } methods = sigChainResolver.GetConstructors(item.finalLinkType); return(methods); } System.Type type = sigChainResolver.reflectionDB.currentType; bool isStatic = false; if (hasDot) { ChainItem item = null; item = sigChainResolver.ResolveChain(str, false); if (item == null || item.finalLinkType == null) { return(methods); } isStatic = item.finalLink.isStatic; type = item.finalLinkType; } methods = sigChainResolver.GetMethodOverloads(type, functionName, isStatic); return(methods); }