From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tim Cross Newsgroups: gmane.emacs.devel Subject: Re: Eglot, project.el, and python virtual environments Date: Fri, 18 Nov 2022 09:21:48 +1100 Message-ID: <86mt8p4221.fsf@gmail.com> References: <87zgcq68zp.fsf@ericabrahamsen.net> <878rkale3l.fsf@dfreeman.email> <87v8nezf2k.fsf@ericabrahamsen.net> <87o7t5k7sv.fsf@dfreeman.email> 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="22427"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.9.2; emacs 29.0.50 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 18 00:03:41 2022 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 1ovnv2-0005bl-MD for ged-emacs-devel@m.gmane-mx.org; Fri, 18 Nov 2022 00:03:40 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ovnuP-0006zT-Us; Thu, 17 Nov 2022 18:03:01 -0500 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 1ovnuO-0006z2-5T for emacs-devel@gnu.org; Thu, 17 Nov 2022 18:03:00 -0500 Original-Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ovnuI-0002Mz-9J for emacs-devel@gnu.org; Thu, 17 Nov 2022 18:02:56 -0500 Original-Received: by mail-pj1-x1035.google.com with SMTP id r61-20020a17090a43c300b00212f4e9cccdso6703310pjg.5 for ; Thu, 17 Nov 2022 15:02:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:to:from:user-agent:references:from:to:cc:subject:date :message-id:reply-to; bh=AMau9tuFkfgK+JTutediLtIpicCxypZTbBXgcFkaq6k=; b=UPldCu2ArKQG6cgMUCOlslp1ypsRrsxpsTYS6F60Dg2C8VP9Ak/e1iDI1ZdPmBBbPS a1xGdLErGGJxB7Sx1fcx29o3odusGZgyJ0Fp2iYrc+qDAdzct25QDjCzktBN9ZS5CLGr Sjpsgz51b6A33KerfugJ0bEkG7ljMQa7nx5cvFJwfGqrKXhsO7Xfi8pLhUJH0XQhwBpy DXKyDeiD+WJQDqBhNyrI8oTulxwL1ln8lGjQrbnloToOwCZsa+p08ujoUHkGrb6wXwOK JUX9uQiKZvCYVLs4gOGt0z83vMnXZ87XTFyrWF+pH3+ROXhMEkIjGX/apxt3j/MXJlY4 UqKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:to:from:user-agent:references:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AMau9tuFkfgK+JTutediLtIpicCxypZTbBXgcFkaq6k=; b=jGTpxskUGO/Nk0Wi0bvtikJDarCWzHkor8mHHXN+p2zIzCoFc5n0kPX5GKkLM0ia+z bWwEzB8pzyBU6Vt44cxXnC/c+krKA9bAt/0pP5922vcitZnVGf0kjuIa9uAhEpYp3Eas Ow06AII+yScYNw69+kJzAJ6+nUxVH3Yrj7BMd0KhNC7NdSN+USeUT6RA/dGS3ge32cAE tn0aTycSA8ecvHhkgEHi4XCmR9AFzfpcHEdYuX+BOz3ZZ77Y7jTrhgHw5DoKyh6Kuvwd dzz9aa3UpyFkhpLd2uwqycTqKgKwwvzV65udKydvkKa8XdOXXOB46gyAV6iKeFso0roO tHRA== X-Gm-Message-State: ANoB5pkCkpPv4elp8vah0R6oR4fpX6rk+HnITzTmyiyJKNzN8nLhN758 79+LD/X56EqXEceUyfxL+F/Uz5zlDRI= X-Google-Smtp-Source: AA0mqf7E20hWP37YAxTWHPPctlP6OvPJtqaqLVGgEDAW9KppAd+jpLWnJiYyCPhY1hUkLFDa1yOnKA== X-Received: by 2002:a17:90a:194b:b0:20c:c0f:7c69 with SMTP id 11-20020a17090a194b00b0020c0c0f7c69mr4731712pjh.196.1668726171086; Thu, 17 Nov 2022 15:02:51 -0800 (PST) Original-Received: from dingbat (220-235-181-183.dyn.iinet.net.au. [220.235.181.183]) by smtp.gmail.com with ESMTPSA id p4-20020a170902e74400b0018691ce1696sm1976334plf.131.2022.11.17.15.02.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Nov 2022 15:02:50 -0800 (PST) In-reply-to: <87o7t5k7sv.fsf@dfreeman.email> Received-SPF: pass client-ip=2607:f8b0:4864:20::1035; envelope-from=theophilusx@gmail.com; helo=mail-pj1-x1035.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:300076 Archived-At: Danny Freeman writes: > Eric Abrahamsen writes: > >> > > project_root >> > > =E2=94=9C=E2=94=80=E2=94=80 .git >> > > =E2=94=9C=E2=94=80=E2=94=80 src >> > > =E2=94=82 =E2=94=94=E2=94=80=E2=94=80 python >> > > =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 VeryImportantLambda >> > > =E2=94=82 =E2=94=82 =E2=94=94=E2=94=80=E2=94=80 .venv >> > > =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 MoreImportance >> > > =E2=94=82 =E2=94=82 =E2=94=94=E2=94=80=E2=94=80 .venv >> > > =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 RunInCaseOfEmergency >> > > =E2=94=82 =E2=94=82 =E2=94=94=E2=94=80=E2=94=80 .venv > > I just realized you posted information about the .venv files in your > original post and I completely overlooked that lol.=20 > >> Thank you very much, that does help indeed! I started off down this path >> and had gotten as far as eglot-lsp-context. Then I realized I couldn't >> just return a directory, it had to be a project object, and that's when >> I decided someone else must have a better approach. But it's great to >> see all this laid out, and knowing about `(cons 'transient root)' is >> very helpful, as well. >> >> I'll play around with this a bit. It seems like a not-outlandish >> situation, and I wonder if it might not be useful to provide some >> standardized method of helping Eglot find an alternate project. >> >> Thanks again, >> Eric > > Anyways yeah, I think I've heard about someone else running into this as > well. Maybe it was on the reddit emacs forum. Either way, I do not think > you are the first. > > What might an extension for Eglot look like? Maybe a built in > `project-find-functions' implementation that does something similar > looking for a `.eglot-lsp-root` (or probably something configurable) as > a transient project root? I don't know if that would cause problems out > of the box for some people, but it seems safe. Just a thought, apologies if I've missed something as I'm coming to this late.... I"m making the basic assumption that a project, from the eglot perspective, is what project.el tells it is a project.=20 Is this something which should be addressed at the eglot level or at the project level? It seems to me that what you really have here is a main project which consists of a number of sub-projects and that it could be beneficial more generally if you could more easily isolate out the sub-projects (not just for eglot, but possibly for other tools as well) at the project.el layer rather than the eglot layer. This could mean the user has to be more involved in defining the project and sub-project structure/relationships, but that may be reasonable when you have more complex project structure? I guess my question here is whether the focus should be on enhancing project.el rather than modifying/enhancing eglot.el to handle this use case?