Did you know ... | Search Documentation: |
Packs (add-ons) for SWI-Prolog |
Title: | Implementation of Language Server Protocol for Prolog |
---|---|
Rating: | Not rated. Create the first rating! |
Latest version: | 0.0.10 |
SHA1 sum: | c880a92057394f03b8a429e46872da4efd46d90c |
Author: | Phil Hargett <phil@haphazardhouse.net> |
Maintainer: | Phil Hargett <phil@haphazardhouse.net> |
Packager: | Phil Hargett <phil@haphazardhouse.net> |
Home page: | https://github.com/hargettp/prolog_lsp |
Download URL: | https://github.com/hargettp/prolog_lsp/releases/*.zip |
Requires: | log4p |
Provides: | prolog_lsp |
No reviews. Create the first review!.
Version | SHA1 | #Downloads | URL |
---|---|---|---|
0.0.1 | fbd96604abab185f7cc1f363c76ef9acffb2c86b | 1 | https://github.com/hargettp/prolog_lsp.git |
0.0.2 | ba8332ab694455eea14bce6d533ec6ddeb2e0175 | 1 | https://github.com/hargettp/prolog_lsp.git |
c0484a9ef9d03de9ef65d1769bd424ba68333d03 | 1 | https://github.com/hargettp/prolog_lsp.git | |
0.0.6 | 090f941458e68f0f8592a7275591e7a80c620403 | 1 | https://github.com/hargettp/prolog_lsp.git |
10010ce616fba7b47faad3507d22d89b054bde74 | 1 | https://github.com/hargettp/prolog_lsp.git | |
5e5415804faee674758530695f34fb878f8c6b85 | 14 | https://github.com/hargettp/prolog_lsp.git | |
89ffbfe3e368686715cd86e137e43dfdd0d14a41 | 2 | https://github.com/hargettp/prolog_lsp.git | |
92c981a8c5f2375c6065b397bc216bdba101d388 | 6 | https://github.com/hargettp/prolog_lsp.git | |
937e58e65b83457b6d324862a26eada60205a3e5 | 2 | https://github.com/hargettp/prolog_lsp.git | |
df5eb8aae1dcc4573c474b4db5d0e57e5ccc95c7 | 6 | https://github.com/hargettp/prolog_lsp.git | |
0.0.10 | c880a92057394f03b8a429e46872da4efd46d90c | 254 | https://github.com/hargettp/prolog_lsp.git |
An implementation of the Language Server Protocol written in Prolog to support a language server for Prolog applications.
This is written for SWI-Prolog, and employs predicates specific to that implementation.
There are 2 implementations within this package:
stdio
- it reads request from stdin
and writes responses out to stdout
, with logging and diagnostics on stderr
. Eventually, this would be the backend for IDE or editors plugins (e.g., in VS Code).tcp
- it creates a server on the specified port and listens for new connections, handling requests and responses on each connection in separate threads.
To load using the SWI-Prolog manager and download the latest tagged version, in a SWI-Prolog console type:
pack_install(prolog_lsp)
To load from a locally cloned copy of this repository:
pack_install('.')
Once installed, running the following lines will start a stdio
language server in the same process as the SWI-Prolog console. Note that this call will not return until the server exits, a signal is fired, or Ctrl-C is hit.
use_module(library(prolog_lsp)). run_stdio_language_server.
Similar to the stdio
server, these lines will run the TCP server locally on the specified port. Note that this call will return once the server starts in a separate threads, so it becomes possible to interact with the server in the same process. The port in this example is 3101, but the choice is arbitrary and can be available port number.
use_module(library(prolog_lsp)). start_tcp_language_server(3101)
For development, the easiest path may be to clone the git repository, then run either the explicit local package installation above, or use the test.pl
to both load the package and run its unit tests.
[test]
This project is very immature and not at all recommended for daily production use. Happy to discuss contributions!
Pack contains 52 files holding a total of 86.3K bytes.