From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hongyi Zhao Newsgroups: gmane.emacs.help 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 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15883"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 06 10:11:01 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mY20y-0003mk-II for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 06 Oct 2021 10:11:00 +0200 Original-Received: from localhost ([::1]:59884 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mY20x-0004GZ-BC for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 06 Oct 2021 04:10:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mY203-0004Fl-AL for help-gnu-emacs@gnu.org; Wed, 06 Oct 2021 04:10:03 -0400 Original-Received: from mail-ua1-x936.google.com ([2607:f8b0:4864:20::936]:38537) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mY201-00005B-1C for help-gnu-emacs@gnu.org; Wed, 06 Oct 2021 04:10:03 -0400 Original-Received: by mail-ua1-x936.google.com with SMTP id y3so1165811uar.5 for ; Wed, 06 Oct 2021 01:10:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=IgumVxdA5KBnpJDTqySxu2epRTFq3qzqRSdrrQRYwXA=; b=HdAHV9WD2xDSnctavB7yW6EyQfJRpAWAxHFLVQqha0yMEZGEsFj7ecbJ45VYLYUGqk ZwwKPrcqpB2KIR7U9k9VLyFFnpsKcWSWa4FbAt/+NRJP8LmoKvBRBiKkLFk6G2jqsSbb U+sM62dcTXI/CfPK9+nrehtsSQddySkfMJRClx9yLGkKHuavXnzim1QBcjCpYMd5S4rt 7TqT4X8oYH+7H8oJv/SyKYhDij/NdxQ4gxdchfgTMeuyrlqhnD54ZibbxSAWUoEYAFBP 4D/uSck9/7Icdf0Y2Ek88GTa08I5HBBeRqY5+JaA6+swjDCnMiUPttMseY39L+3822BK 9ypg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=IgumVxdA5KBnpJDTqySxu2epRTFq3qzqRSdrrQRYwXA=; b=reSE3y1tSjvC/ecBMdDhxu6strZrKBteJfH9YTlkjx0iPIlMjjJpYOmhtRPFrchUV+ OsFkXBgLOjO99GMN1jLikNWtbYQ3jLv41bK0ClQ9nw4XA2Dx95Ov3dyZhKBQR5s8ufnC EytsMWgJycTB9l1uKf1A93f7yfgVK0KTCm+j5oCDGB4hF/hHLG40OK9DsTkLg+x87/FQ 4jn2KDsTzJFcxmVAeVOJqZXGHT/+0fnoALorBVg1yLBE6V/vMwVN2ZBjiEhw9W9U5xqF AdxKHNCKwfl6aRR118gR3Z6b/LzwXI3dGv6/lDAHQWmjL/p9a1BGX8Ql09hNGRClO3yf FBbQ== X-Gm-Message-State: AOAM531U/NO2LdbMT/AhFyTnnhs00HAvPFtjP4h4wfpT5LdIpVU3TXUf pC3wPbiOIjhBgSh+kx2VK8L8omUUK+V6XSdchO3wkTbO4l0+OpS3 X-Google-Smtp-Source: ABdhPJzNsYORawP8/i+a7hK9sCoTGwiD+VfeT2Gn+k1AUHti34/NjEiHtJ+cy2sFWAk0WXgTv487RaLw3viYuaT8+Iw= X-Received: by 2002:ab0:1001:: with SMTP id f1mr15960304uab.115.1633507799791; Wed, 06 Oct 2021 01:09:59 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::936; envelope-from=hongyi.zhao@gmail.com; helo=mail-ua1-x936.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:133603 Archived-At: 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 Theory and Simulation of Materials Hebei Vocational University of Technology and Engineering No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province