Skip to content

Commit

Permalink
inlayhint: fix server crashers when open file is removed
Browse files Browse the repository at this point in the history
  • Loading branch information
aspeddro authored and cristianoc committed Aug 2, 2022
1 parent fad3de2 commit b16d87a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
- Fix Incorrect semantic highlighting of `external` declarations https://github.com/rescript-lang/rescript-vscode/pull/517

- Fix issue where doc comment with nested comments inside is not shown properly on hover https://github.com/rescript-lang/rescript-vscode/pull/526
- Fix server crashes when open file is removed from disk with inlayHints enabled https://github.com/rescript-lang/rescript-vscode/issues/538

## v1.4.2

Expand Down
4 changes: 2 additions & 2 deletions analysis/src/Hint.ml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ let inlay ~path ~pos ~maxLength ~debug =
Ast_iterator.default_iterator.value_binding iterator vb
in
let iterator = {Ast_iterator.default_iterator with value_binding} in
(if Filename.check_suffix path ".res" then
(if Files.exists path && Filename.check_suffix path ".res" then
let parser =
Res_driver.parsingEngine.parseImplementation ~forPrinter:false
in
Expand Down Expand Up @@ -143,7 +143,7 @@ let codeLens ~path ~debug =
let iterator = {Ast_iterator.default_iterator with value_binding} in
(* We only print code lenses in implementation files. This is because they'd be redundant in interface files,
where the definition itself will be the same thing as what would've been printed in the code lens. *)
(if Filename.check_suffix path ".res" then
(if Files.exists path && Filename.check_suffix path ".res" then
let parser =
Res_driver.parsingEngine.parseImplementation ~forPrinter:false
in
Expand Down

0 comments on commit b16d87a

Please sign in to comment.