コード例 #1
0
 bool IsIdentifierKey(string text)
 {
     if (string.IsNullOrWhiteSpace(text))
     {
         return(false);
     }
     return(CodeUtils.IsIdentifierCharacter(text[0]));
 }
コード例 #2
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);
        }