Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[lsp4e-dev] Testing/Debugging Language Servers

Hello All,
I have been trying to understand Language Servers, its protocol for Java, how they are implemented and just wanted to know how all the other devs are debugging language servers like jdt-ls or lemMinx(basically how you make changes and test them out).
I figured out a way but I don't know whether that is the right way or not it's similar to this - https://github.com/eclipse/wildwebdeveloper/blob/master/org.eclipse.wildwebdeveloper.xml/src/org/eclipse/wildwebdeveloper/xml/internal/XMLLanguageServer.java#L75

What I'm doing right now is -
1) Create a plugin project for testing the server
2) Defining lsp4j, contentTypes, generic editors as extensions in plugin.xml
3) Make a class say XMLConnectionStreamProvider and extend it with ProcessStreamConnectionProvider in lsp4e
and declare the path to uber jar or a snapshot jar in the commands.
4) Finally I run the plugin as an Eclipse Application
and open a file of the type mentioned in the plugin
and test the code actions provided by the server.(I bind the
language server for the file by going to Preferences to the server I want to debug)

Is this the right approach, or is it possible to debug the code actions from the server in an easier way?
Would appreciate any help, so that I can move on to contributing.

Thanks,
Yash

Back to the top