bool IsIdentifierKey(string text)
 {
     if (string.IsNullOrWhiteSpace(text))
     {
         return(false);
     }
     return(CodeUtils.IsIdentifierCharacter(text[0]));
 }
        public static string GetIdentifierLeftOf(this TextDocument document, int caretOffset)
        {
            string result   = string.Empty;
            string lineText = document.GetLineLeftOf(caretOffset);
            int    index    = lineText.Length - 1;

            while (index >= 0 && CodeUtils.IsIdentifierCharacter(lineText[index]))
            {
                result = lineText[index] + result;
                index--;
            }
            return(result);
        }