File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -156,10 +156,10 @@ experiments =
156156 forM_ identifierP $ \ p -> changeDoc doc [charEdit p]
157157 )
158158 ( \ docs -> do
159- Just hieYaml <- uriToFilePath <$> getDocUri " hie.yaml"
160- liftIO $ appendFile hieYaml " ##\n "
159+ hieYamlUri <- getDocUri " hie.yaml"
160+ liftIO $ appendFile (fromJust $ uriToFilePath hieYamlUri) " ##\n "
161161 sendNotification SWorkspaceDidChangeWatchedFiles $ DidChangeWatchedFilesParams $
162- List [ FileEvent (filePathToUri " hie.yaml " ) FcChanged ]
162+ List [ FileEvent hieYamlUri FcChanged ]
163163 forM_ docs $ \ DocumentPositions {.. } ->
164164 changeDoc doc [charEdit stringLiteralP]
165165 waitForProgressDone
@@ -171,10 +171,10 @@ experiments =
171171 bench
172172 " hover after cradle edit"
173173 (\ docs -> do
174- Just hieYaml <- uriToFilePath <$> getDocUri " hie.yaml"
175- liftIO $ appendFile hieYaml " ##\n "
174+ hieYamlUri <- getDocUri " hie.yaml"
175+ liftIO $ appendFile (fromJust $ uriToFilePath hieYamlUri) " ##\n "
176176 sendNotification SWorkspaceDidChangeWatchedFiles $ DidChangeWatchedFilesParams $
177- List [ FileEvent (filePathToUri " hie.yaml " ) FcChanged ]
177+ List [ FileEvent hieYamlUri FcChanged ]
178178 flip allWithIdentifierPos docs $ \ DocumentPositions {.. } -> isJust <$> getHover doc (fromJust identifierP)
179179 ),
180180 ---------------------------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ import qualified Language.LSP.Server as LSP
138138import Language.LSP.Types (SMethod (SCustomMethod ))
139139import Language.LSP.VFS
140140import Module
141- import System.Directory (canonicalizePath )
141+ import System.Directory (canonicalizePath , makeAbsolute )
142142import TcRnMonad (tcg_dependent_files )
143143
144144import Control.Applicative
@@ -674,9 +674,12 @@ loadGhcSession = do
674674
675675 -- add the deps to the Shake graph
676676 let addDependency fp = do
677- let nfp = toNormalizedFilePath' fp
677+ -- VSCode uses absolute paths in its filewatch notifications
678+ afp <- liftIO $ makeAbsolute fp
679+ let nfp = toNormalizedFilePath' afp
678680 itExists <- getFileExists nfp
679- when itExists $ void $ use_ GetModificationTime nfp
681+ when itExists $ void $ do
682+ use_ GetModificationTime nfp
680683 mapM_ addDependency deps
681684
682685 opts <- getIdeOptions
You can’t perform that action at this time.
0 commit comments