From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Felician Nemeth Newsgroups: gmane.emacs.devel Subject: Re: Eglot to core [Was: rmsbolt.el [Was: Colorful line numbers]] Date: Mon, 25 Jul 2022 17:00:51 +0200 Message-ID: <87mtcxgrto.fsf@betli.tmit.bme.hu> References: <87leslpow2.fsf@gmail.com> <874jz9peq0.fsf@gmail.com> <837d45l6ge.fsf@gnu.org> <87zgh1nyo6.fsf@gmail.com> <831qudl1k3.fsf@gnu.org> <87v8rpntiv.fsf@gmail.com> <83sfmtjjy8.fsf@gnu.org> <87fsitnpxd.fsf@gmail.com> <83k085jgxr.fsf@gnu.org> <87tu77vq1a.fsf@eve> <874jz6mj6b.fsf@gmail.com> <87r12aypas.fsf@yahoo.com> <87h735zp5o.fsf@yahoo.com> <87r129h0nn.fsf@betli.tmit.bme.hu> <87ilnlxtqz.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35526"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Cc: Po Lu , Stefan Monnier , Stefan Kangas , Eli Zaretskii , emacs-devel To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jul 25 17:04:24 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 1oFzd9-00092a-Fz for ged-emacs-devel@m.gmane-mx.org; Mon, 25 Jul 2022 17:04:23 +0200 Original-Received: from localhost ([::1]:55766 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oFzd8-0003qx-7z for ged-emacs-devel@m.gmane-mx.org; Mon, 25 Jul 2022 11:04:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33640) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oFzZq-0001dp-Es for emacs-devel@gnu.org; Mon, 25 Jul 2022 11:00:58 -0400 Original-Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:44585) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oFzZo-0000sD-CB; Mon, 25 Jul 2022 11:00:58 -0400 Original-Received: by mail-wr1-x42c.google.com with SMTP id l15so12313891wro.11; Mon, 25 Jul 2022 08:00:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:face:mime-version; bh=bf0e37diOgXHopvA8XOIwJpQfP4TdMVRSywOr8JRITg=; b=ihvpaNXtr/kbFjDJCmW3ZxRctE6OmBslGrAPQx/CEWc+2a6Z7yITRaiTb1waRcHXvk wXGjxQ/p1Y9p+BQATeAvMN8RSxhCTkkLxw3qZvXoBnYqTjmHXRkeIawwag7AQWNGnRWD LnAklBy9AIg7ZBNPndLXpj0afTRCWUviMdyLIWu6tMEN2dwyDSclr1OKCpzXYdTpfrl4 b0Ecj8vCfTshZTjRc3bS3RTMY9MqWKzvmjWfEhltCFDd4v0qthWYByJYrJz6n+wlG+3T vv01hjjT+milg4o5HPLEolN55/EysMK4S0dMr2UE40H3U0TslIiUvQqRG8vYgd1BD7ZU PZ1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:face:mime-version; bh=bf0e37diOgXHopvA8XOIwJpQfP4TdMVRSywOr8JRITg=; b=vZaIiXDQbAdfVR9ZbeInNU7BcFHRHVn/CPDcCsS3VH1Vy1UEfzquy+XnFYdVvumE5c n0odusyorTmux4/UlbPGUPxqgmB+nCV73K2Uk7TLhc0wWSwMGADCuKZ7m/00S8THfe41 125aRVrVR6BoQwJeaNuL90J7Pt0zCwxdp73S2ZRvvqsFua7OAdjGPYP2WyCcpLlvIekC GI1DL9xxF9BZXYbQ7VoCLWDEtY4MJz7ilUo44hYR0RE2nAGZ0zMJG14mCRjyjWp2NZcp JBo58lKuchcHkZJPRFaihBRV6fojfTlNCsfjApZOIPTp8ttmUcpzL2vI5gRDaGgHXFgY h2wQ== X-Gm-Message-State: AJIora/cVvZrQLzjpD996EKXAsI5SJv+3Xk+nh8pQddRDsQDs5EkpF61 NQQzah8pi735aylBhRgM41USk+f72/uOIA== X-Google-Smtp-Source: AGRyM1vVdRc2tdN9X9qkQxsyH4E0bPCWpRg3v+eRXpDZNvwwNTD8CgxZ6Kq+QcHDkTKu+tOcdVy2PA== X-Received: by 2002:a5d:6285:0:b0:21e:6554:5e31 with SMTP id k5-20020a5d6285000000b0021e65545e31mr7813429wru.21.1658761252866; Mon, 25 Jul 2022 08:00:52 -0700 (PDT) Original-Received: from betli.gmail.com (catv-86-101-66-128.catv.fixed.vodafone.hu. [86.101.66.128]) by smtp.gmail.com with ESMTPSA id t7-20020a05600c198700b003a30af0ec83sm15915366wmq.25.2022.07.25.08.00.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jul 2022 08:00:52 -0700 (PDT) In-Reply-To: <87ilnlxtqz.fsf@gmail.com> (=?utf-8?Q?=22Jo=C3=A3o_T=C3=A1vor?= =?utf-8?Q?a=22's?= message of "Mon, 25 Jul 2022 13:27:16 +0100") Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEUMBwgHAgMFAAGPjY7/ //80MDHq6eqJt3pKAAABr0lEQVQ4jX2UzZKDIAzHqR177q7TPbtx2HMr6guQcrbY9txZ0fd/hA0f onXazcEJ/CD8E4Js8/HS9mwjXtqeMRxHXJkakTEm4b4GPVQW8PU8ov4fQCqeThlF60MBWdo1IXzd 2nEEZE7CEAZLwI0N/gJAhTj7ESQAX4gPgO8lyI+cvgViSVPlNomAj2M9gW40eg7VWY3cATjUcyiO Z+i03cFruGLYoUR7VyU3HihdmCEVhoDN65FXkpbSxkomOzsTQN/gySaodGb9Gdi1oSRXP46gdBWh LcUKJNdeGCWac74GKakmne0aHCFvyqJPYLsCFAVlhRTvGdzMdLHqtgRyUulyXIAH7CYQ3AB0Nody JQhAkq/qtOnbjhxdzYDkXPxlH5y4WdUAeUcX1NVJ6GR7UQEYPGWoAnA36OQNn5lRRp38vHTAp9Br LoTmvlPPDoRCKzpjG1SXT89AaT5l456BamJuMcs+NIOMzJ/s5dI6yUVcrARlruwOebfdv6gunTn4 ww3+QjGBEn5suVyLHoSGvAqREuDLN+iqZ+VcFg+HBbsJUU9+FZthbez9T+bdb+kPv2Ls6ct3hTkA AAAASUVORK5CYII= Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=felician.nemeth@gmail.com; helo=mail-wr1-x42c.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, T_SCC_BODY_TEXT_LINE=-0.01 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" Xref: news.gmane.io gmane.emacs.devel:292635 Archived-At: >> I don't think the current API is good enough for that. See >> https://github.com/joaotavora/eglot/discussions/802#discussioncomment-2171239 > > Really depends on what you consider "that" to be. To implement non-standard LSP features, which lots of servers propose. > [...] Also, once Eglot is in core, I won't be only person deciding. (I welcome Eglot's inclusion in the core and appreciate your work. I hope that's clear.) >> More importantly, there are multiple language server implementations for >> some languages (python, c) with different quirks or non-standard >> extensions to the LSP protocol. How do you imagine a major-mode would >> support these? > > They can adds methods to the generic function eglot-handle-request (and > a handful others), set values of Eglot in their major-mode > initialization code, bind keys to `eglot-*` interactive commands, make > compound commands from those commands, etc. OK. This is somewhat similar to the case when a major mode provides an xref or a flymake backend. But I think sometimes the reverse approach is more desirable. Let's take a not so hypothetical example and say c++-mode wants to provide a type-hierarchy browser. It's better to write a generic, language agnostic hierarchy browser (maybe CEDET even has one), and extend Eglot with a hierarchy browser backend similarly to its xref backend. The hierarchy browser then can have a tree-sitter backend as well. > While they _can_, but that doesn't mean they _must_ or even _should_. > In fact, LSP's whole idea, which is surprisingly forgotten so often, is > that server and editor need to know very little about each other to be > able to cooperate. By and large this idea works very very well. I agree, but non-standard extensions exist for a reason. Almost all servers have a VS-Code specific part that contains at least a list of configuration variables that other clients cannot handle automatically. BTW, if Eglot knew about these configuration variables, could `customize-group` somehow save the settings into a .dir-locals.el file? > Eglot works with tens of servers and hasn't got a line of server > specific code, except for eglot-server-programs invocations. There > are exceptions, and not everyone has the same luck, but I've been > using C++ clangd and C# omnisharp quite a lot lately and I have 0 > lines of server specific config. Even clangd has a moderately long list of extensions: https://clangd.llvm.org/extensions.html#type-hierarchy Sure, clangd is usable without them, but some of the extensions might make someone's life easier, for example, by providing a type hierarchy browser. > [...] So there isn't any problem/drama here. I don't want to start one either, but it's a good time to think once more about Eglot's relations with other packages.