Skip to content
This repository was archived by the owner on Apr 24, 2021. It is now read-only.

Commit 9d9347f

Browse files
committed
Fix infinite loop in autocomplete.
The backwards partial parser used by autocomplete can go into an infinite loop. Repro: file `" }` then edit adding `.`. Could be the cause of rescript-lang/rescript-vscode#43
1 parent 6f0df86 commit 9d9347f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
- Add support for printing uncurried function types in hover.
44
- Fix autocomplete issue where `open Foo` would be picked up inside line comments (see https://github.com/rescript-lang/rescript-editor-support/issues/15).
55
- Don't print parens as in `A()` for 0-ary variants.
6+
- Fix infinite loop in autocomplete that can cause `rescript-editor-support.exe` processes to use up 100% cpu.
67

78
## Release 1.0.3 of rescript-vscode
89
This [commit](https://github.com/rescript-lang/rescript-editor-support/commit/214d220d8573f9f0c8d54e623c163e01617bf124) is vendored in [rescript-vscode 1.0.3](https://github.com/rescript-lang/rescript-vscode/releases/tag/1.0.3).

src/rescript-editor-support/PartialParser.re

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
let rec findBack = (text, char, i) =>
22
if (i < 0) {
3-
0;
3+
i;
44
} else if (text.[i] == char && (i == 0 || text.[i - 1] != '/')) {
55
i - 1;
66
} else {

0 commit comments

Comments
 (0)