SafeSemifinalist · 2022-11-08 09:01
Dear emacs community,
Sorry for the noobie question but, is there an official documentation of eglot?
I am using it for my python programming projects but there are a few things that I don't know how to configure them. This is a small list:
* Setting the python console directory and the PYTHONPATH variable for each project
* Finding inside the project where a class is defined
* After executing a script with C-c C-c go to the point where it raises an exception
Thank you for your help.
hagerty9009 · 2022-11-08 11:55
There’s [this page](https://joaotavora.github.io/eglot/) that serves as a manual for eglot. It won’t have a ton of language-specific stuff, though. I personally don’t ever write Python, so I can’t really help with the first question. Second question - that sounds like `xref-find-definition` (may not be the actual function, but you want one of the xref functions). For the last, that sounds like breaking on exception, which is a debugger thing, not a language server thing. Language servers are really just meant to provide smarter completion and navigation around a codebase without needing to constantly rebuild a tags file (or teach etags/ctags how to build a tag file for your language).
7890yuiop · 2022-11-09 03:42
Also note that starting from Emacs 29 (since fairly-recent builds of the master branch), eglot is part of Emacs and the eglot info manual is included. Emacs 29 users can therefore read the eglot manual inside Emacs by default.
SafeSemifinalist · 2022-11-09 11:51
Thank you very much, both of you!
I must tell that the comment of hagerty9009 about what are language servers is really clarifying.
doolio_ · 2022-11-10 22:06
What python language server are you using? If it is `pylsp` I put together a complete `.dir-locals.el` file [here](https://github.com/joaotavora/eglot/discussions/1096) for use with `pylsp` and `eglot`.
SafeSemifinalist · 2022-11-17 09:26
Sorry, I missed this part.
I haven't edited this file. I only have:
`(require 'scimax-jupyter)`
`(use-package python-mode`
`:ensure nil`
`:custom`
`(python-shell-interpreter "python3")`
`)`
`(use-package eglot :ensure t)`
`(add-to-list 'eglot-server-programs '((c++-mode c-mode) "clangd-10"))`
`(add-hook 'c-mode-hook 'eglot-ensure)`
`(add-hook 'c++-mode-hook 'eglot-ensure)`
`(add-hook 'python-mode-hook 'eglot-ensure)`
`(add-hook 'racket-mode-hook 'eglot-ensure)`
doolio_ · 2022-11-17 10:50
The file I linked to is only relevant if you are using the `pylsp` python language server via `eglot`. Also, if you are using the built-in python-mode then the FEATURE-name in the `use-package` form should be simply `python` not `python-mode` that is the built-in `python-mode` is provided by the built-in `python` package. There is another third party package called `python-mode` which is confusing.