public override CompletionItem[] GetGlobalCompletionItems() { if (editor.editorWindow.generalSettings.GetForceGenericAutoComplete()) { return(GetGenericCompletionItems()); } if (parserInterface.lastSourceFile == null) { Reparse(); } if (conservativeParsing && parserInterface != null && parserInterface.isParsing) { int i = 0; while (parserInterface.isParsing && i < 100) { Thread.Sleep(10); i++; } } //float startTime = Time.realtimeSinceStartup; List <CompletionItem> items = new List <CompletionItem>(); //items = parserInterface.GetCurrentVisibleItems(editor.cursor.GetVectorPosition(), this).ToList(); //Debug.Log(Time.realtimeSinceStartup-startTime); string[] keywords = UIDE.SyntaxRules.CSharp.Keywords.keywords; string[] modifiers = UIDE.SyntaxRules.CSharp.Keywords.modifiers; string[] primitiveTypes = UIDE.SyntaxRules.CSharp.Keywords.primitiveTypes; if (useUnityscript) { keywords = UIDE.SyntaxRules.Unityscript.Keywords.keywords; modifiers = UIDE.SyntaxRules.Unityscript.Keywords.modifiers; primitiveTypes = UIDE.SyntaxRules.Unityscript.Keywords.primitiveTypes; } for (int i = 0; i < keywords.Length; i++) { CompletionItem item = CompletionItem.CreateFromKeyword(keywords[i]); items.Add(item); } for (int i = 0; i < modifiers.Length; i++) { CompletionItem item = CompletionItem.CreateFromModifier(modifiers[i]); items.Add(item); } for (int i = 0; i < primitiveTypes.Length; i++) { CompletionItem item = CompletionItem.CreateFromPrimitiveType(primitiveTypes[i]); items.Add(item); } //Add members of the current type string typeName = "new|" + GetCurrentTypeFullName(editor.cursor.GetVectorPosition()) + "()"; ChainItem typeItem = null; VerifyChainResolver(); CompletionItem[] globalItems = chainResolver.GetCurrentlyVisibleGlobalItems(); items.AddRange(globalItems); items.AddRange(parserInterface.GetCurrentVisibleItems(editor.cursor.GetVectorPosition(), this)); typeItem = chainResolver.ResolveChain(typeName); if (typeItem != null) { items.AddRange(typeItem.autoCompleteItems); } string[] interfaces = GetCurrentTypeInterfaceNames(editor.cursor.GetVectorPosition()); for (int i = 0; i < interfaces.Length; i++) { typeItem = null; typeItem = chainResolver.ResolveChain(interfaces[i]); if (typeItem != null) { items.AddRange(typeItem.autoCompleteItems); } } return(items.ToArray()); }