@@ -55,41 +55,41 @@ whenUriFile uri act = whenJust (LSP.uriToFilePath uri) $ act . toNormalizedFileP
55
55
descriptor :: Recorder (WithPriority Log ) -> PluginId -> PluginDescriptor IdeState
56
56
descriptor recorder plId = (defaultPluginDescriptor plId) { pluginNotificationHandlers = mconcat
57
57
[ mkPluginNotificationHandler LSP. STextDocumentDidOpen $
58
- \ ide _ (DidOpenTextDocumentParams TextDocumentItem {_uri,_version}) -> liftIO $ do
58
+ \ ide vfs _ (DidOpenTextDocumentParams TextDocumentItem {_uri,_version}) -> liftIO $ do
59
59
atomically $ updatePositionMapping ide (VersionedTextDocumentIdentifier _uri (Just _version)) (List [] )
60
60
whenUriFile _uri $ \ file -> do
61
61
-- We don't know if the file actually exists, or if the contents match those on disk
62
62
-- For example, vscode restores previously unsaved contents on open
63
63
addFileOfInterest ide file Modified {firstOpen= True }
64
- setFileModified (cmapWithPrio LogFileStore recorder) ide False file
64
+ setFileModified (cmapWithPrio LogFileStore recorder) ( VFSModified vfs) ide False file
65
65
logDebug (ideLogger ide) $ " Opened text document: " <> getUri _uri
66
66
67
67
, mkPluginNotificationHandler LSP. STextDocumentDidChange $
68
- \ ide _ (DidChangeTextDocumentParams identifier@ VersionedTextDocumentIdentifier {_uri} changes) -> liftIO $ do
68
+ \ ide vfs _ (DidChangeTextDocumentParams identifier@ VersionedTextDocumentIdentifier {_uri} changes) -> liftIO $ do
69
69
atomically $ updatePositionMapping ide identifier changes
70
70
whenUriFile _uri $ \ file -> do
71
71
addFileOfInterest ide file Modified {firstOpen= False }
72
- setFileModified (cmapWithPrio LogFileStore recorder) ide False file
72
+ setFileModified (cmapWithPrio LogFileStore recorder) ( VFSModified vfs) ide False file
73
73
logDebug (ideLogger ide) $ " Modified text document: " <> getUri _uri
74
74
75
75
, mkPluginNotificationHandler LSP. STextDocumentDidSave $
76
- \ ide _ (DidSaveTextDocumentParams TextDocumentIdentifier {_uri} _) -> liftIO $ do
76
+ \ ide vfs _ (DidSaveTextDocumentParams TextDocumentIdentifier {_uri} _) -> liftIO $ do
77
77
whenUriFile _uri $ \ file -> do
78
78
addFileOfInterest ide file OnDisk
79
- setFileModified (cmapWithPrio LogFileStore recorder) ide True file
79
+ setFileModified (cmapWithPrio LogFileStore recorder) ( VFSModified vfs) ide True file
80
80
logDebug (ideLogger ide) $ " Saved text document: " <> getUri _uri
81
81
82
82
, mkPluginNotificationHandler LSP. STextDocumentDidClose $
83
- \ ide _ (DidCloseTextDocumentParams TextDocumentIdentifier {_uri}) -> liftIO $ do
83
+ \ ide vfs _ (DidCloseTextDocumentParams TextDocumentIdentifier {_uri}) -> liftIO $ do
84
84
whenUriFile _uri $ \ file -> do
85
85
deleteFileOfInterest ide file
86
86
let msg = " Closed text document: " <> getUri _uri
87
87
scheduleGarbageCollection ide
88
- setSomethingModified ide [] $ Text. unpack msg
88
+ setSomethingModified ( VFSModified vfs) ide [] $ Text. unpack msg
89
89
logDebug (ideLogger ide) msg
90
90
91
91
, mkPluginNotificationHandler LSP. SWorkspaceDidChangeWatchedFiles $
92
- \ ide _ (DidChangeWatchedFilesParams (List fileEvents)) -> liftIO $ do
92
+ \ ide vfs _ (DidChangeWatchedFilesParams (List fileEvents)) -> liftIO $ do
93
93
-- See Note [File existence cache and LSP file watchers] which explains why we get these notifications and
94
94
-- what we do with them
95
95
-- filter out files of interest, since we already know all about those
@@ -106,24 +106,24 @@ descriptor recorder plId = (defaultPluginDescriptor plId) { pluginNotificationHa
106
106
logDebug (ideLogger ide) $ " Watched file events: " <> Text. pack msg
107
107
modifyFileExists ide fileEvents'
108
108
resetFileStore ide fileEvents'
109
- setSomethingModified ide [] msg
109
+ setSomethingModified ( VFSModified vfs) ide [] msg
110
110
111
111
, mkPluginNotificationHandler LSP. SWorkspaceDidChangeWorkspaceFolders $
112
- \ ide _ (DidChangeWorkspaceFoldersParams events) -> liftIO $ do
112
+ \ ide _ _ (DidChangeWorkspaceFoldersParams events) -> liftIO $ do
113
113
let add = S. union
114
114
substract = flip S. difference
115
115
modifyWorkspaceFolders ide
116
116
$ add (foldMap (S. singleton . parseWorkspaceFolder) (_added events))
117
117
. substract (foldMap (S. singleton . parseWorkspaceFolder) (_removed events))
118
118
119
119
, mkPluginNotificationHandler LSP. SWorkspaceDidChangeConfiguration $
120
- \ ide _ (DidChangeConfigurationParams cfg) -> liftIO $ do
120
+ \ ide vfs _ (DidChangeConfigurationParams cfg) -> liftIO $ do
121
121
let msg = Text. pack $ show cfg
122
122
logDebug (ideLogger ide) $ " Configuration changed: " <> msg
123
123
modifyClientSettings ide (const $ Just cfg)
124
- setSomethingModified ide [toKey GetClientSettings emptyFilePath] " config change"
124
+ setSomethingModified ( VFSModified vfs) ide [toKey GetClientSettings emptyFilePath] " config change"
125
125
126
- , mkPluginNotificationHandler LSP. SInitialized $ \ ide _ _ -> do
126
+ , mkPluginNotificationHandler LSP. SInitialized $ \ ide _ _ _ -> do
127
127
--------- Initialize Shake session --------------------------------------------------------------------
128
128
liftIO $ shakeSessionInit (cmapWithPrio LogShake recorder) ide
129
129
0 commit comments