Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fleche] update progress indicator correctly on End Of File #606

Merged
merged 1 commit into from
Nov 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
state. This is a much needed API change for a lot of use cases
(@ejgallego, #604)
- support OCaml 5.1.x (@ejgallego, #606)
- update progress indicator correctly on End Of File (@ejgallego,
#605, fixes #445)

# coq-lsp 0.1.8: Trick-or-treat
-------------------------------
Expand Down Expand Up @@ -108,7 +110,7 @@
(@ejgallego, #438, reported by David Ilcinkas)
- Fix "Error message browser becomes non-visible when there are many
goals" by using a fixed-position separated error display (@TDiazT,
#445, fixes #441)
#455, fixes #441)
- Message about workspace detection was printing the wrong file,
(@ejgallego, #444, reported by Alex Sanchez-Stern)
- Display the list of pending obligations in info panel (@ejgallego,
Expand Down
13 changes: 13 additions & 0 deletions examples/comments_end.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Definition a := 3.

(*


Boooo
Boooo
Boooo



*)

8 changes: 5 additions & 3 deletions fleche/doc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -627,16 +627,16 @@ let parse_action ~lines ~st last_tok doc_handle =
match res with
| Ok None ->
(* We actually need to fix Coq to return the location of the true file
EOF, the below trick doesn't work. That will involved updating the type
of `main_entry` *)
EOF, the below trick seems to work tho. Coq fix involves updating the
type of `Pcoq.main_entry` *)
let last_tok = Coq.Parsing.Parsable.loc doc_handle in
let last_tok = Coq.Utils.to_range ~lines last_tok in
(EOF (Yes last_tok), [], feedback, time)
| Ok (Some ast) ->
let () = if Debug.parsing then DDebug.parsed_sentence ~ast in
(Process ast, [], feedback, time)
| Error (Anomaly (_, msg)) | Error (User (None, msg)) ->
(* We don't have a better altenative :(, usually missing error loc here
(* We don't have a better alternative :(, usually missing error loc here
means an anomaly, so we stop *)
let err_range = last_tok in
let parse_diags = [ Diags.make err_range 1 msg ] in
Expand Down Expand Up @@ -828,6 +828,8 @@ let process_and_parse ~io ~target ~uri ~version doc last_tok doc_handle =
| Interrupted last_tok -> set_completion ~completed:(Stopped last_tok) doc
| Stop (completed, node) ->
let doc = add_node ~node doc in
(* See #445 *)
report_progress ~io ~doc (Completion.range completed);
set_completion ~completed doc
| Continue { state; last_tok; node } ->
let n_errors = CList.count Lang.Diagnostic.is_error node.Node.diags in
Expand Down
Loading