1/***************************************************************************** 2 * This file is part of the Prolog Development Tool (PDT) 3 * 4 * WWW: http://sewiki.iai.uni-bonn.de/research/pdt/start 5 * Mail: pdt@lists.iai.uni-bonn.de 6 * Copyright (C): 2004-2012, CS Dept. III, University of Bonn 7 * 8 * All rights reserved. This program is made available under the terms 9 * of the Eclipse Public License v1.0 which accompanies this distribution, 10 * and is available at http://www.eclipse.org/legal/epl-v10.html 11 * 12 ****************************************************************************/ 13 14:- module(pdt_smells, [smell_marker_pdt/7]). 15 16%:- user:ensure_loaded(pdt_builder_analyzer('meta_pred_toplevel.pl')). 17 18:- multifile smell_description_pdt/3. 19:- multifile smell/5. 20 21smell_marker_pdt(_Name, _Description, _QuickfixDescription, _QuickfixAction, _File, _Start, _Length) :- fail. 22% smell_description_pdt(Name, Description, QuickfixDescription), 23% smell(Name, File, Start, Length, QuickfixAction). 24% 25%smell_description_pdt('MissingMetaPredicateDeclaration', SmellDescription, QuickfixDescription):- 26% SmellDescription = 'Missing meta-predicate declation', 27% QuickfixDescription = 'Add missing meta-predicate declaration'. 28% 29% 30%%QuickfixAction ist der Text, der unmittelbar vor dem Smell eingetragen werden muss (Zeilenumbruch muss mit angegeben werden) 31%smell('MissingMetaPredicateDeclaration', File, Offset, 0, QuickfixAction) :- 32% find_undeclared_meta_predicates_position(File, Offset, Spec), 33% format(atom(QuickfixAction),':- meta_predicate(~w).~n', [Spec]). 34 35 36 37 38% Dummy: Just for testing 39%smell_description_pdt('hallo', 'beschreibung', 'fix beschreibung'). 40%smell('hallo', 'l:/work/noth/workspaces/runtime generics/dummdidumm/pl/heididdeliho.pl', 0, 5, '% fix itself\n').