Skip to content

Commit

Permalink
Disable lsp-mode optimizations due to bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Souheab committed Mar 9, 2024
1 parent 9fbebd6 commit a00554a
Showing 1 changed file with 30 additions and 37 deletions.
67 changes: 30 additions & 37 deletions emacs.org
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ This is a literate config of my emacs configuration, to install this simply run
* Early Init

#+begin_src emacs-lisp :tangle ~/.config/emacs/early-init.el
(setenv "LSP_USE_PLISTS" "true")
(setq lsp-use-plists t)
;(setenv "LSP_USE_PLISTS" "true")
;(setq lsp-use-plists t)
#+end_src

* Performance
Expand Down Expand Up @@ -1020,34 +1020,34 @@ This is a literate config of my emacs configuration, to install this simply run
(add-to-list 'lsp-language-id-configuration '(js-jsx-mode . "javascriptreact") t)
)

(defun lsp-booster--advice-json-parse (old-fn &rest args)
"Try to parse bytecode instead of json."
(or
(when (equal (following-char) ?#)
(let ((bytecode (read (current-buffer))))
(when (byte-code-function-p bytecode)
(funcall bytecode))))
(apply old-fn args)))
(advice-add (if (progn (require 'json)
(fboundp 'json-parse-buffer))
'json-parse-buffer
'json-read)
:around
#'lsp-booster--advice-json-parse)

(defun lsp-booster--advice-final-command (old-fn cmd &optional test?)
"Prepend emacs-lsp-booster command to lsp CMD."
(let ((orig-result (funcall old-fn cmd test?)))
(if (and (not test?) ;; for check lsp-server-present?
(not (file-remote-p default-directory)) ;; see lsp-resolve-final-command, it would add extra shell wrapper
lsp-use-plists
(not (functionp 'json-rpc-connection)) ;; native json-rpc
(executable-find "emacs-lsp-booster"))
(progn
(message "Using emacs-lsp-booster for %s!" orig-result)
(cons "emacs-lsp-booster" orig-result))
orig-result)))
(advice-add 'lsp-resolve-final-command :around #'lsp-booster--advice-final-command)
;; (defun lsp-booster--advice-json-parse (old-fn &rest args)
;; "Try to parse bytecode instead of json."
;; (or
;; (when (equal (following-char) ?#)
;; (let ((bytecode (read (current-buffer))))
;; (when (byte-code-function-p bytecode)
;; (funcall bytecode))))
;; (apply old-fn args)))
;; (advice-add (if (progn (require 'json)
;; (fboundp 'json-parse-buffer))
;; 'json-parse-buffer
;; 'json-read)
;; :around
;; #'lsp-booster--advice-json-parse)

;; (defun lsp-booster--advice-final-command (old-fn cmd &optional test?)
;; "Prepend emacs-lsp-booster command to lsp CMD."
;; (let ((orig-result (funcall old-fn cmd test?)))
;; (if (and (not test?) ;; for check lsp-server-present?
;; (not (file-remote-p default-directory)) ;; see lsp-resolve-final-command, it would add extra shell wrapper
;; lsp-use-plists
;; (not (functionp 'json-rpc-connection)) ;; native json-rpc
;; (executable-find "emacs-lsp-booster"))
;; (progn
;; (message "Using emacs-lsp-booster for %s!" orig-result)
;; (cons "emacs-lsp-booster" orig-result))
;; orig-result)))
;; (advice-add 'lsp-resolve-final-command :around #'lsp-booster--advice-final-command)

(use-package lsp-ui
:custom
Expand Down Expand Up @@ -1420,13 +1420,6 @@ This is a literate config of my emacs configuration, to install this simply run

#+end_src

*** Java

#+begin_src emacs-lisp
(use-package lsp-java
:after java-mode
)
#+end_src

*** Common Lisp

Expand Down

0 comments on commit a00554a

Please sign in to comment.