Fix glsl-ts-mode.
Derive glsl-ts-mode from prog-mode instead of c-ts-mode.
Remove the use of deprecated `c-ts-mode--get-indent-style'
Any particular reason you think we should stop deriving from c-ts-mode? I very much expect useful things to be available from the upstream C version (such as easily swappable indentation styles), even if it right now is, evidently, a bit unstable
How to prevent eglot from managing glsl buffers then? Any glsl-ts-buffer gets assigned to clangd even if i have glsl_analyzer explicitly set for glsl-ts-mode because its derived from c-ts-mode.
I'm afraid I don't actually use either glsl_analyzer or eglot unfortunately. How have you you configured it? Looking at the docs, it seems like you should be able to enable it using:
(with-eval-after-load 'eglot
(add-to-list 'eglot-server-programs
'(glsl-ts-mode . ("glsl_analyzer"))))
Similar code could be written using use-package. Are you saying that such a configuration is picking up clangd as a server program instead? To me, that sounds like a bug in the handling of derived modes in eglot rather than anything else, but I don't know enough here
Nah. If I open a C/C++ first then eglot starts to manage whole c-ts-mode family with clangd. No luck trying to fix it so far.
Also, c-ts-mode--get-indent-style really needs to be handled. Emacs 31.x simply won't enter glsl-ts-mode anymore since that function is absent.
I'm going to tackle glsl-ts-mode a bit to see what can be improved. Will make a PR if something nice comes out of it.
No need, I've fixed that already (https://github.com/Xaldew/glsl-mode), I just haven't had time to verify it properly due to work
Which, should now be fixed with commit 8d4ff33. I looked a bit more at eglot, and it seems the default (for some version of Emacs), includes:
((c-mode c-ts-mode c++-mode c++-ts-mode objc-mode)
. ,(eglot-alternatives
'("clangd" "ccls")))
Which probably explains why clangd starts. I think simply adding:
(use-package glsl-mode
:ensure t
:config
(with-eval-after-load 'eglot
(add-to-list 'eglot-server-programs
'(glsl-ts-mode . ("glsl_analyzer")))))
Might fix it for you, but as I said, I'm not using either of these components at the moment
This works only if there is no active clangd managing c-ts-* family.
Example: run Emacs, open a GLSL file. Enter glsl-ts-mode, glsl_analyzer starts to manage glsl-ts-mode buffers. Then you open a C/C++ file which makes eglot manage any c-ts-* buffer. From that point entering glsl-ts-mode in other buffers would use clangd.
@Xaldew Could you take a look at #18 ? As promised, some improvements. Been running those for a couple of days, seems great so far.