swipl-devel
swipl-devel copied to clipboard
Language Server Protocol for Prolog
It would be great to implement an LSP server (language server protocol) for Prolog, so that we would have code completion, compilation errors, etc support in many editors, something like this:

but for prolog.
I think someone already did a lot of the work writing a Vscode server for SWI-Prolog (which is essentially an LSP server).
It would probably be a good idea to use that code to setup a standalone LSP server that would work with any editor. Almost all languages have support today, I would not like for Prolog to be left behind.
Update: I think most of the backend code needed for this is already in SWISH, it would just need to be tailored to LSP.
Seems there is an implementation already: https://github.com/jamesnvc/lsp_server/ But it would be awesome to have it in SWIPL out of the box.
Yes, I tried it, but it doesn't work with neovim's LanguageClient.
@erlanger what exactly doesn't work? Maybe it makes sense to open bug in one project or another?
For example I requested the support for it in Ale: https://github.com/dense-analysis/ale/issues/2657