private void formatToken(ITextEdit editSession, int offSet, IToken token)
        {
            if (token.Channel == XSharpLexer.Hidden ||
                token.Channel == XSharpLexer.PREPROCESSORCHANNEL ||
                token.Type == XSharpLexer.TEXT_STRING_CONST)
            {
                return;
            }
            bool syncKeyword = false;

            // Some exceptions are (pseudo) functions. These should not be formatted
            switch (token.Type)
            {
            case XSharpLexer.UDC_KEYWORD:
                syncKeyword = XSettings.UDCKeywordCase;
                break;

            case XSharpLexer.NAMEOF:
            case XSharpLexer.SIZEOF:
            case XSharpLexer.TYPEOF:
                // these are keywords but should be excluded I think
                syncKeyword = false;
                break;

            case XSharpLexer.TRUE_CONST:
            case XSharpLexer.FALSE_CONST:
            case XSharpLexer.MACRO:
            case XSharpLexer.LOGIC_AND:
            case XSharpLexer.LOGIC_OR:
            case XSharpLexer.LOGIC_NOT:
            case XSharpLexer.LOGIC_XOR:
            case XSharpLexer.VO_AND:
            case XSharpLexer.VO_OR:
            case XSharpLexer.VO_NOT:
            case XSharpLexer.VO_XOR:
                syncKeyword = true;
                break;

            default:
                if (token.Type >= XSharpLexer.FIRST_NULL && token.Type <= XSharpLexer.LAST_NULL)
                {
                    syncKeyword = true;
                }
                else if (XSharpLexer.IsKeyword(token.Type))
                {
                    syncKeyword = token.Text[0] != '#';
                }
                break;
            }
            if (syncKeyword)
            {
                var keyword   = token.Text;
                var transform = XSettings.FormatKeyword(keyword, _settings.KeywordCase);
                if (String.Compare(transform, keyword) != 0)
                {
                    int startpos = offSet + token.StartIndex;
                    editSession.Replace(startpos, transform.Length, transform);
                }
            }
            if (token.Type == XSharpLexer.ID && XSettings.IdentifierCase)
            {
                var identifier    = token.CleanText();
                var lineNumber    = getCurrentLine();
                var currentMember = _textView.FindMember();
                //
                if (currentMember == null)
                {
                    return;
                }
                IXVariableSymbol element = null;
                // Search in Parameters
                if (currentMember.Parameters != null)
                {
                    element = currentMember.Parameters.Where(x => XSharpTokenTools.StringEquals(x.Name, identifier)).FirstOrDefault();
                }
                if (element == null)
                {
                    // then Locals
                    var location = new XSharpSearchLocation(currentMember.File, currentMember, null, lineNumber);
                    var locals   = currentMember.GetLocals(location);
                    if (locals != null)
                    {
                        element = locals.Where(x => XSharpTokenTools.StringEquals(x.Name, identifier)).FirstOrDefault();
                    }
                    if (element == null)
                    {
                        if (currentMember.Parent is IXTypeSymbol type)
                        {
                            var field = XSharpLookup.SearchPropertyOrField(location, type, identifier, Modifiers.Private).FirstOrDefault();
                        }
                    }
                }
            }
        }