LSP, or Language Server Protocol, makes programming easier by introducing features like more precise auto-completion and definition lookup. It may have scratched your itches, and you may wonder what the experience is like in Emacs.
Emacs has mainly two LSP clients out there, eglot and lsp-mode. Eglot is lightweight, and it could almost run out of the box. So in this post I will briefly show you how to use eglot.
As a user, we only need to know these commands to get started:
M-x eglot connects to an LSP server for the current project
M-x flymake-goto-next-error goes to previous error in the current buffer
M-x flymake-goto-prev-error goes to next error in the current buffer
M-. or M-x xref-find-definitions finds the definition of the symbol at point and opens it in the current window
M-, or M-x xref-pop-marker-stack jumps back
M-? or M-x xref-find-references finds the references of the symbol at point
Occasionally, we may need:
M-x company-complete to trigger completions manually
M-x eldoc-doc-buffer to show docs for the symbol at point in a dedicated buffer
Hey, thanks for reading this far!
Do you know any opening backend programming positions for foreigners in Canada? I am wondering if it's possible to get a job from China. If you do know one and think that maybe I could be a fit (I can do C/C++/Python/Shell etc.), would you mind dropping me a message at whatacold@gmail.com? thanks so much!
I've also made a video to demonstrate the workflow as below:
And, emacs-showcase.el is following for the video: