From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Wilhelm Kirschbaum Newsgroups: gmane.emacs.bugs Subject: bug#64274: 30.0.50; Eglot requests textDocument/documentSymbol if its not declared in the server capabilities Date: Sun, 25 Jun 2023 01:21:16 +0200 Message-ID: <87wmzsqwdh.fsf@gmail.com> References: <878rc8ej73.fsf@gmail.com> <874jmwei3g.fsf@gmail.com> <875y7c8ouk.fsf@gmail.com> <871qi0795z.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9831"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.9.3; emacs 30.0.50 Cc: 64274@debbugs.gnu.org To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 25 01:23:22 2023 Return-path: Envelope-to: geb-bug-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 1qDCbC-0002RK-2b for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 25 Jun 2023 01:23:22 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qDCau-0008Jj-3b; Sat, 24 Jun 2023 19:23:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qDCas-0008Cb-43 for bug-gnu-emacs@gnu.org; Sat, 24 Jun 2023 19:23:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qDCar-0000sk-Qh for bug-gnu-emacs@gnu.org; Sat, 24 Jun 2023 19:23:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qDCar-0004aH-LG for bug-gnu-emacs@gnu.org; Sat, 24 Jun 2023 19:23:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Wilhelm Kirschbaum Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Jun 2023 23:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64274 X-GNU-PR-Package: emacs Original-Received: via spool by 64274-submit@debbugs.gnu.org id=B64274.168764893617563 (code B ref 64274); Sat, 24 Jun 2023 23:23:01 +0000 Original-Received: (at 64274) by debbugs.gnu.org; 24 Jun 2023 23:22:16 +0000 Original-Received: from localhost ([127.0.0.1]:41698 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDCa7-0004ZD-V6 for submit@debbugs.gnu.org; Sat, 24 Jun 2023 19:22:16 -0400 Original-Received: from mail-wm1-f49.google.com ([209.85.128.49]:59480) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDCa3-0004Yx-Vc for 64274@debbugs.gnu.org; Sat, 24 Jun 2023 19:22:14 -0400 Original-Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-3f9002a1a39so18429135e9.2 for <64274@debbugs.gnu.org>; Sat, 24 Jun 2023 16:22:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687648926; x=1690240926; h=content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:cc:to:from:user-agent:references:from:to:cc:subject:date :message-id:reply-to; bh=dyd1maTMYxTp9tOqkSy1CRz+Aqacm7atuiUdURrBeG8=; b=CyqmKl0onO3AaYZOD9ER+7taqMjZrpHy0U26CErJkrar7LE/k7fsgqr5u4O/utk/nj gfwqnl6QNSp7l+GOOCJudQ/XXQv0p7UcvHvMYR90MCbqHUdgVR7xqmlga/nYo/5wAbej ANyc8MHa737Sor/8x8YwlEy7lqnHPCbBgmxEBGlew0DPg674i7ZRznWr94E1jH9/Asmw YVJAjYo5AQ7DR3/7mKhuqBs+UJ6gRgrALV4FGUwLSCuqakPBbJQ9mXMBUfT9aZIYx3JH o0nZnro7y4oEH0MdCRVzPKL+10pkvZaDWB+NbwLH/z5ZlE9XJKQXWYbwbvOODaZligwa McfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687648926; x=1690240926; h=content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:cc:to:from:user-agent:references:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=dyd1maTMYxTp9tOqkSy1CRz+Aqacm7atuiUdURrBeG8=; b=KAI099FW2TXgCmgKAwHRB4MkMjG3phB12gzhmmq7JZ8XV4bKohg3C0HUXV2ryJLZ/u F61mrO3j1E6OMwhYJkFbhdJIHiLkdGjq8RIv1W0TpD0wRZ1vU+Kjc6mjCf7z7MkYReCq rfuotDbQjXz9vrUCeAzLPMu/B78ndbh/oSbYeczWoyuibMrysZ9RjxNeJu4Pc4CTVfD0 A9DK5lV5B+NPsXfZFlLBIqyo2QTKS6KhFrR6TFYXyKw5z78VwPGdh98qj4JDQlRIdSZn E1RSkgZkt5XbUwrw+2OfvejnTpGDFgz4R6w5JphsuCw2E9JgbQVcgzQ7anrcLA1W86Oo aY4Q== X-Gm-Message-State: AC+VfDwH3WkcqbtzTXn0V9nJxyFU4h9jkJecpMUj5moJeXz0MpBBKqdk PJCBymgTDlr0alyOkacRxZCbJdELywo= X-Google-Smtp-Source: ACHHUZ7eeJkhREok646cCOMzyseSN2r17/UJWLLRzRwNiK6u4pwlJAqsEH78lF+2oGFjt8kFAUS4rw== X-Received: by 2002:a05:600c:3797:b0:3fa:838a:1dcf with SMTP id o23-20020a05600c379700b003fa838a1dcfmr1522400wmr.6.1687648925743; Sat, 24 Jun 2023 16:22:05 -0700 (PDT) Original-Received: from melissa.local (ec2-13-245-180-173.af-south-1.compute.amazonaws.com. [13.245.180.173]) by smtp.gmail.com with ESMTPSA id n23-20020a7bcbd7000000b003f9b19caabesm3246895wmi.37.2023.06.24.16.22.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Jun 2023 16:22:05 -0700 (PDT) In-reply-to: <871qi0795z.fsf@gmail.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:264021 Archived-At: > OK, this makes sense. Then please test this instead. > > Jo=C3=A3o > > diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el > index e2478f2dde3..c353ab6fce0 100644 > --- a/lisp/progmodes/eglot.el > +++ b/lisp/progmodes/eglot.el > @@ -3348,9 +3348,11 @@ eglot--imenu-DocumentSymbol > (mapcar (lambda (c) (apply #'dfs=20 > c)) children)))))) > (mapcar (lambda (s) (apply #'dfs s)) res))) >=20=20 > -(defun eglot-imenu () > +(cl-defun eglot-imenu () > "Eglot's `imenu-create-index-function'. > Returns a list as described in docstring of=20 > `imenu--index-alist'." > + (unless (eglot--server-capable :textDocument/documentSymbol) > + (cl-return-from eglot-imenu)) > (let* ((res (eglot--request (eglot--current-server-or-lose) > :textDocument/documentSymbol > `(:textDocument Yes, this works. Thank you. :) Wilhelm