jaredly / jaredly/reason-language-server

Double indication of values used from opens_codelens causing view scrolling off-by-one erro

Open
#228 6 comments 2 reactions 0 assignees View on GitHub
bug
Dominant language
OCaml
Stars
649
Forks
85
PR merge metrics
No merged PRs in 30d

Description

When "Indicate what values have been used from an open" is checked in the settings (under `Reason_language_server: Opens_codelens` section of vs code settings) I get one line and one _extra_ line in my code showing the values that the `open` adds to a file. The extra line seems to result in a miscalculation of how many lines are in the file, which results in (an annoying) off-by-one error that scrolls the view unnecessarily by one line whenever I type a key.

![off-by-one](https://user-images.githubusercontent.com/129/51090695-fb1d7880-173c-11e9-861a-24e7bf85c22d.png)

In case it helps, this is the `Float` module that I reference in the `Utils` parent module above:

```
module Float = {
let (+) = (+.);
let (-) = (-.);
let ( * ) = ( *. );
let (/) = (/.);
let (~-) = (~-.);
};
```

This is what the off-by-one error does when editing the file (37 sec. video):
https://www.dropbox.com/s/tsp22oawsqubyfq/OffByOne.mp4?dl=0

(Each keypress, after a few hundred milleseconds debounce, results in the view scrolling by one line).

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue with "Indicate what values have been used from an open" enabled under the Reason_language_server: Opens_codelens settings. Compare the displayed codelens lines with the file's actual line count while editing the Float and Utils example. Done means the duplicate indication and one-line scroll on each debounced keypress no longer occur.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.