Skip to content

Instantly share code, notes, and snippets.

@twlz0ne
Last active June 10, 2020 07:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save twlz0ne/75a7a54941a6ba54f66aaf4c5aeaba54 to your computer and use it in GitHub Desktop.
Save twlz0ne/75a7a54941a6ba54f66aaf4c5aeaba54 to your computer and use it in GitHub Desktop.
Test lsp-ui
;;; Usage: /path/to/emacs -Q -l /path/to/test-lsp-ui.el
;;; Date: 2018-01-03_09.07.11
(toggle-debug-on-error)
(global-set-key (kbd "C-h") 'delete-backward-char)
(global-set-key (kbd "M-h") 'backward-kill-word)
(global-set-key (kbd "<f1>") 'help-command)
(define-key isearch-mode-map "\C-h" 'isearch-delete-char)
(unless (display-graphic-p)
(error "Please run Emacs in GUI mode!"))
;; ------------------------------------------------------------------
(setq package-user-dir
(concat
user-emacs-directory
(format "elpa--%s/%s" (file-name-base load-file-name) emacs-version)))
(unless (load (concat user-emacs-directory "elpa.el") t)
(setq package-archives
'(("gnu" . "https://elpa.gnu.org/packages/")
("melpa" . "https://melpa.org/packages/"))))
(package-initialize)
(defun require-packages (&rest packages)
(dolist (pkg packages)
(unless (package-installed-p pkg)
(package-refresh-contents)
(package-install pkg))
(require pkg)))
(require-packages
'lsp-mode
'lsp-ui
'lsp-python
'pyenv-mode
'helm
'solarized-theme)
;; ------------------------------------------------------------------
;; Uncomment the following code to get the latest `lsp-ui'.
;; (setq el-get-dir (concat user-emacs-directory (format "el-get--%s/%s" (file-name-base load-file-name) emacs-version)))
;; (add-to-list 'load-path (concat el-get-dir "/el-get"))
;; (setq el-get-git-shallow-clone t)
;; (setq el-get-byte-compile nil)
;; (setq el-get-bundle-byte-compile nil)
;; (setq el-get-install-skip-emacswiki-recipes t)
;; (unless (require 'el-get nil 'noerror)
;; (with-current-buffer
;; (url-retrieve-synchronously
;; "https://raw.githubusercontent.com/dimitri/el-get/master/el-get-install.el")
;; (goto-char (point-max))
;; (eval-print-last-sexp)))
;; (remove-hook 'el-get-post-install-hooks 'el-get-post-install-notification)
;; (el-get-bundle lsp-ui
;; :type git
;; :url "https://github.com/emacs-lsp/lsp-ui"
;; (require 'lsp-ui))
;; ------------------------------------------------------------------
(add-hook 'after-init-hook
(lambda ()
;; ------------------------------------------------------------------
;; configuration
;; ------------------------------------------------------------------
(load-theme 'solarized-dark t)
(add-hook 'lsp-mode-hook 'lsp-ui-mode)
(add-hook 'python-mode-hook #'lsp-python-enable)
(require 'helm-config)
(setq helm-ff-skip-boring-files nil)
(global-set-key (kbd "M-x") 'helm-M-x)
(global-set-key (kbd "C-x C-f") 'helm-find-files)
(global-set-key (kbd "C-x b") 'helm-mini)
;; ------------------------------------------------------------------
;; steps to reproduce issue
;; ------------------------------------------------------------------
(insert "\
;;; Steps to reproduce issue:
;; 1
(lsp-ui-doc--display 'foo \"bar\")
;; 2
(call-interactively 'helm-M-x)
;; 3
;; Press `C-n' / `C-p'
;; `helm' CANNOT accept user input or keypresses
;; 4
(lsp-ui-doc--delete-frame)
;; 5
(call-interactively 'helm-M-x)
;; 6
;; Press `C-n' / `C-p'
;; `helm' CAN accept user input or keypresses")))
(run-hooks 'after-init-hook)
;;; test-lsp-ui.el ends here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment