Open phaistos opened 6 years ago
Yeah, you can disable formatting without affecting other functionalities. Maybe I'd improve formatting somedays. Sorry for the inconvenience.
@arthwang How? "prolog.format.enabled": false
doesn't change this behaviour.
I'm sorry it's a bug. Please update to see if it's ok now.
Update fixed it for me, Arthur. Thank you for your effort.
@arthwang Thank you, it is much better now. Although there is still a weird thing it does when pressing enter and then a dot after typing a head (prime(N) :- **press enter here** **now press dot**
). It copies the head to the body (With the formatting setting disabled). But that's not a very big issue in my opinion.
Oh yeah, that's a design. 'dot repeat' is inspired by emacs prolog plugin. It repeats last clause head since there are many such situations. What's more, in recursive clauses, it copies the head with arguments updated smartly. try:
test(N) :-N =< 0, !.
('dot' here will copy 'test(N)' in place)
test(N) :-
N1 is N - 1,
writeln(N1),
(enter '.' here, you will get 'test(N1).' )
Image that if you have more than 5 arguments, 'dot' will save you a lot of typings.
Typing a
.
often pulls the clause to the beginning of the line.and it gets confused by clpfd contraints, like in (both pulls the body clause back and doesn't highlight the
..
properly):In other cases it works fine:
Can i just turn autoformatting off entirely for prolog documents while still getting linting and documentation of library functions?
(Linux Mint 19, VSC 1.26.0 and plugin 0.8.17, swipl 7.6.4)