Exemple #1
0
        public TooltipItem GetItem(Mono.TextEditor.TextEditor editor, int offset)
        {
            string offsetWord = (editor as TextEdit).GetOffsetWord(offset, true);

            //if((string.IsNullOrEmpty(offsetWord)) || !offsetWord.Contains(".") ) return null;
            if ((string.IsNullOrEmpty(offsetWord)))
            {
                return(null);
            }


            // tooltip, len nad slovami s bodkou alebo Type
            if (!offsetWord.Contains("."))
            {
                Completion.CompletionData cdType = MainClass.CompletedCache.ListDataTypes.Find(x => x.CompletionText == offsetWord);
                if (cdType != null)
                {
                    return(new TooltipItem(cdType.Description));
                }
                else
                {
                    return(null);
                }
            }

            Completion.CompletionData cd = editor.GetCompletionData(offsetWord);             //ParseString(writeWord,fullWord,completiontype);

            if (cd != null)
            {
                return(new TooltipItem(cd.Description));
            }
            return(null);
        }