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

Commit 72162eb

Browse files
committed
Autocomplete: add support for open! in addition to open.
Normal case: - `open! M` Some corner cases: - `open ! M` - `open!M`
1 parent 9afaa56 commit 72162eb

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Changes.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## master
22
- Add support for @deprecated attributes in autocomplete and hover.
33
- Support for upcoming `rescript` npm package for the compiler. Look for `rescript` in addition to `bs-platform` in `node_modules`.
4+
- Autocomplete: add support for `open!` in addition to `open`.
45

56
## Upcoming Release of rescript-vscode
67

src/rescript-editor-support/PartialParser.re

+9-1
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,16 @@ let findOpens = (text, offset) => {
170170
| '.'
171171
| '_'
172172
| '0'..'9' => loop(i - 1)
173-
| ' ' =>
173+
| ' '
174+
| '!' =>
174175
let at = skipWhite(text, i - 1);
176+
let at =
177+
if (at >= 0 && text.[at] == '!') {
178+
// handle open!
179+
skipWhite(text, at - 1);
180+
} else {
181+
at;
182+
};
175183
if (at >= 3
176184
&& text.[at - 3] == 'o'
177185
&& text.[at - 2] == 'p'

0 commit comments

Comments
 (0)