Subject: Re: bug#73736: 31.0.50; project and therefore eglot don't work without git

From: Dmitry Gutov <[email-masked]>
Date: Fri, 11 Oct 2024 00:59:54 +0300

On 10/10/2024 21:52, Jim Porter wrote:
> On 10/10/2024 11:42 AM, Dmitry Gutov wrote:
>> This isn't very plug-and-play, but you can customize project-vc-extra- 
>> root-markers to include any other files that distinguish the root of a 
>> project. For example, Cargo.toml.
> 
> I wonder, could major modes provide project.el with some default values 
> for that option? Then rust-mode could add Cargo.toml, python-mode could 
> add pyproject.toml, and so on.

That's a natural question, but it would result in different results for 
"current project" for files in the same directory (which often enough 
use different major modes).

What we could have, it a variable which is added to globally in package 
autoloads - so if e.g. rust-mode is installed it could add Cargo to root 
markers. For rust-ts-mode we'd need to do that in the core, but then 
we'd also need a way to override I guess, because in some projects that 
still wouldn't be "root"...

Speaking of JetBrains and VS Code's "Open project" method, we could have 
such as well - it would be a separate command or two ("open" and 
"close", maybe).

If it's just for Eglot, though, maybe ideally it would have a separate 
detector for directories in which to run the language server in - it 
doesn't have to correspond to what the user considers to be the entire 
project's root (they might prefer it to be a parent directory). Not sure 
how automatic it can be in the general case, though, and it'd require 
Eglot to know about root markers for all supported languages.