def to_lsp_name(method_name):
    """Convert method name to LSP real name

    Example:
        text_document__did_open -> textDocument/didOpen
    """
    method_name = method_name.replace('__', '/')
    m_chars = list(method_name)
    m_replaced = []
    for i, ch in enumerate(m_chars):
        if ch == '_':
            continue
        if m_chars[i - 1] == '_':
            m_replaced.append(ch.capitalize())
            continue
        m_replaced.append(ch)
    return ''.join(m_replaced)
