haskell/haskell-language-server

Unload module from GHC session after a source file is renamed/moved/deleted

Opened this issue · 4 comments

Steps to repro:

  1. Create a project with two modules:
module Numeric where 
-- shadows the Numeric module in base
module A where
import Numeric (showInt) -- error: Numeric doesn't export showInt
  1. Delete the Numeric module
  2. A still refuses to typecheck as it doesn't see the real Numeric module

Diagnostics may need to be cleaned forcefully as well

Cleaning diagnostics should be done by garbage collection, so I think that's a separate issue. Note that the DAML IDE has garbage collection, but it hasn't yet been ported over.

Cleaning diagnostics should be done by garbage collection, so I think that's a separate issue

That issue would be #713

@wz1000 commented in the related issue, originally in hls:

Another issue is that the knownFiles introduced in haskell/ghcide#688 (merged in the branch ghcide used by hls) are a grow only set. To fix this, known files would probably have to be stored per component, so the set of files for each component can be updated individually.