@@ -53,23 +53,12 @@ class OptimizableFunctionsInCommitParams:
5353server = CodeflashLanguageServer ("codeflash-language-server" , "v1.0" , protocol_cls = CodeflashLanguageServerProtocol )
5454
5555
56- # TODO: use _group_functions_by_file once https://github.com/codeflash-ai/codeflash/pull/688 is merged
5756@server .feature ("getOptimizableFunctionsInCurrentDiff" )
5857def get_functions_in_current_git_diff (
5958 server : CodeflashLanguageServer , _params : OptimizableFunctionsParams
6059) -> dict [str , str | dict [str , list [str ]]]:
6160 functions = get_functions_within_git_diff (uncommitted_changes = True )
62- file_to_funcs_to_optimize , _ = filter_functions (
63- modified_functions = functions ,
64- tests_root = server .optimizer .test_cfg .tests_root ,
65- ignore_paths = [],
66- project_root = server .optimizer .args .project_root ,
67- module_root = server .optimizer .args .module_root ,
68- previous_checkpoint_functions = {},
69- )
70- file_to_qualified_names : dict [str , list [str ]] = {
71- str (path ): [f .qualified_name for f in funcs ] for path , funcs in file_to_funcs_to_optimize .items ()
72- }
61+ file_to_qualified_names = _group_functions_by_file (server , functions )
7362 return {"functions" : file_to_qualified_names , "status" : "success" }
7463
7564
0 commit comments