help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fix the confliction between lsp-ui-doc-mode and dap-tooltip-mode with ad


From: Hongyi Zhao
Subject: Fix the confliction between lsp-ui-doc-mode and dap-tooltip-mode with advice function.
Date: Wed, 6 Oct 2021 16:09:49 +0800

Fix the confliction between lsp-ui-doc-mode and dap-tooltip-mode with
advice function.

I'm experiencing the bugs reported here [1]. To be specific, there is
a confliction between `lsp-ui-doc-mode' and `dap-tooltip-mode' when
both of them are enabled, which will cause the debugger not to display
the variable value when the mouse hovers over the corresponding
variable name. And the expedient is to define an advice function which
do the following:

Once I try to run `dap-debug', disable the `lsp-ui-doc-mode' if it has
already been enabled for the current buffer; and enable it when the
`dap-disconnect' command is issued.

I tried the suggested functions here [2], as shown below, but it doesn't work:

(define-advice dap-debug (:after (orig-func &rest args)
disable-lsp-ui-doc) (lsp-ui-doc-mode -1))
(define-advice dap-disconnect (:after (orig-func &rest args)
enable-lsp-ui-doc) (lsp-ui-doc-mode t))

[1] https://github.com/emacs-lsp/dap-mode/issues/372
[2] https://github.com/emacs-lsp/dap-mode/issues/372#issuecomment-848784686

Any hints for adapting or writing a working lisp code snippet for
solving the above problem?

Regards
-- 
Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province



reply via email to

[Prev in Thread] Current Thread [Next in Thread]