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: [semi off topic] grep-based refactoring [was: Adding refactoring capabilities to Emacs] Date: Fri, 8 Sep 2023 18:53:32 +0100 Message-ID: References: <83fs4f36wi.fsf@gnu.org> 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="2036"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: tomas@tuxteam.de Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Sep 08 19:54: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 1qefgX-0000Li-Cv for ged-emacs-devel@m.gmane-mx.org; Fri, 08 Sep 2023 19:54:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qeffz-0006FQ-GH; Fri, 08 Sep 2023 13:53:51 -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 1qeffv-0006FD-UT for emacs-devel@gnu.org; Fri, 08 Sep 2023 13:53:47 -0400 Original-Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qefft-00061C-Kx for emacs-devel@gnu.org; Fri, 08 Sep 2023 13:53:47 -0400 Original-Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-5029e4bfa22so1333807e87.3 for ; Fri, 08 Sep 2023 10:53:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694195624; x=1694800424; darn=gnu.org; 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=UUkkN0mQTEeT6ZssRtYCczd1zD4zig3Rq0QOQN0ekpg=; b=Cfqz8Ep9DJBvACieB+Z+jbI2tAzvOX0r5g+kcTedwxumkP7vvWYl0kGzfK262QpvKE O7P5K2Ewm+7uqPRLR2asKe7HniSvSDsJtcm4s/jP6ROI6QdK3dQq/Y9mtIoRqLr1lS4q glwC66F+k90p3zq3cHdqbrXGMWKp1Pu5LiXtHhCR9MBiPD2AgALSTCb0DqD09AskhPLA lHK4gi3cMfAiVQYlQLitdUcF83hUpsH5vJBgto1Y6oUYYxtuaGHHeRLLXV5CCkbZDEF+ nxpKoQl/tlu2eMes9LULsfC/bKpF1zIQEGzNi6EY8S7k1Kt8ZnFSsbf25xskzsmydEoI 11Cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694195624; x=1694800424; 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=UUkkN0mQTEeT6ZssRtYCczd1zD4zig3Rq0QOQN0ekpg=; b=I5jbn9uJKqst85DCEaYHw/hYkFvQCj6n4jgZZHPC/VHLRA6Y4ANuuMGXqZkrhkNoY4 ktiT7V+fZlDaOZhZcHduNhJ1Hvzw9suFL9kJcSQTVg9rJRAL3YtueOGEIkSXqMP31U0Q bksrbNzROJZ7RtgmY7gqUwcsaKlK9kqyD73XXs343kSo3O1udcQtZMUfBz0p5Nzv2mWu 61tL6HYaL5gEIal4nriI1igf2/Al1xjVxM710Pw0NKefl9Adw/ucmv9JniSJBejCvr7z 4ZpZre43Szxw0T2a1iQVVgkHcdtPdWLB/an0S/zFkwPB8dGUnYA3CUFH6RccJKbyNetu +pTw== X-Gm-Message-State: AOJu0Yx9zV0mkMaZMd4Affh11M2KNazpakUeQmdTxqBxWFzcXQtnqmrX 5/zSd3cRh/Ebic0X5GwinjY+2xiydXgqNjN52Kp1YQXHoV7Klg== X-Google-Smtp-Source: AGHT+IHezMv3+5HOj5t0liLwdfzXnU/p1uDD/0hN0fUX31Dr3uje3l1q9lNCeTI2qp6EwzEFPiZJLHAQyrDnqdyI/rM= X-Received: by 2002:a19:8c45:0:b0:500:b7e7:1556 with SMTP id i5-20020a198c45000000b00500b7e71556mr2183088lfj.36.1694195623739; Fri, 08 Sep 2023 10:53:43 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::135; envelope-from=joaotavora@gmail.com; helo=mail-lf1-x135.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:310346 Archived-At: On Fri, Sep 8, 2023 at 2:31=E2=80=AFPM wrote: > > On Fri, Sep 08, 2023 at 01:52:53PM +0100, Jo=C3=A3o T=C3=A1vora wrote: > > [...] > > > Great. Precise project-wide analysis (as opposed to more-or-less dumb > > grep-based) is exactly the main thing we should be targeting IMO. > > Is "rename" the only thing it does or can you, say, extract subexpress= ions > > to variables, organize imports, etc? > > As someone who has done quite a bit of "grep based refactoring", one > observation: of course, this can only me made semi-manually. But then, > the process has found things for me a syntax based refactoring tool > wouldn't ever have, Not sure about that. Clangd mentions this limitation specifically in their web page, so they acknowledge it and possibly are looking to fix it. It's not too wild to think that an LSP server might to suggest additional edits beyond what it has from syntactic analysis, who knows maybe even using language models or by using a parser that understands doxygen or common types of documentation systems using comments. So the only thing we know for sure is that grep-based isn't enough. Jo=C3=A3o