Open XVilka opened 4 years ago
Excellent idea, I will test with Scryer Prolog & see what I can do to make it work with that as well.
As I see it, there are two ways of looking at this:
I suspect 1 will be much easier, as the current implementation leverages some SWI-specific libraries, primarily prolog_xref
(for general static analysis of the code) and prolog_colour
for semantic highlighting.
However, I've also been considering changing how the server works and, instead of using static analysis, load the code in question in a separate thread & query it to determine things like defined predicates. If I would do that (I have some concerns about how to do some safely & in full generality), presumably that could make approach 2 more feasible, since it could use more of the standard Prolog introspection predicates for most of the work.
Apart from SWI Prolog it might be helpful in case of other Prolog implementations. I am more interested in compatibility with Scryer Prolog but maybe some other users will want other different implementations too, e.g. GNU Prolog or XSB:
See also https://github.com/mthom/scryer-prolog/issues/161