4 ms·
> semantic location of variable declaration This can only work if the editor internalizes the corresponding language. That does not scale for all languages ava
by G3rn0ti 3y ago
> semantic location of variable declaration
This can only work if the editor internalizes the corresponding language. That does not scale for all languages available.
That’s exactly what the language server protocol is all about (and certainly what parsers like tree sitter are there for). Emacs can connect to those and acquire semantic analysis capabilities. The degree to which such a semantic language features will work for you will also depend strongly on the language, of course.
If you use a commercial editor it’ll jump start you for the popular languages. But, say, you wanted to program in Raku or Scheme you’ll also going to need to fiddle around.
- not_kurt_godel 3y agoUnfortunately for the estimated 0.18%-language-share's worth of Raku devs it does not appear that finding references is supported: https://langserver.org/#implementations-server https://langserver.org/#implementations-server. So not even a great solution for the ~5% of languages that don't have dedicated commercial editors that actually just work instead of requiring devs to do extensive proprietary meta-programming to achieve a half-functioning IDE facsimile
- G3rn0ti 3y ago> for the ... Raku devs it does not appear that finding references So the Raku server has a deficiency, currently. Too bad. But in Emacs you can work around that by writing into your config file: (remove-hook 'xref-backend-functions #'lsp--xref-backend t) if you use "lsp-mode.el" or equivalently (remove-hook 'xref-backend-functions 'eglot-xref-backend t) if you happen to use "eglot.el". (There are two major language server clients available for Emacs.) This will not turn off "finding references" completely because Emacs happens to have a default backend called "etags-xref-backend" based on a reverse index file. You can easily generate that in your project directory using a shell tool shipped with Emacs or even execute that automatically from inside a git commit hook. So Emacs can stand in until Raku's language server is fixed. So ... while you would be in trouble with a commercial editor now, you can continue hacking happily thanks to Emacs' flexibility.
- not_kurt_godel 3y agoIt's not happy hacking to have to think about the internal configuration of how broken my IDE's language support is. Emacs is cool for what it is but it's objectively deficient for modern professional development
- zelphirkalt 3y agoYou seem to have a peculiar definition of "professional development", that does some lifting there and that you are not sharing with us. There are many people here, who do use Emacs when developing in their profession.