File tree 2 files changed +12
-9
lines changed
2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -156,10 +156,10 @@ experiments =
156
156
forM_ identifierP $ \ p -> changeDoc doc [charEdit p]
157
157
)
158
158
( \ 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 "
161
161
sendNotification SWorkspaceDidChangeWatchedFiles $ DidChangeWatchedFilesParams $
162
- List [ FileEvent (filePathToUri " hie.yaml " ) FcChanged ]
162
+ List [ FileEvent hieYamlUri FcChanged ]
163
163
forM_ docs $ \ DocumentPositions {.. } ->
164
164
changeDoc doc [charEdit stringLiteralP]
165
165
waitForProgressDone
@@ -171,10 +171,10 @@ experiments =
171
171
bench
172
172
" hover after cradle edit"
173
173
(\ 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 "
176
176
sendNotification SWorkspaceDidChangeWatchedFiles $ DidChangeWatchedFilesParams $
177
- List [ FileEvent (filePathToUri " hie.yaml " ) FcChanged ]
177
+ List [ FileEvent hieYamlUri FcChanged ]
178
178
flip allWithIdentifierPos docs $ \ DocumentPositions {.. } -> isJust <$> getHover doc (fromJust identifierP)
179
179
),
180
180
---------------------------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ import qualified Language.LSP.Server as LSP
138
138
import Language.LSP.Types (SMethod (SCustomMethod ))
139
139
import Language.LSP.VFS
140
140
import Module
141
- import System.Directory (canonicalizePath )
141
+ import System.Directory (canonicalizePath , makeAbsolute )
142
142
import TcRnMonad (tcg_dependent_files )
143
143
144
144
import Control.Applicative
@@ -674,9 +674,12 @@ loadGhcSession = do
674
674
675
675
-- add the deps to the Shake graph
676
676
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
678
680
itExists <- getFileExists nfp
679
- when itExists $ void $ use_ GetModificationTime nfp
681
+ when itExists $ void $ do
682
+ use_ GetModificationTime nfp
680
683
mapM_ addDependency deps
681
684
682
685
opts <- getIdeOptions
You can’t perform that action at this time.
0 commit comments