From 2e692dc184d86c674da9e77afe93896743f67ebd Mon Sep 17 00:00:00 2001 From: James Cash Date: Thu, 7 Oct 2021 22:05:30 -0400 Subject: [PATCH] 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. --- languages.toml | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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"] }