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

From: Jim Porter <[email-masked]>
Date: Fri, 11 Oct 2024 14:49:33 -0700

On 10/10/2024 2:59 PM, Dmitry Gutov wrote:
> 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.

Yeah, that raises a good point: what exactly counts as a "project" 
depends on the context. For simple scenarios, a project is approximately 
equal to a VC repository, but for more complex scenarios, I think it 
depends on what you want to *do* with the project. For example, suppose 
I have a Git monorepo that has several different Python packages in it. 
Should Emacs consider the monorepo to be the lone project, or should 
each Python package be a project? I don't know if either answer is 
correct 100% of the time.

(Even if we're just thinking about VC, "what project is this file in?" 
can have multiple answers. Sometimes if I'm working in a Git submodule, 
I want that submodule to be the project, not the parent repo.)

I'm not sure if we should open this can of worms yet though...

> I'm not a fan of adding a file that has no other purposes, but if people find this useful, no problem. For personal projects it certainly shouldn't hurt.
> 
> Eric, Jim, how would you like this resolution? 

I'm fine with recognizing ".project" by default, since it seems we'd 
just be adopting an already-existing practice. In addition to the cases 
already discussed, it seems that the Eclipse and STM32 IDEs also use a 
".project" file at the project root for various things.

To turn it around though, are there cases we know of where we *wouldn't* 
want ".project" to mark a project root? Maybe if an Eclipse IDE project 
were in a Git subdir? (In that case, maybe ".project" should only be 
checked for as a fallback if we couldn't determine the project using a 
"real" VC file.)