<commit_before>;;; feature/lsp/autoload.el -*- lexical-binding: t; -*-

;;;###autodef
(defun set-lsp-priority! (client priority)
  "Change the PRIORITY of lsp CLIENT."
  (require 'lsp-mode)
  (if-let (client (gethash client lsp-clients))
      (setf (lsp--client-priority (gethash server lsp-clients))
            priority)
    (error "No LSP client named %S" client)))

;;;###autodef
(defalias 'lsp! #'lsp-deferred)

;;;###autoload
(defun +lsp/uninstall-server (dir)
  "Delete a LSP server from `lsp-server-install-dir'."
  (interactive
   (list (read-directory-name "Uninstall LSP server: " lsp-server-install-dir nil t)))
  (unless (file-directory-p dir)
    (user-error "Couldn't find %S directory" dir))
  (delete-directory dir 'recursive)
  (message "Uninstalled %S" (file-name-nondirectory dir)))

;;;###autoload
(defun +lsp/switch-client (client)
  "Switch to another LSP server."
  (interactive
   (progn
     (require 'lsp-mode)
     (list (completing-read
            "Select server: "
            (or (mapcar #'lsp--client-server-id (lsp--find-clients))
                (user-error "No available LSP clients for %S" major-mode))))))
  (require 'lsp-mode)
  (let* ((client (if (symbolp client) client (intern client)))<commit_msg>Fix void-variable server in set-lsp-priority!<commit_after>;;; feature/lsp/autoload.el -*- lexical-binding: t; -*-

;;;###autodef
(defun set-lsp-priority! (client priority)
  "Change the PRIORITY of lsp CLIENT."
  (require 'lsp-mode)
  (if-let (client (gethash client lsp-clients))
      (setf (lsp--client-priority (gethash client lsp-clients))
            priority)
    (error "No LSP client named %S" client)))

;;;###autodef
(defalias 'lsp! #'lsp-deferred)

;;;###autoload
(defun +lsp/uninstall-server (dir)
  "Delete a LSP server from `lsp-server-install-dir'."
  (interactive
   (list (read-directory-name "Uninstall LSP server: " lsp-server-install-dir nil t)))
  (unless (file-directory-p dir)
    (user-error "Couldn't find %S directory" dir))
  (delete-directory dir 'recursive)
  (message "Uninstalled %S" (file-name-nondirectory dir)))

;;;###autoload
(defun +lsp/switch-client (client)
  "Switch to another LSP server."
  (interactive
   (progn
     (require 'lsp-mode)
     (list (completing-read
            "Select server: "
            (or (mapcar #'lsp--client-server-id (lsp--find-clients))
                (user-error "No available LSP clients for %S" major-mode))))))
  (require 'lsp-mode)
  (let* ((client (if (symbolp client) client (intern client)))
{'fraction_non_alphanumeric': 0.16308671439936356, 'fraction_numerical': 0.0, 'mean_word_length': 3.4592198581560285, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5190705', 'n_tokens_mistral': 911, 'n_tokens_neox': 894, 'n_words': 231}