snippet OBJ ":- object()."
:- object($1).

$2

:- end_object.
endsnippet

snippet CAT ":- category()."
:- category($1).

$2

:- end_category.
endsnippet

snippet PRO ":- protocol()."
:- protocol($1).

$2

:- end_protocol.
endsnippet

snippet INFO ":- info(Object Docs)."
	:- info([
		version is 1:0:0,
		author is '$1',
		date is `date +%Y-%m-%d`,
		comment is '$2'
	]).
endsnippet

snippet USES ":- uses/2"
	:- uses($1, [
		$2
	]).

$3
endsnippet

snippet OR ";"
	(	$1
	;	$2
	)$3
endsnippet

snippet IF "(-> ;)"
	(	$1
	->	$2
	;	$3
	)$4
endsnippet

snippet IFELIF "(-> -> ;)"
	(	${1:if}
	->	${2:when true}
	;	${3:elif}
	->	${4:when true}
	;	${5:when false}
	)$6
endsnippet

snippet PUBLIC ":- public(Docs)."
	:- public($1/${2:2}).
	:- mode($1($3), ${4:zero_or_more}).
	:- info($1/$2, [
		comment is '$5',
		argnames is [$6]
	]).
endsnippet

snippet PRIVATE ":- private(Docs)."
	:- private($1/${2:2}).
	:- mode($1($3), ${4:zero_or_more}).
	:- info($1/$2, [
		comment is '$5',
		argnames is [$6]
	]).
endsnippet

snippet PROTECTED ":- protected(Docs)."
	:- private($1/${2:2}).
	:- mode($1($3), ${4:zero_or_more}).
	:- info($1/$2, [
		comment is '$5',
		argnames is [$6]
	]).
endsnippet

snippet INIT ":- initialization(())"
:- initialization((
	$1
)).
endsnippet

snippet LOAD "loader.lgt"
:- initialization((
	logtalk_load([
		$1
	])
)).
endsnippet

snippet TESTER "initialiazation for tester"
:- initialization((
	set_logtalk_flag(report, warnings),
	logtalk_load([
		${1:dependencies}
	]),
	logtalk_load(lgtunit(loader)),
	logtalk_load([
		${2:source}
	], [
		source_data(on),
		debug(on)
	]),
	logtalk_load(tests, [hook(lgtunit)]),
	tests::run
)).
endsnippet

snippet TESTS "Test Object"
:- object(tests,
	extends(lgtunit)).

	:- info([
		version is 1:0:0,
		author is '$1',
		date is `date +%Y-%m-%d`,
		comment is 'Unit tests for $2'
	]).

	cover($3).

	test($4, ${5:true}) :-
		${6:fail}.

:- end_object.
endsnippet
