+ ctx <- lift $ lift Reader.ask
+
+
+ -- if its not open, open it
+ unless ((docId ^. uri) `Map.member` oldVFS) $ do
+ let fp = fromJust $ uriToFilePath (docId ^. uri)
+ contents <- liftIO $ T.readFile fp
+ let item = TextDocumentItem (filePathToUri fp) "" 0 contents
+ msg = NotificationMessage "2.0" TextDocumentDidOpen (DidOpenTextDocumentParams item)
+ liftIO $ B.hPut (serverIn ctx) $ addHeader (encode msg)
+
+ oldVFS <- vfs <$> lift State.get
+ newVFS <- liftIO $ openVFS oldVFS msg
+ lift $ State.modify (\s -> s { vfs = newVFS })
+
+ -- we might have updated it above
+ oldVFS <- vfs <$> lift State.get
+