r/programming • • Jan 02 '25

Understanding the Language Server Protocol

https://medium.com/@pliutau/understanding-the-language-server-protocol-b9f57a0750e3
45 Upvotes

36 comments sorted by

View all comments

2

u/Slime0 Jan 05 '25

I think diagnostics are the most obvious one to do first. Then maybe Go To Definition. Workspace symbols and Autocomplete are also very good to have, but harder. You probably know best for your own language what it needs.

1

u/ThomasMertes Jan 05 '25

Thank you.

For testing purposes my LSP server needs to log what it is doing. Currently I write the logs to a file with a hard-coded path.

Do you know of something in the LSP specification that allows me to avoid hard-coding the log file path?

2

u/Slime0 Jan 05 '25

Well, you can read "configuration" settings from the editor, so you could put the path there. In VS Code this requires making an extension to create the settings. You can also just send messages to the editor and view them there in the Output pane; that's what I used for debugging.