-
Notifications
You must be signed in to change notification settings - Fork 122
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
Clear diagnostics for non-project files #271
Conversation
MacOS tests are failing for me locally but even with master -- not sure why. |
That's the bigger problem I think. When a document is closed we should republish the diagnostics without the closed file. |
I am not sure about this because having errors for project files to persist after they are closed:
|
The spec recommendation certainly makes sense if diagnostics are project wide, but our diagnostics are local to a single compilation unit. Let's consider what it would take for the user to clear out stale diagnostics: he would have to open every stale file and recompute them. That seems like a poor experience to me, and that is not how merlin did diagnostics for vim and emacs in its traditional front end. We will have project wide diagnostics in the future, but they will come from dune rather than merlin. In this case, it would make sense to keep them lingering around. That's because we'll know for sure they're applicable, and we'll be able to clean them up automatically once they are stale. |
Okay, let's clear diagnostics on close. Someone will probably create an
issue if they miss the previous behavior for project files.
Thanks!
…On Sun, 25 Oct 2020 at 21:07, Rudi Grinberg ***@***.***> wrote:
The spec recommendation certainly makes sense if diagnostics are project
wide, but our diagnostics are local to a single compilation unit. Let's
consider what it would take for the user to clear out stale diagnostics: he
would have to open every stale file and recompute them. That seems like a
poor experience to me, and that is not how merlin did diagnostics for vim
and emacs in its traditional front end.
We will have project wide diagnostics in the future, but they will come
from dune rather than merlin. In this case, it would make sense to keep
them lingering around. That's because we'll know for sure they're
applicable, and we'll be able to clean them up automatically once they are
stale.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#271 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD4YR65WKL7LRFPYXZIPZ63SMSARXANCNFSM4S5U4RIQ>
.
|
Signed-off-by: Rudi Grinberg <[email protected]>
There's no need to execute LSP related stuff in it Signed-off-by: Rudi Grinberg <[email protected]>
I must have misread the diff in the web UI. Code looks good. Some minor adjustments:
|
CHANGES: ## Features - Add keyword completion - Add go to declaration functionality to jump to a value's specification in a .mli file (ocaml/ocaml-lsp#294) ## Fixes - ocaml/ocaml-lsp#245: correctly use mutexes on OpenBSD (ocaml/ocaml-lsp#264) - ocaml/ocaml-lsp#268: Do not use vendored libraries when building the lsp package (ocaml/ocaml-lsp#260) - ocaml/ocaml-lsp#271: Clear diagnostics when files are closed - Disable non-prefix completion. There's no reliably way to trigger it and it can be slow.
When one opens a source file of a library they use (with go-to-definition, for example), merlin reports errors in that file. When the file is closed, the errors remain in the problems pane (see the screenshot). This PR clears the reported errors when such a non-project source is closed. I define non-project source file as a file with URI that contains ".opam", "_opam", or "_esy".