diff --git a/lib/kernel/match/match_context.ml b/lib/kernel/match/match_context.ml index a9373ba..84b46ce 100644 --- a/lib/kernel/match/match_context.ml +++ b/lib/kernel/match/match_context.ml @@ -67,9 +67,6 @@ let update_environment f env = let to_json source_path matches = let json_matches matches = matches - |> List.map ~f:(fun m -> - { m with matched = String.escaped m.matched; - environment = update_environment String.escaped m.environment }) |> List.map ~f:to_yojson |> fun matches -> `List matches diff --git a/test/common/test_cli.ml b/test/common/test_cli.ml index b01bef9..3606367 100644 --- a/test/common/test_cli.ml +++ b/test/common/test_cli.ml @@ -863,7 +863,7 @@ in let command = Format.sprintf "%s %s" binary_path command_args in read_expect_stdin_and_stdout command source |> print_string; - [%expect_exact {|{"uri":null,"matches":[{"range":{"start":{"offset":5,"line":2,"column":5},"end":{"offset":11,"line":2,"column":11}},"environment":[],"matched":"let ()"},{"range":{"start":{"offset":23,"line":3,"column":5},"end":{"offset":34,"line":5,"column":7}},"environment":[],"matched":"let\\n\\n ()"},{"range":{"start":{"offset":42,"line":7,"column":5},"end":{"offset":48,"line":7,"column":11}},"environment":[],"matched":"let ()"}]} + [%expect_exact {|{"uri":null,"matches":[{"range":{"start":{"offset":5,"line":2,"column":5},"end":{"offset":11,"line":2,"column":11}},"environment":[],"matched":"let ()"},{"range":{"start":{"offset":23,"line":3,"column":5},"end":{"offset":34,"line":5,"column":7}},"environment":[],"matched":"let\n\n ()"},{"range":{"start":{"offset":42,"line":7,"column":5},"end":{"offset":48,"line":7,"column":11}},"environment":[],"matched":"let ()"}]} WARNING: -count and -json-lines is specified. Ignoring -count. |}]; diff --git a/test/common/test_offset_conversion.ml b/test/common/test_offset_conversion.ml index 755215b..7a9e101 100644 --- a/test/common/test_offset_conversion.ml +++ b/test/common/test_offset_conversion.ml @@ -211,7 +211,7 @@ let%expect_test "correct_columns" = print_string @@ Format.sprintf "Offset conversion does not match. Expect@.%s@.got %s" slow_result fast_result else print_string fast_result; - [%expect_exact {|{"uri":"file","matches":[{"range":{"start":{"offset":0,"line":1,"column":1},"end":{"offset":25,"line":3,"column":1}},"environment":[{"variable":"1","value":"world\\nhello potato\\n","range":{"start":{"offset":6,"line":1,"column":7},"end":{"offset":25,"line":3,"column":1}}}],"matched":"hello world\\nhello potato\\n"}]} + [%expect_exact {|{"uri":"file","matches":[{"range":{"start":{"offset":0,"line":1,"column":1},"end":{"offset":25,"line":3,"column":1}},"environment":[{"variable":"1","value":"world\nhello potato\n","range":{"start":{"offset":6,"line":1,"column":7},"end":{"offset":25,"line":3,"column":1}}}],"matched":"hello world\nhello potato\n"}]} |}]; let source = "hello world\nhello potato" in @@ -221,5 +221,5 @@ let%expect_test "correct_columns" = print_string @@ Format.sprintf "Offset conversion does not match. Expect@.%s@.got %s" slow_result fast_result else print_string fast_result; - [%expect_exact {|{"uri":"file","matches":[{"range":{"start":{"offset":0,"line":1,"column":1},"end":{"offset":24,"line":2,"column":13}},"environment":[{"variable":"1","value":"world\\nhello potato","range":{"start":{"offset":6,"line":1,"column":7},"end":{"offset":24,"line":2,"column":13}}}],"matched":"hello world\\nhello potato"}]} + [%expect_exact {|{"uri":"file","matches":[{"range":{"start":{"offset":0,"line":1,"column":1},"end":{"offset":24,"line":2,"column":13}},"environment":[{"variable":"1","value":"world\nhello potato","range":{"start":{"offset":6,"line":1,"column":7},"end":{"offset":24,"line":2,"column":13}}}],"matched":"hello world\nhello potato"}]} |}]