Subject: bug#74461: [PATCH] Add go-work-ts-mode

From: Stefan Monnier <[email-masked]>
Date: Sun, 22 Dec 2024 10:33:27 -0500

>>Do we have a way to tell Eglot which LSP server(s) to use via some
>>buffer-local var, instead of having to change this centralized
>>"database"?
>
> Looking at the following commits:
>
> - 5f56bc1
> <https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=5f56bc1cdfcd474dd9cfad07240df6c252abd35c>
> - e37754f
> <https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=e37754fc59bac409881d456a83aa0bf2468c94fb>
>
> That doesn't seem to be the case.

It was a kind of rethorical question: whether we do or not, we *should*
have such a mechanism and we should use it here.

> Go uses tabs for indentation,
> and spaces for alignment.
[...]
> The language specification doesn't mention
> that, but I think it should.
> Maybe I should send them an e-mail about that.

I don't think the language cares (or should care).  It's only a convention.
But if it's the only convention in use in Go, that's fine: just add
a link to https://go.dev/doc/effective_go#formatting that justifies
the setting.

>>Since we don't have another (non-treesitter) mode for these files, I'd
>>recommend you go straight for:
>>
>>    ;;;###autoload
>>    (add-to-list 'auto-mode-alist '("/go\\.work\\'" . go-work-ts-mode))
>
>
> Sorry if I misunderstand,
> but that doesn't seem to be the case
> for other tree-sitter modes.

Past practice does not always reflect best practices, especially when
talking about relatively new practices.

        Stefan