Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The code formatting doesn't work at all #55

Open
VorpalBlade opened this issue Jun 11, 2021 · 1 comment
Open

The code formatting doesn't work at all #55

VorpalBlade opened this issue Jun 11, 2021 · 1 comment

Comments

@VorpalBlade
Copy link

Problem

When I try to format a file absolutely nothing happens. There is no error message, but the code is not changed either. I have looked in the Output window, the Debug Console etc and there is nothing there. I'm not sure how to proceed in debugging this issue further.

With regards to VSC-Prolog settings, the dialect is set to swi and the executable path is set to /usr/bin/swipl (which is indeed the correct path). Prolog linting seems to work properly, just not the formatting.

Versions

VSC-Prolog version: 0.8.23

VS Code version:

Version: 1.57.0
Commit: b4c1bd0a9b03c749ea011b06c6d2676c8091a70c
Date: 2021-06-09T17:18:42.895Z
Electron: 12.0.9
Chrome: 89.0.4389.128
Node.js: 14.16.0
V8: 8.9.255.25-electron.0
OS: Linux x64 5.8.0-55-generic

SWI-Prolog version:

$ swipl --version
SWI-Prolog version 8.2.4 for x86_64-linux
@kasbah
Copy link

kasbah commented Apr 24, 2024

I pulled out the formatter_swi.pl and ran it myself on swipl:

$ swipl
Welcome to SWI-Prolog (threaded, 64 bits, version 9.2.3)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.

For online help and background, visit https://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).

?- use_module('formatter_swi').
true.

?- formatter:format_prolog_source(2, 2, "hello.", "").
ERROR: setting `body_indentation' does not exist
ERROR: In:
ERROR:   [17] throw(error(existence_error(setting,body_indentation),_15040))
ERROR:   [14] formatter:read_and_portray_term(2,2,<stream>(0x55f3dc9eddc0)) at .../prolog/cards/formatter_swi.pl:48
ERROR:   [13] setup_call_cleanup(formatter:open_memory_file(<memory_file>(0x55f3dc9edce0),read,<stream>(0x55f3dc9eddc0)),formatter:read_and_portray_term(2,2,<stream>(0x55f3dc9eddc0)),formatter:close(<stream>(0x55f3dc9eddc0))) at /usr/lib/swipl/boot/init.pl:682
ERROR:   [12] formatter:format_prolog_source(2,2,'<garbage_collected>','<garbage_collected>') at .../prolog/cards/formatter_swi.pl:11
ERROR:   [11] toplevel_call('<garbage_collected>') at /usr/lib/swipl/boot/toplevel.pl:1317
ERROR: 
ERROR: Note: some frames are missing due to last-call optimization.
ERROR: Re-run your program in debug mode (:- debug.) to get more detail.

removing the set_setting s makes it work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants