anchor.diff:        "textDocument" (text-document-client-capabilities)
         #|"experimental"|#))
   
  +(defun convert-text-document-sync (sync)
  +  (etypecase sync
  +    (number
  +     (make-text-document-sync :change sync))
  +    (hash-table
  +     (make-text-document-sync :open-close (gethash "openClose" sync)
  +                              :change (gethash "change" sync)
  +                              :will-save (gethash "willSave" sync)
  +                              :will-save-wait-until (gethash "willSaveWaitUntil" sync)
  +                              :save (gethash "save" sync)))))
  +
   (defun initialize (workspace)
     (let* ((root (workspace-root workspace))
            (response (jsonrpc:call (workspace-connection workspace)
  
positive.code: (defstruct workspace
    connection
    server-capabilities
    root
    language-id
    (file-version-table (make-hash-table)))
  
  (lem:define-minor-mode language-client-mode
      (:name "Language Client")
    (setf (lem:variable-value 'lem.language-mode:completion-function) 'completion)
    ;(uiop:run-program "go-langserver -mode tcp -gocodecompletion &")
    (start (lem:current-buffer)))
  
  (defun get-language-id (language)
    (ecase language
  
negative.code:         (jsonrpc:jsonrpc-error-message e)))))
  
  (defun on-change (point arg)
    (let* ((buffer (lem:point-buffer point))
           (workspace (buffer-workspace buffer)))
      (incf (buffer-file-version buffer))
      (text-document-did-change buffer
                                (if (eql 1
                                         (text-document-sync-change
                                          (workspace-text-document-sync workspace)))
                                    (list (text-document-content-change-event
                                           point
                                           (if (characterp arg)
                                               (string arg)
                                               arg)))
                                    (list ({} "text" (buffer-text buffer)))))))
  
  (defun initialize-hooks (buffer)
    (lem:add-hook (lem:variable-value 'lem:before-change-functions :buffer buffer) 'on-change)
  