From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel Subject: Re: LSP vs Emacs indentation [ Date: Fri, 28 Jul 2023 07:28:24 +0200 Message-ID: <87fs58txgq.fsf@gnu.org> References: <87bkg4bkfu.fsf@fastmail.fm> <83a5voa328.fsf@gnu.org> <87h6pw9tpa.fsf@gmail.com> <875y6bm5ut.fsf@fastmail.fm> <87r0oz6i9p.fsf_-_@gmail.com> <87wmypb5dq.fsf@gnu.org> <871qgxxjnz.fsf@thornhill.no> <864jlpnhts.fsf@stephe-leake.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23098"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.11.12; emacs 30.0.50 Cc: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= , Theodor Thornhill , Eli Zaretskii , Stefan Monnier , emacs-devel@gnu.org To: Stephen Leake Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jul 28 08:19:26 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 1qPGov-0005mc-SM for ged-emacs-devel@m.gmane-mx.org; Fri, 28 Jul 2023 08:19:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qPG3M-000222-Rc; Fri, 28 Jul 2023 01:30:16 -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 1qPG3J-0001wA-CY for emacs-devel@gnu.org; Fri, 28 Jul 2023 01:30:13 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qPG3H-0003DL-Tg; Fri, 28 Jul 2023 01:30:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-reply-to:Date:Subject:To:From: References; bh=5IR/1m2dxfOkpB9uVvFOSniUCTDMyJchXwkv72LTYws=; b=lk9SFBgTH+M3RD PMfDL2AicLaw341wuNB5dRfmJ6yfZOS9krlI5aebiQ8MmNx5ya8EkE0X8dHgweIQ86c1rWGXWm5er y/CH+CQkBb7FWMVR8iCLjE3bKXvvZ1Bb+00aSYMFx0NzIHpUyOxJGWke0WZuIC0v1c10KzlBJkYpD aPO8UEkdPoyg69TEqYBViScltaxYUr7vZUcfoetXUxizwetgjRDpEThosbulCMPO/9c11LGLFkg93 yKVbLXy9kLKt6OLRPfDAQE/JAiX1ez1rx63wsYzZsjunt7nrIviGQxEUN5ZgZd5j51CaOuu52cpwP LMfgZfVT6lVSBdPeL9Qg==; Original-Received: from auth2-smtp.messagingengine.com ([66.111.4.228]) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qPG39-0006d6-3X; Fri, 28 Jul 2023 01:30:11 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailauth.nyi.internal (Postfix) with ESMTP id 3799E27C0054; Fri, 28 Jul 2023 01:30:00 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 28 Jul 2023 01:30:00 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrieehgdelgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpehffgfhvfevufffjgfkgggtsehttdertddtredtnecuhfhrohhmpefvrghsshhi lhhoucfjohhrnhcuoehtshguhhesghhnuhdrohhrgheqnecuggftrfgrthhtvghrnhepud ejtdehuddvleffjeekteegvdehleehvdeufefhueekkeekhedvgfeggeffvefgnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhrnhdomh gvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqkeeijeefkeejkeegqdeifeehvdel kedqthhsughhpeepghhnuhdrohhrghesfhgrshhtmhgrihhlrdhfmh X-ME-Proxy: Feedback-ID: ib2b94485:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 28 Jul 2023 01:29:58 -0400 (EDT) In-reply-to: <864jlpnhts.fsf@stephe-leake.org> 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:308183 Archived-At: Stephen Leake writes: >> Where the 'eglot-newline-and-indent-according-to-mode' has to calculate >> the expected indentation. I don't understand how we'd expect the >> formatters to do that indentation for us. They only care about code >> already written, not code yet to be written. So if we'd have to >> calculate that offset anyway, do we win much? > > Your "newline-and-indent" function could insert some bogus code > (probably "bar;" or "bar();") and ask LSP to format that, then delete > the bogus code. I think the problem here is that this function would need to know at least some syntactically valid code to insert which depends on the language. Bye, Tassilo