From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.devel Subject: Re: cc-mode fontification feels random Date: Fri, 4 Jun 2021 13:05:40 -0700 Message-ID: References: <831r9iw473.fsf@gnu.org> <87h7ieyma7.fsf@gmail.com> <15be7dd8-e901-e317-5111-e1a34f6f0416@gmail.com> <83k0n9l9pv.fsf@gnu.org> <83eedhl83r.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23424"; mail-complaints-to="usenet@ciao.gmane.io" Cc: ubolonton@gmail.com, Daniel Colascione , Theodor Thornhill , =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jun 04 22:07:56 2021 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 1lpG6l-0005qp-H9 for ged-emacs-devel@m.gmane-mx.org; Fri, 04 Jun 2021 22:07:55 +0200 Original-Received: from localhost ([::1]:42554 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpG6k-0002ys-Bf for ged-emacs-devel@m.gmane-mx.org; Fri, 04 Jun 2021 16:07:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36832) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpG4t-0008Kw-MB for emacs-devel@gnu.org; Fri, 04 Jun 2021 16:06:00 -0400 Original-Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]:41619) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lpG4m-0001NK-PK; Fri, 04 Jun 2021 16:05:59 -0400 Original-Received: by mail-pj1-x102a.google.com with SMTP id b15-20020a17090a550fb029015dad75163dso6541372pji.0; Fri, 04 Jun 2021 13:05:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=47u+WiRJPVcwQUEkuRRIjU5jsDeuZirnIZaCr7MIc4A=; b=Tmcy2zPw+09wS3GTiUMbD2m5/bP3mr9RL1lZtiw5BGBAKN2xar5nVMg3wjBJmtvFyX CqGcAEVPPJZ32TgyaXHp7EMDCQe/SXO5I5OvLRLh2QHYRxmtD4Gaolss9SkCw//TBUox jsHi+P86IcpNh4HCwPyaPYvrwvTS8t5Tn++fki+Jg4KsrYZ42QoMOs6u2pDIj3z5rlyZ OPt6kC/tFyNOYPV1rrjsFZ0o+8lDuMfsGkthK5/XJ784P9CZDh5lJy010OiEh9Aaayrw SJyXiTog3xYkJ7T9r56Ivub2KRMehfaAD7DMKoE+Jc10rPP5YOvTEdbgYOfY/c6Ow/B9 LNdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=47u+WiRJPVcwQUEkuRRIjU5jsDeuZirnIZaCr7MIc4A=; b=Rl9EcJH4yKYbQtwlnGK3oKFwUnb9795JqeZkBu5z5wyF1zADPg9nzQeTgYslhPirsL Kdwg/BIONslAoIAcprf5qV2I833Jjr5oiSOgE2w3n0CTBbHSNo7tysu9l4ohIivPbn+V 70nUkXUSxy3BxUJM3eLGzc1r7CnaZrAF5KjKaS6t0gDOVZxAsrD7HoU7P80wEcev0xOk s1X9MFeAZH4+m1XWxEOOoGqqUMOPnqU4VEnihMPuLLyduXMeCbSvLbeWG/Vvd6uM6uUC JUeDn4WRSBR/dd//wKdaevn/PRdcZ0C+gtaws4SW8+YuVqeyW5W1/4xw1WbZNjE2+lJV cI6w== X-Gm-Message-State: AOAM531JALXoW0gR/a2eJq8Au2Io/NYupUOprw/v+gsJV3gVfe0K/8/E esrfgeBCvmjDdX67Qnh2Nql7n2bUCJA6w/fdKwRo1b8VsO2S9Q== X-Google-Smtp-Source: ABdhPJw9yzXN2/clWmUhzgp+bpgrphEvgITWM05J8iK2qi+yCOIVwAajEBf0q6xTYyFnQlI9gga6mPX2cb0Ei0qRPtA= X-Received: by 2002:a17:90a:2ec6:: with SMTP id h6mr18798867pjs.103.1622837150672; Fri, 04 Jun 2021 13:05:50 -0700 (PDT) In-Reply-To: <83eedhl83r.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=jporterbugs@gmail.com; helo=mail-pj1-x102a.google.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 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, URIBL_SBL_A=0.1 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:270409 Archived-At: On Fri, Jun 4, 2021 at 12:53 PM Eli Zaretskii wrote: > > > From: Jim Porter > > Date: Fri, 4 Jun 2021 12:41:56 -0700 > > Cc: joaotavora@gmail.com, theo@thornhill.no, dancol@dancol.org, > > ubolonton@gmail.com, emacs-devel@gnu.org > > > > Currently, the way Eglot works for remote files is that it > > runs the LSP server on the remote host via TRAMP. > > Why does it do that? Does the LSP server have to access the file > itself? We have all the contents of that file locally in a buffer, so > we could hand it to LSP locally. I'm not an expert on the internals of LSP servers, but it's my understanding that for a language server like clangd, it needs access not just to the current file, but the entire source tree[1]. That allows for things like completion of member function names of classes defined in another file, etc. For clangd in particular, it might be possible to run a local clangd that pulls from a remote index[2], but I don't know if every LSP server has such capabilities. Moreover, in my own usage of Eglot, I find it very convenient that it runs the LSP server remotely. I often find myself files remotely over TRAMP from a local machine with a minimal set of devtools. While I could install all the LSP servers I need on all the machines I connect from, it's less effort to rely on the fact that the machine that'll be doing the compilation has all the devtools I need. - Jim [1] As well as instructions about how to *build* the source, contained in `compile_commands.json'. [2] https://clangd.llvm.org/remote-index.html