on master help sign in
Add (SWI-)Prolog LSP support (#816)

As discussed in #809 ; I also have a [tree-sitter implementation](https://github.com/jamesnvc/tree-sitter-prolog), but for reasons discussed in the linked post, I kind of gave up on that sort of static approach for making a general-purpose Prolog grammar (since it has a very flexible syntax and allows defining new operators with new precedences dynamically). That being said, the LSP implementation here at least shows documentation and does support the semantic token API, so when Helix supports that, this should also provide highlighting.

commit2e692dc184d86c674da9e77afe93896743f67ebd authorJames Cash <james.nvc@gmail.com> dateThu 7 Oct 2021, 22:05 (5 years ago) parent8925fdd
1 file changed+12
languages.toml+12
languages.toml+12
@@ -315,3 +315,15 @@ comment-token = "//"
315315
316316language-server = { command = "zls" }
317317indent = { tab-width = 4, unit = " " }
318+
319+[[language]]
320+name = "prolog"
321+scope = "source.prolog"
322+roots = []
323+file-types = ["pl", "prolog"]
324+comment-token = "%"
325+
326+language-server = { command = "swipl", args = [
327+ "-g", "use_module(library(lsp_server))",
328+ "-g", "lsp_server:main",
329+ "-t", "halt", "--", "stdio"] }