anchor.diff:  fun_extraction_eclipse(FileName, Start, End, FunName) -> 
       refac_new_fun:fun_extraction_eclipse(FileName, Start, End, FunName).
   
  -%% =============================================================================================
  -%% @doc Fold expressions against a function definition.
  -%% This refactoring replaces instances of the right-hand side of a function clause definition by
  -%% the corresponding left-hand side with necessary parameter substitutions.
  -
  -%% <p> To apply this refactoring, move the cursor to the function clause against which expressions 
  -%% will be folded, then select <em> Fold Expression Against Function</em> from the <em> Refactor</em>
  -%% menu, after that the refactor will search the current module for expressions which are instances 
  -%% of the right-hand side of the selected function clause. </p>
  -%%
  -%% <p> If no candidate expression has been found, a message will be given, and the refactoring 
  -%% finishes; otherwise, Wrangler will go through the found candidate expressions one by one, and ask 
  -%% the user whether she/he wants to replace the expression with an application of selected function.
  -%% If the user answers 'yes' to one instance,  that instance will be replaced by function application,
  -%% otherwise it will remain unchanged. </p>
  -%%
  -%% <p> In the case that a candidate expression/expression sequence  need to export some variables which 
  -%% are used by the following code, that expression/expression sequence will be replaced by a match 
  -%% expression, whose left-hand side it the exported variable(s), and right-hand side is the function
  -%% application.</p>
  -%% 
  -%% <p> This refactoring does not support folding against function clauses with guard expressions, or 
  -%% function clauses with complex formal parameters, such as tuples, lists, or records. </p>
  -
  -%% This refactoring currrently only works with a single module, but will be extended to multiple modules.
  -%% =============================================================================================
  -%% @spec fold_expression(FileName::filename(), Line::integer(), Col::integer())-> term()
  --spec(fold_expression/3::(filename(), integer(), integer()) -> {ok, [filename()]} |{error, string()}).
  -fold_expression(FileName, Line, Col) ->
  -    refac_fold_expression:fold_expression(FileName, Line, Col).
  -
  -
  --spec(fold_expression_eclipse/3::(filename(), integer(), integer()) -> {ok, [{filename(), filename(), string()}]} | {error, string()}).
  -fold_expression_eclipse(FileName, Line, Col) ->
  -    refac_fold_expression:fold_expression_eclipse(FileName, Line, Col).
  -
  --spec(fold_expression_1_eclipse/3::(filename(), syntaxTree(), [{{{integer(), integer()}, {integer(), integer()}}, syntaxTree}]) ->
  +%% =============================================================================================
  +%% @doc Fold expressions against a function definition.
  +%% This refactoring replaces instances of the right-hand side of a function clause definition by
  +%% the corresponding left-hand side with necessary parameter substitutions.
  +
  +%% <p> To apply this refactoring, move the cursor to the function clause against which expressions 
  +%% will be folded, then select <em> Fold Expression Against Function</em> from the <em> Refactor</em>
  +%% menu, after that the refactor will search the current module for expressions which are instances 
  +%% of the right-hand side of the selected function clause. </p>
  +%%
  +%% <p> If no candidate expression has been found, a message will be given, and the refactoring 
  +%% finishes; otherwise, Wrangler will go through the found candidate expressions one by one, and ask 
  +%% the user whether she/he wants to replace the expression with an application of selected function.
  +%% If the user answers 'yes' to one instance,  that instance will be replaced by function application,
  +%% otherwise it will remain unchanged. </p>
  +%%
  +%% <p> In the case that a candidate expression/expression sequence  need to export some variables which 
  +%% are used by the following code, that expression/expression sequence will be replaced by a match 
  +%% expression, whose left-hand side it the exported variable(s), and right-hand side is the function
  +%% application.</p>
  +%% 
  +%% <p> This refactoring does not support folding against function clauses with guard expressions, or 
  +%% function clauses with complex formal parameters, such as tuples, lists, or records. </p>
  +
  +%% This refactoring currrently only works with a single module, but will be extended to multiple modules.
  +%% =============================================================================================
  +%% @spec fold_expression(FileName::filename(), Line::integer(), Col::integer())-> term()
  +
  +
  +-spec(fold_expr_by_loc/4::
  +      (filename(), integer(), integer(), [dir()]) -> {ok, [{integer(), integer(), integer(), integer(), syntaxTree(), {syntaxTree(), integer()}}]}
  +							 | {error, string()}).
  +fold_expr_by_loc(FileName, Line, Col, SearchPaths) ->
  +    refac_fold_expression:fold_expr_by_loc(FileName, Line, Col, SearchPaths).
  +
  +
  +-spec(fold_expr_by_loc_eclipse/4::(filename(), integer(), integer(), [dir()]) -> {ok, [{{{integer(), integer()}, {integer(), integer()}}, syntaxTree()}]} 
  +									 | {error, string()}).
  +fold_expr_by_loc_eclipse(FileName, Line, Col, SearchPaths) ->
  +    refac_fold_expression:fold_expr_by_loc_eclipse(FileName, Line, Col, SearchPaths).
  +
  +
  +-spec(fold_expr_by_name/6::(filename(), string(), string(), string(), string(), [dir()]) ->
  +	     {ok, [{integer(), integer(), integer(), integer(), syntaxTree(), {syntaxTree(), integer()}}]}
  +		 | {error, string()}).
  +
  +fold_expr_by_name(FileName, ModName, FunName, Arity, ClauseIndex, SearchPaths) ->
  +    refac_fold_expression:fold_expr_by_name(FileName, ModName, FunName, Arity, ClauseIndex, SearchPaths).
  +
  +
  +-spec(fold_expr_by_name_eclipse/6::(filename(), string(), string(), string(), string(), [dir()]) ->
  +	     {ok, [{{{integer(), integer()}, {integer(), integer()}}, syntaxTree()}]} 
  +		 | {error, string()}).
  +
  +fold_expr_by_name_eclipse(FileName, ModName, FunName, Arity, ClauseIndex, SearchPaths) ->
  +    refac_fold_expression:fold_expr_by_name_eclipse(FileName, ModName, FunName, Arity, ClauseIndex, SearchPaths).
  +
  +
  +-spec(fold_expression_1_eclipse/4::(filename(), syntaxTree(), [{{{integer(), integer()}, {integer(), integer()}}, syntaxTree}],[dir()]) ->
   	     {ok, [{filename(), filename(), string()}]}).
  -fold_expression_1_eclipse(FileName, FunClauseDef, StartEndExpList)->  %% StartEndExpList: {{{StartLine, StartCol}, {EndLine, EndCol}}, NewExp}
  -    refac_fold_expression:fold_expression_1_eclipse(FileName, FunClauseDef, StartEndExpList).
  -
  --spec(fold_expression_2_eclipse/5::(filename(), atom(),integer(), integer(), integer()) -> 
  +fold_expression_1_eclipse(FileName, FunClauseDef, StartEndExpList, SearchPaths)->  %% StartEndExpList: {{{StartLine, StartCol}, {EndLine, EndCol}}, NewExp}
  +    refac_fold_expression:fold_expression_1_eclipse(FileName, FunClauseDef, StartEndExpList, SearchPaths).
  +
  +-spec(fold_expression_2_eclipse/6::(filename(), atom(),integer(), integer(), integer(), [dir()]) -> 
   	     {ok, [{integer(), integer(), integer(), integer(), syntaxTree(), {syntaxTree(), integer()}}]}
                | {error, string()}).
  -fold_expression_2_eclipse(FileName, FunName, Arity, ClauseIndex, StartLine) ->
  -    refac_fold_expression:fold_expression_2_eclipse(FileName, FunName, Arity, ClauseIndex, StartLine).
  -
  -
  -%%@private
  -%%@spec instrument_prog(FileName::filename(), SearchPaths::[dir()]) -> term()
  --spec(instrument_prog/2::(filename(), [dir()]) ->{ok, [filename()]} | {error, string()}).    
  +fold_expression_2_eclipse(FileName, FunName, Arity, ClauseIndex, StartLine, SearchPaths) ->
  +    refac_fold_expression:fold_expression_2_eclipse(FileName, FunName, Arity, ClauseIndex, StartLine, SearchPaths).
  +
  +
  +%%@private
  +%%@spec instrument_prog(FileName::filename(), SearchPaths::[dir()]) -> term()
  +-spec(instrument_prog/2::(filename(), [dir()]) ->{ok, [filename()]} | {error, string()}).  
   instrument_prog(FileName, SearchPaths) ->
        refac_instrument:instrument_prog(FileName, SearchPaths).
   
   
  -%%@private
  -%%@spec uninstrument_prog(FileName::filename(), SearchPaths::[dir()]) -> term()
  +%%@private
  +%%@spec uninstrument_prog(FileName::filename(), SearchPaths::[dir()]) -> term()
   -spec(uninstrument_prog/2::(filename(), [dir()]) ->{ok, [filename()]} | {error, string()}).
   uninstrument_prog(FileName, SearchPaths) ->
        refac_instrument:uninstrument_prog(FileName, SearchPaths).
   
   
  -%%@private
  -%%@spec add_a_tag(Filename::filename(), Line::integer(), Col::integer(), Tag::atom(), SearchPaths::[dir()]) -> term()
  +%%@private
  +%%@spec add_a_tag(Filename::filename(), Line::integer(), Col::integer(), Tag::atom(), SearchPaths::[dir()]) -> term()
   -spec(add_a_tag/5::(filename(), integer(), integer(), string(), [dir()]) ->
   	     {error, string()} | {ok, [filename()]}).
   add_a_tag(FileName, Line, Col, Tag, SearchPaths) ->
       refac_add_a_tag:add_a_tag(FileName, Line, Col, Tag, SearchPaths).
   
   
  -%%@private
  -%%spec register_pid(Filename::filename(), Start::pos(), End::pos(), RegName::atom(), SearchPaths::[dir()]) ->term()
  +%%@private
  +%%spec register_pid(Filename::filename(), Start::pos(), End::pos(), RegName::atom(), SearchPaths::[dir()]) ->term()
   -spec(register_pid/5::(filename(), pos(), pos(), string(), [dir()]) ->
       {error, string()}|{ok, [filename()]}).
   register_pid(FileName, Start, End, RegName, SearchPaths) ->
       refac_register_pid:register_pid(FileName, Start, End, RegName, SearchPaths).
       
  -%%@private
  -%%spec trace_send({ModName::atom(), FunName::atom(), Arity::integer()}, Index::integer(), Pid::pid(), TraceCacheFile::filename()) ->term().
  -%% trace_send({ModName, FunName, Arity}, Index, Pid, TraceCacheFile) ->
  -%%     PInfo = erlang:process_info(Pid),
  -%%     {value, InitialCall} = lists:keysearch(initial_call, 1, PInfo),
  -%%     {value, CurrentFun} = lists:keysearch(current_function,1, PInfo),
  -%%     SendInfo =case lists:keysearch(registered_name, 1, PInfo) of 
  -%% 		  {value, RegisteredName} ->
  -%% 		      {send, {ModName, FunName, Arity, Index}, Pid, InitialCall, CurrentFun, RegisteredName};
  -%% 		  false ->
  -%% 		      {send, {ModName, FunName, Arity, Index}, Pid, InitialCall, CurrentFun}
  -%% 	      end,
  -%%     case dets:open_file(TraceCacheFile, [{type, bag}]) of 
  -%% 	{ok, TraceCacheFile} -> 
  -%% 	   dets:insert(TraceCacheFile, SendInfo),
  -%% 	   dets:close(TraceCacheFile);
  -%% 	{error, Reason}  -> eralng:error(Reason)
  -%%     end.
  -
  -%%@private
  -%%spec trace_spawn({ModName::atom(), FunName::atom(), Arity::integer()}, Index::integer(), Pid::pid(), TraceCacheFile::filename()) ->term().
  -%% trace_spawn({ModName, FunName, Arity}, Index, Pid, TraceCacheFile) ->
  -%%     SpawnInfo = {spawn, {ModName, FunName, Arity, Index}, Pid},
  -%%     case dets:open_file(TraceCacheFile, [{type, bag}]) of 
  -%% 	{ok, TraceCacheFile} -> 
  -%% 	    dets:insert(TraceCacheFile, SpawnInfo),
  -%% 	    dets:close(TraceCacheFile);
  -%% 	{error, Reason}  -> eralng:error(Reason)
  -%%     end.    
  -
  -
  -%%=========================================================================================
  -%% @doc Some consecutive arguments of a function are contracted into a tuple
  -%% <p> To apply this refactoring, point the cursor to a function parameter, 
  -%% or an application argument.
  -%% Then select <em> Tuple Function Arguments </em> from the <em> Refactor </em> menu, 
  -%% after that the refactorer will prompt to enter  the new tuple elements number in the mini-buffer.
  -%% </p>
  -%% <p>
  -%% When tupling an exported function parameters, this refactoring has a global effect, i.e.,
  -%% it affects all those modules in which this function is imported/used.
  -%% </p>
  -%% <p> The following <em> side-conditions </em> apply to this refactoring:
  -%% <li> The new function arity should not cause confliction with any of the functions which are in scope in the 
  -%% current module;</li>
  -%% <li> In the case that the function is imported by another module, the new function arity and the same name 
  -%% should not be already in scope (either defined or imported) in that module. </li>
  -%% </p>
  -%% ========================================================================================
  -%% @spec tuple_funpar(FileName::filename(), Line::integer(), Col::integer(), Number::string(), SearchPaths::[dir()])
  -%% -> term()
  +%%@private
  +%%spec trace_send({ModName::atom(), FunName::atom(), Arity::integer()}, Index::integer(), Pid::pid(), TraceCacheFile::filename()) ->term().
  +%% trace_send({ModName, FunName, Arity}, Index, Pid, TraceCacheFile) ->
  +%%     PInfo = erlang:process_info(Pid),
  +%%     {value, InitialCall} = lists:keysearch(initial_call, 1, PInfo),
  +%%     {value, CurrentFun} = lists:keysearch(current_function,1, PInfo),
  +%%     SendInfo =case lists:keysearch(registered_name, 1, PInfo) of 
  +%% 		  {value, RegisteredName} ->
  +%% 		      {send, {ModName, FunName, Arity, Index}, Pid, InitialCall, CurrentFun, RegisteredName};
  +%% 		  false ->
  +%% 		      {send, {ModName, FunName, Arity, Index}, Pid, InitialCall, CurrentFun}
  +%% 	      end,
  +%%     case dets:open_file(TraceCacheFile, [{type, bag}]) of 
  +%% 	{ok, TraceCacheFile} -> 
  +%% 	   dets:insert(TraceCacheFile, SendInfo),
  +%% 	   dets:close(TraceCacheFile);
  +%% 	{error, Reason}  -> eralng:error(Reason)
  +%%     end.
  +
  +%%@private
  +%%spec trace_spawn({ModName::atom(), FunName::atom(), Arity::integer()}, Index::integer(), Pid::pid(), TraceCacheFile::filename()) ->term().
  +%% trace_spawn({ModName, FunName, Arity}, Index, Pid, TraceCacheFile) ->
  +%%     SpawnInfo = {spawn, {ModName, FunName, Arity, Index}, Pid},
  +%%     case dets:open_file(TraceCacheFile, [{type, bag}]) of 
  +%% 	{ok, TraceCacheFile} -> 
  +%% 	    dets:insert(TraceCacheFile, SpawnInfo),
  +%% 	    dets:close(TraceCacheFile);
  +%% 	{error, Reason}  -> eralng:error(Reason)
  +%%     end.    
  +
  +
  +%%=========================================================================================
  +%% @doc Some consecutive arguments of a function are contracted into a tuple
  +%% <p> To apply this refactoring, point the cursor to a function parameter, 
  +%% or an application argument.
  +%% Then select <em> Tuple Function Arguments </em> from the <em> Refactor </em> menu, 
  +%% after that the refactorer will prompt to enter  the new tuple elements number in the mini-buffer.
  +%% </p>
  +%% <p>
  +%% When tupling an exported function parameters, this refactoring has a global effect, i.e.,
  +%% it affects all those modules in which this function is imported/used.
  +%% </p>
  +%% <p> The following <em> side-conditions </em> apply to this refactoring:
  +%% <li> The new function arity should not cause confliction with any of the functions which are in scope in the 
  +%% current module;</li>
  +%% <li> In the case that the function is imported by another module, the new function arity and the same name 
  +%% should not be already in scope (either defined or imported) in that module. </li>
  +%% </p>
  +%% ========================================================================================
  +%% @spec tuple_funpar(FileName::filename(), Line::integer(), Col::integer(), Number::string(), SearchPaths::[dir()])
  +%% -> term()
   -spec(tuple_funpar/5::(filename(), integer(), integer(), string(), [dir()]) ->
   	     {error, string()} | {ok, [filename()]}).
   
  
positive.code:     refac_move_fun:move_fun_eclipse(FileName, Line, Col, TargetModName, CreateNewFile, SearchPaths).
  
  
  %% ==================================================================================
  %% @doc The duplicated code detector that only works with the current Erlang buffer.
  %% <p> This function reports the duplicated code fragments found in the current Erlang buffer. It does 
  %% not remove those code clones. The user will be prompted for two parameters: the minimum number of 
  %% tokens a cloned code fragment should have, and the minimum number of times a code fragment is duplicated.
  %% </p>
  %% <p> The current version of the duplicated code detector can report clones that are syntactically 
  %% identical after consistent renaming of variables, except for variations in literals, layout and comments.
  %% </p>
  %% =====================================================================================
  %% @spec duplicated_code_in_buffer(FileName::filename(),MinToks::integer(),MinClones::integer()) -> term()
  %% 
        
  -spec(duplicated_code_in_buffer/3::(filename(), string(), string()) ->{ok, string()}).       
  duplicated_code_in_buffer(FileName, MinToks, MinClones) -> 
      refac_duplicated_code:duplicated_code([FileName], MinToks, MinClones).
  
  
  %% =====================================================================================
  %% @doc The duplicated code detector that works with multiple Erlang modules.
  %% <p> This function reports duplicated code fragments found in the directories specified by SearchPaths.
  %% The user will be prompted for two parameters: the minimum number of 
  %% tokens that a cloned code fragment should have, and the minimum number of times a code fragment is duplicated.
  %% </p>
  %% <p> The current version of the duplicated code detector can report clones that are syntactically 
  %% identical after consistent renaming of variables, except for variations in literals, layout and comments.
  %% </p>
  %%======================================================================================
  %% @spec duplicated_code_in_dirs(FileNameList::[filename()|dir()], MinToks::integer(), MinClones::integer()) -> term()
  
  -spec(duplicated_code_in_dirs/3::([dir()], string(), string()) ->{ok, string()}).
  duplicated_code_in_dirs(FileDirList, MinToks, MinClones) ->
      refac_duplicated_code:duplicated_code(FileDirList, MinToks, MinClones).
      
  
  %% ==================================================================================================
  %% @doc Search for clones of a user-selected expression/expression sequence in the current file.
  %% 
  %% <p> This functionality allows to search for clones of a selected expression or expression 
  %% sequence.  The found clones are syntactically identical to the user-selected code fragment after consistent renaming of variables, 
  %% except for variations in literals, layout and comments. 
  %% </p>
  %% <p> When the selected code contains multiple, but non-continuous sequence of, expressions, the first
  %% continuous sequence of expressions is taken as the user-selected expression. A continuous sequence of
  %% expressions is a sequence of expressions separated by ','. </p>
  %% ==================================================================================================
  %% @spec expression_search(FileName::filename(),Start::Pos, End::Pos) -> term()
  
  -spec(expression_search/3::(filename(), pos(), pos()) -> {ok, [{integer(), integer(), integer(), integer()}]} | {error, string()}).  
  expression_search(FileName, Start, End) ->
      refac_expr_search:expr_search(FileName, Start, End).
  
  
  
  %% =====================================================================================================
  %%@doc Introduce a new function to represent a user-selected expression or expression sequence.
  %% <p> This refactoring allows the user to introduce a new function to represent a selected expression or expression 
  %% sequence, and replace the selected expression/expression sequence with a call to the newly introduced function.  Those free variables
  %% within the expression/expression sequence become the formal parameters of the function. </p>
  %% =====================================================================================================
  %% @spec fun_extraction(FileName::filename(), Start::Pos, End::Pos, FunName::string()) -> term()
  
  -spec(fun_extraction/4::(filename(), pos(), pos(), string()) ->
  	      {error, string()} | {ok, string()}).
  
negative.code:     refac_tuple_to_record:tuple_to_record(File, FLine, FCol, LLine, LCol, RecName,
  					  FieldString, SearchPaths).
  
  %%@private
  %% @spec tuple_to_record_eclipse(File::filename(),FLine::integer(),FCol::integer(),
  %%           LLine::integer(),LCol::integer(), RecName::string(),
  %%           FieldString::[string()], SearchPaths::[dir()]) -> term()
  -spec(tuple_to_record_eclipse/8::(filename(), integer(), integer(), integer(), integer(), string(), [string()], [dir()]) ->
  	     {error, string()} | {ok, [{filename(), filename(), string()}]}).
  
  