Skip to content

Commit

Permalink
[flow] Drop fuzzy_score's dependence on Exception.ml
Browse files Browse the repository at this point in the history
Summary:
The goal is to make autocomplete work in try-flow.

The dependence pulls in some unix code, which won't work in flow.js. This diff removes it. I don't think we lose much without the exception wrapping.

Changelog: [internal]

Reviewed By: panagosg7

Differential Revision: D55555437

fbshipit-source-id: 5a64cf341c578ad87895c6d9242511a7914b60e8
  • Loading branch information
SamChou19815 authored and facebook-github-bot committed Apr 2, 2024
1 parent 6be0565 commit b35cf4d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/common/fuzzy_score/dune
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(library
(name fuzzy_score)
(wrapped false)
(libraries base utils_core))
(libraries base))

(dirs
(:standard __tests__))
6 changes: 3 additions & 3 deletions src/common/fuzzy_score/fuzzy_score.ml
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,8 @@ let fuzzy_score
fill_columns (column + 1) (word_pos + 1)
and fill_columns column word_pos =
try fill_columns_unsafe column word_pos with
| Invalid_argument msg as exn ->
let exn = Exception.wrap exn in
| Invalid_argument msg ->
let bt = Printexc.get_raw_backtrace () in
let msg =
Printf.sprintf
"%s (pattern: %S, word: %S, row: %d, column: %d)"
Expand All @@ -373,7 +373,7 @@ let fuzzy_score
row
column
in
Exception.raise_with_backtrace (Invalid_argument msg) exn
Printexc.raise_with_backtrace (Invalid_argument msg) bt
in
let column = fill_columns (min_word_match_pos_ - word_start + 1) min_word_match_pos_ in

Expand Down

0 comments on commit b35cf4d

Please sign in to comment.