Skip to content
This repository has been archived by the owner on Jan 2, 2021. It is now read-only.

Fix diagnostics update bug #959

Merged
merged 13 commits into from
Dec 21, 2020
Merged

Fix diagnostics update bug #959

merged 13 commits into from
Dec 21, 2020

Commits on Dec 20, 2020

  1. Preventively switch to uninterruptible mask in withMVar'

    withMVar' is used to update the shakeSession var and it's crucial that the
    third argument is not interrupted.
    
    'mask' can still be interrupted for I/O actions and, while we were careful to
    ensure none was used, if it ever breaks it will lead to very hard to debug
    problems.
    pepeiborra committed Dec 20, 2020
    Configuration menu
    Copy the full SHA
    87d9c06 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a5b96a8 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f1f00b4 View commit details
    Browse the repository at this point in the history
  4. expectCurrentDiagnostics

    pepeiborra committed Dec 20, 2020
    Configuration menu
    Copy the full SHA
    3ab366d View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    34832be View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    0b9d0ca View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    199d9e5 View commit details
    Browse the repository at this point in the history
  8. GetModSummaryWithoutTimestamps - remove StringBuffer

    Since the contents of the buffer are not tracked by the fingerprint.
    pepeiborra committed Dec 20, 2020
    Configuration menu
    Copy the full SHA
    6588302 View commit details
    Browse the repository at this point in the history
  9. Fix diagnostics bug

    Given a FOI F with non null typechecking diagnostics D, imagine the following scenario:
    
    1. An edit notification for F is received, creating a new version
    2. GetModTime is executed, producing 0 diagnostics.
      2.1 updateFileDiagnostics is called
      2.2 setStageDiagnostics is called
      2.3 LSP.updateDiagnostics is called with a new version, resetting all the
      diagnostics for F
      2.4 newDiags=[] in updateFileDiagnostics, which is different from D (the last
      published diagnostics), which enqueues a new publishDiagnostics [] in the
      Debouncer
    3. An edit notification for F is received before typechecking has a chance to
    run which undoes the previous edit
    4. The debouncer publishes the empty set of diagnostics after waiting 0.1s
    5. GetFileContents runs and since the contents of the file haven't changed since
    the last time it ran, early cutoff skips everything donwstream
    
    Since TypeCheck is skipped, the empty set of diagnostics stays published until
    another edit comes.
    
    The goal of this change is to prevent setStageDiagnostics from losing
    diagnostics from other stages. To achieve this, we recover the old diagnostics
    for all stages and merge them with the new stage.
    pepeiborra committed Dec 20, 2020
    Configuration menu
    Copy the full SHA
    f7f0bfb View commit details
    Browse the repository at this point in the history
  10. Fix hlint

    pepeiborra committed Dec 20, 2020
    Configuration menu
    Copy the full SHA
    7936e66 View commit details
    Browse the repository at this point in the history
  11. Use Map.insert for clarity

    pepeiborra committed Dec 20, 2020
    Configuration menu
    Copy the full SHA
    aad22e6 View commit details
    Browse the repository at this point in the history
  12. Fix redundant imports

    pepeiborra committed Dec 20, 2020
    Configuration menu
    Copy the full SHA
    b467e37 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    d72b032 View commit details
    Browse the repository at this point in the history