aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Cash2021-10-08 02:05:30 +0000
committerGitHub2021-10-08 02:05:30 +0000
commit2e692dc184d86c674da9e77afe93896743f67ebd (patch)
tree029299c9df3d3a94904e7faf4d5e8f7617274270
parent8925fdd6f3afa3532c928a5c6e1357bc15201d8a (diff)
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.
-rw-r--r--languages.toml12
1 files changed, 12 insertions, 0 deletions
diff --git a/languages.toml b/languages.toml
index fe473f89..e7d4075c 100644
--- a/languages.toml
+++ b/languages.toml
@@ -315,3 +315,15 @@ comment-token = "//"
language-server = { command = "zls" }
indent = { tab-width = 4, unit = " " }
+
+[[language]]
+name = "prolog"
+scope = "source.prolog"
+roots = []
+file-types = ["pl", "prolog"]
+comment-token = "%"
+
+language-server = { command = "swipl", args = [
+ "-g", "use_module(library(lsp_server))",
+ "-g", "lsp_server:main",
+ "-t", "halt", "--", "stdio"] }