From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: Eglot tests on EMBA Date: Fri, 31 Mar 2023 15:03:14 +0100 Message-ID: References: <87y1nyi5cq.fsf@gmx.de> <87tty3eide.fsf@gmx.de> <878rfddxeu.fsf@gmx.de> <87zg7tce2p.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="482"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel To: Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Mar 31 16:04:13 2023 Return-path: Envelope-to: ged-emacs-devel@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 1piFMS-000ARj-VE for ged-emacs-devel@m.gmane-mx.org; Fri, 31 Mar 2023 16:04:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1piFLt-000570-Lf; Fri, 31 Mar 2023 10:03:37 -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 1piFLo-00056K-0F for emacs-devel@gnu.org; Fri, 31 Mar 2023 10:03:35 -0400 Original-Received: from mail-ot1-x332.google.com ([2607:f8b0:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1piFLj-0008J8-6B for emacs-devel@gnu.org; Fri, 31 Mar 2023 10:03:29 -0400 Original-Received: by mail-ot1-x332.google.com with SMTP id k14-20020a9d700e000000b0069faa923e7eso11850814otj.10 for ; Fri, 31 Mar 2023 07:03:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680271406; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Q+7pWH3XT9bvsKVvrd9gdrcDDM97PCBrIKrxMIbn2GM=; b=qRWGpeRjOQ0ED2oKkGSiprlTZlARwpAmG778aQ1XNPhfsA1DDMS8LyHTtHN3e5vkOF Fue2pVeYQq5Yn7llqb4kOhn3cl9Adz+vaX9xcuveotaonICGVaq07ABSByhABc3gdVrd o+Ak4m96PE5pGyy4WqsZ2eq1vluotZPrQQIzIvV2iQ0gKTsEuV96eWdsrN6acW4U7In+ FhwJYM/x3Ir9Nz51Wp4GDOjG5DC11jBWLQsaaMemIdauDpqqAw3+i+De6BJgI18sGSwD d4Ymu+QjFgdtGkRzvW+krZ8HmMmacU0IaurHIMW6M6V8eio3R94z+ifSgHG/dloz37PK hxeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680271406; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Q+7pWH3XT9bvsKVvrd9gdrcDDM97PCBrIKrxMIbn2GM=; b=4BIRl2rysJH9AoQWZWX3qtwrs/PvmsACI2qxe44RiDUDIpIe+GqCyv2PA1nD6sRxZJ /xeewoSLcqA0wKVXumSouHsZCqBiCFie7SZi0lSSKpXO9gLJ0mZPVJvFNjs0u928xl8f cCwkIXJ1wjN/nCt1Yr3jtUU1paZQQRgUS23+nWRmdzeBOVooRJjLRe1cB3EH8JIlLcZL V3yKuTjd0e2kh190rwMpa1D77yXp3gw1B8D1WXZdE8vNZBGYrhKuHaKY4rMDQ/6GHI3t W8+5HYgyLHuK4ExZi258FvL8/hJ+siBUlFkUXfud8DOPpMTBgSEOelOUcR+8U01r93PH hPkg== X-Gm-Message-State: AO0yUKWpnKfABxHmA1+pmb+N0BxbicmAy9zzHLFniNpopBsAngdyvGky Ds7kWO/xl51AmPnvi9rQG2ni/PdK5I11cKzzMu4= X-Google-Smtp-Source: AK7set8SNq7leUxLtNWz7hY+pgizUU6WRFkJcxg0fQkbZOh+T+f402hZd53BqN2hVul0Qa+bfrSouO6UDiKWva6aAf4= X-Received: by 2002:a9d:6c10:0:b0:688:cf52:6e18 with SMTP id f16-20020a9d6c10000000b00688cf526e18mr8798902otq.4.1680271405925; Fri, 31 Mar 2023 07:03:25 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::332; envelope-from=joaotavora@gmail.com; helo=mail-ot1-x332.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: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:304925 Archived-At: Just a follow-up, because I just noticed that I was mixing up pylsp and pyl= s as well pylsp is pip install python-lsp-server pyls is pip install python-language-server The second one is deprecated according to people familiar with the matter. Eglot now "prefers" the first, and so do the tests. Maybe this helps. Jo=C3=A3o On Fri, Mar 31, 2023 at 2:35=E2=80=AFPM Jo=C3=A3o T=C3=A1vora wrote: > > On Fri, Mar 31, 2023 at 1:14=E2=80=AFPM Michael Albinus wrote: > > > > Jo=C3=A3o T=C3=A1vora writes: > > > > Hi Jo=C3=A3o, > > > > >> I'm not happy with this. EMBA installs a conservative list of softwa= re; > > >> they shall be available as Debian bullseye package. > > > > > > Then you should complain to Debian and uninstall pylsp on EMBA is the > > > meantime. > > > > Nothing to complain to Debian. They offer pylsp in the testing version; > > we have simply decided not to use it. We use the stable version. > > > > >> Since Debian bullseye does not offer the package python3-pylsp (whic= h > > >> will be available with a later Debian release), I install on EMBA > > >> python3-pyls. This shall be sufficient, because (according to > > >> eglot-server-programs) "pyls" is supported. > > >> > > >> eglot-tests.el does not dertect this, it checks only for "pylsp". I > > >> believe this shall be changed, > > > > > > No, it shan't :-) I'm not even sure how to do so portably. > > > > The most simple way would be > > > > --8<---------------cut here---------------start------------->8--- > > (skip-unless (or (executable-find "pylsp") (executable-find "pyls"))) > > --8<---------------cut here---------------end--------------->8--- > > > > But this is a sledge hammer approach I guess. > > Hmm, I'm confused. Why are we talking about 'pyls'? The > test is for `pylsp`. It used to be for `pyls`, but now it's > not. 'pyls' would probably have the same "provider" issue. > > My point is that I don't know how to ask the `pylsp` > executable easily what "providers" it supports. pylsp --version > doesn't hint at it. Maybe there is an easy way, but I don't know it. > > Maybe you meant these kinds of changes to eglot-tests.el? > > > diff --git a/test/lisp/progmodes/eglot-tests.el > b/test/lisp/progmodes/eglot-tests.el > index b11ce942b7d..7215dc24b3e 100644 > --- a/test/lisp/progmodes/eglot-tests.el > +++ b/test/lisp/progmodes/eglot-tests.el > @@ -570,7 +570,8 @@ eglot-test-non-unique-completions > '(("project" . (("something.py" . "foo=3D1\nfoobar=3D2\nfoo")))) > (with-current-buffer > (eglot--find-file-noselect "project/something.py") > - (should (eglot--tests-connect)) > + (let ((eglot-server-programs '((python-mode . ("pylsp"))))) > + (should (eglot--tests-connect))) > (goto-char (point-max)) > (completion-at-point)) > ;; FIXME: `current-message' doesn't work here :-( > > > This makes sense to me. It's an oversight that eglot-server-programs > isn't restricted there like it is in other tests. > > To avoid hurting readability too much, this override could > be an option to the eglot--with-fixture macro. > > > eglot-tests.el run for your environment. But there are people with othe= r > > environments (like Debian stable), which could errors running > > eglot-tests.el. > > Yes, I understand, but I also doubt the size of the set intesecting > people who have simplistic pylsp installations and people running > the Emacs test suite. So I'm not very worried. And most people are > using pyright these days anyway. > > > >> the check shall be for all alternatives > > >> configured in eglot-server-programs. And not only for python, but al= so > > >> for other languages. > > > > > > No, that's an immense amount of work and that's not what these > > > tests are really for. People add stuff to eglot-server-programs > > > liberally: it's a huge database now. I'm not crazy about that but > > > is has always been the most fair practice to acommodate server > > > preferences, and people seem like to see their favourite server at > > > least represented there. > > > > Is it that hard to extract all relevant server executables for a given > > major-mode, and iterate over them with executable-find? > > That's not hard, but what do you want to do with this information? > What test do you want to design? I'm not following. Maybe I'm > missing something. > > > > But some of these servers don't work, are deprecated, have > > > inconsistent executable names on different platforms: it's > > > a mess. Testing that is way beyond the scope of eglot-tests.el. > > > > In such a case, the test shall fail. And that would be OK, by this you > > get feedback what doesn't work (given people write bug reports). > > I don't follow. What test fails? What would be considered "failure"? > Not having all possible programs mentioned in `eglot-server-programs` > installed? Can't be that, that's just tyranny :-) There's a lot > of stuff in there. > > > > You may lobby for a eglot-server-program-tests.el instead, > > > and I won't oppose it, but I personally don't have time for that, > > > nor do I see a lot of value at the moment. > > > > > > eglot-tests.el is testing the server-agnostic Elisp logic in > > > eglot.el -- Eglot _is_ server agnostic. We just happen to need > > > someone speaking LSP to be able to exercise features. We could just > > > as well have a (compliant) Elisp LSP server simulator and not worry > > > about external language servers in eglot-tests.el at all. But that'= s quite > > > a bit of work. So some common installations of language servers are = needed. > > > > Sure, possible. I was just speaking about the given state of eglot-test= s.el. > > It's not super, because of these outside dependencies, but it's not a > very bad state, I would say. It helped me catch a bug the other day :-) > > Jo=C3=A3o --=20 Jo=C3=A3o T=C3=A1vora