Post AVOFVJbImOiTjHtmka by hochata@emacs.ch
 (DIR) More posts by hochata@emacs.ch
 (DIR) Post #AVMijheUf7iMjTgVsG by angelixd@mastodon.social
       2023-05-05T23:14:53Z
       
       0 likes, 0 repeats
       
       I noticed someone using VSCode (I think) highlight a variable name and open multiple cursors. He renamed it, but there are multiple options. I am sure this is possible in #emacs with a combination of embark and multiple-cursors, and maybe some help from expand-region?
       
 (DIR) Post #AVMijiVJUjxvNIOhCi by acowley@mastodon.social
       2023-05-06T01:03:51Z
       
       0 likes, 0 repeats
       
       @angelixd I really prefer using lsp for renaming rather than multiple cursors as the lsp server can exercise better judgement about identifier scoping.
       
 (DIR) Post #AVMijjQ25rKsDCvzc0 by angelixd@mastodon.social
       2023-05-06T01:32:39Z
       
       0 likes, 0 repeats
       
       @acowley I would prefer that too! Do you know if anyone has something like that working, or am I going to have to start hacking eglot?
       
 (DIR) Post #AVMijjR61uBcGVQqGm by angelixd@mastodon.social
       2023-05-05T23:17:10Z
       
       0 likes, 0 repeats
       
       However, I recently switched from ruby-electric-mode to ruby-ts-mode and the expand-region functionality has noticeably deteriorated, which if expand-region is relying on the mode's AST of the buffer, then ruby-ts-mode needs more robust representation. Which makes sense, it is a very new mode.
       
 (DIR) Post #AVMijk31ksWmA9B8OO by hochata@emacs.ch
       2023-05-06T03:22:48Z
       
       0 likes, 0 repeats
       
       @angelixd @acowley Eglot comes with an `eglot-rename` function. It is very nice because it changes all the semantic occurences of the symbol in the whole project, even if the files aren't currently loaded into Emacs.
       
 (DIR) Post #AVMijlW8I9P4ihntOi by angelixd@mastodon.social
       2023-05-05T23:18:05Z
       
       0 likes, 0 repeats
       
       So yeah, time for figure out which yak (gnu?) I want to shave.
       
 (DIR) Post #AVMk4odxxm7CS44Ly4 by acowley@mastodon.social
       2023-05-06T03:37:25Z
       
       0 likes, 0 repeats
       
       @hochata @angelixd lsp-mode has this, too, but it does have to be supported by the lsp server and not all lsp servers do offer the feature.
       
 (DIR) Post #AVOEt6Vj01dY7y4Neq by hochata@emacs.ch
       2023-05-06T20:57:47Z
       
       0 likes, 0 repeats
       
       @acowley @angelixd True, but the only server that I've tried that doesn't implement it is the Elixir one. Do you kno of any other ones without support?
       
 (DIR) Post #AVOFVIzj26etqkJmBE by angelixd@mastodon.social
       2023-05-06T04:13:38Z
       
       0 likes, 0 repeats
       
       @acowley @hochata Ah yeah, that is a good reason to do something tree-sitter-based; that way you only have to rely on the major mode and not on the app itself being configured. I use solargraph (ruby) and support for that is still experimental
       
 (DIR) Post #AVOFVJbImOiTjHtmka by hochata@emacs.ch
       2023-05-06T21:04:39Z
       
       0 likes, 0 repeats
       
       @angelixd @acowley I'm not sure you need tree sitter for that, although it might give more accurate results. For replacing occurrences of the same word in text files (with no LSP) I use Meow Beacon mode. It works okay.But thinking about it a little it more, a tree sitter based solution might be more fun...
       
 (DIR) Post #AVOXGNRQ15H0TKIp2e by acowley@mastodon.social
       2023-05-07T00:23:40Z
       
       0 likes, 0 repeats
       
       @hochata @angelixd I think haskell-language-server didn’t support renaming for a while, but it does now. You still run into limitations like it won’t rename exported names, but, still, I really like leaving renaming to lsp servers as a scope-unaware renaming can lead to some tricky bugs. I use multiple-cursors for renaming in some cases (e.g. lsp not setup), but only when I can see the full scope of the identifier on my screen when I’m doing it.