unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Pankaj Jangid <pankaj@codeisgreat.org>
To: "M. Ian Graham" <hello+emacs@miangraham.com>
Cc: 59214@debbugs.gnu.org, "Eli Zaretskii" <eliz@gnu.org>,
	"João Távora" <joaotavora@gmail.com>
Subject: bug#59214: [PATCH] Alternate rust-analyzer command added
Date: Thu, 17 Nov 2022 18:21:59 +0530	[thread overview]
Message-ID: <878rk9921c.fsf@codeisgreat.org> (raw)
In-Reply-To: <UgK-m6VLoOabGxT6Uda_36Jhyiuz70LjK8I1oJ76ol3Q9_Zu3HoauPU75dd0FrOTehpBGZ4lQDXJKKiCmfUmoRZ4I8uVi7iSQbkK1DxjtZM=@miangraham.com> (M. Ian Graham's message of "Thu, 17 Nov 2022 10:52:54 +0000")

"M. Ian Graham" <hello+emacs@miangraham.com> writes:

> Pankaj Jangid <pankaj@codeisgreat.org> wrote:
>
>> -(defvar eglot-server-programs `((rust-mode . ,(eglot-alternatives '("rust-analyzer" "rls")))
>> +(defvar eglot-server-programs `((rust-mode . ,(eglot-alternatives
>> '(("rustup" "run" "stable" "rust-analyzer") "rls")))

Given your valid arguments, the 1st patch would be recommended. Not the
above. Earlier patch was,

-(defvar eglot-server-programs `((rust-mode . ,(eglot-alternatives '("rust-analyzer" "rls")))
+(defvar eglot-server-programs `((rust-mode . ,(eglot-alternatives '("rust-analyzer" "("rustup" "run" "stable" "rust-analyzer") "rls")))

> Another open question and source of future bug reports: How does a
> rustup user make eglot work with the nightly release channel when
> stable is specified here?

> Nightly is required by some libraries, and a minority of people use it
> in development for improved error messages and other benefits.
>
> Are we asking those people to redefine eglot-server-programs?


Wow. This is good observation. Here is how rustup users do it. And maybe
I need to update the patch accordingly.

There are two ways to select the toolchain. One is the `rustup default
nightly' command. This sets the nightly toolchain globally. Another
approach is to create a file `rust-toolchain' in the project root
directory and just write the name of toolchain for the project; just
write `nightly' or `stable' on the first line and save. This is like
setting node version in `.nvm' file. Just for the project.

Also `rustup which rust-analyzer' command tells us the full path of the
`rust-analyzer' executable based on active toolchain. Inside Emacs, the
project specific setting (via rust-toolchain file) would be tricky to
pick up. But this will work for globally configured default toolchain.

Should we probe using `shell-command-to-string' and then insert the
value in `eglot-server-programs'? My suggestion would be that, we
include the stable `rust-analyzer' in Emacs and user can always override
if he/she wants to experiment.





  reply	other threads:[~2022-11-17 12:51 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-12 11:53 bug#59214: [PATCH] Alternate rust-analyzer command added Pankaj Jangid
2022-11-12 12:03 ` Eli Zaretskii
2022-11-12 12:22   ` Pankaj Jangid
2022-11-12 12:51     ` Eli Zaretskii
2022-11-12 13:09       ` Pankaj Jangid
2022-11-16 17:05 ` Eli Zaretskii
2022-11-16 17:14   ` João Távora
2022-11-16 19:31     ` Eli Zaretskii
2022-11-16 21:06       ` João Távora
2022-11-17  0:12         ` Stefan Kangas
2022-11-17  5:59           ` Pankaj Jangid
2022-11-17  5:57         ` Pankaj Jangid
2022-11-17  8:13           ` João Távora
2022-11-17 10:18             ` Pankaj Jangid
2022-11-17 10:52           ` M. Ian Graham
2022-11-17 12:51             ` Pankaj Jangid [this message]
2022-11-17 18:11               ` M. Ian Graham
2022-11-17 18:20                 ` Pankaj Jangid
2022-11-17 18:47                 ` Eli Zaretskii
2022-11-17 19:43                   ` M. Ian Graham
2022-11-17 21:49                   ` João Távora
2022-11-18  5:13                     ` Pankaj Jangid
2022-11-18  8:29                       ` Eli Zaretskii
2022-11-18  8:44                         ` João Távora
2022-11-17  8:11         ` M. Ian Graham
2022-11-17  8:19           ` João Távora
2022-11-17  9:01             ` M. Ian Graham
2022-11-17  9:07               ` João Távora
2022-11-17 10:32             ` Pankaj Jangid

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878rk9921c.fsf@codeisgreat.org \
    --to=pankaj@codeisgreat.org \
    --cc=59214@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=hello+emacs@miangraham.com \
    --cc=joaotavora@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).