Skip to content

Commit 9ceea5b

Browse files
committed
Use ghcide wip/multi-rebased rebased on current master
1 parent 7822586 commit 9ceea5b

File tree

6 files changed

+17
-13
lines changed

6 files changed

+17
-13
lines changed

cabal.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ package ghcide
1818

1919
write-ghc-environment-files: never
2020

21-
index-state: 2020-03-03T21:14:55Z
21+
index-state: 2020-03-24T21:15:10Z

exe/Main.hs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,10 @@ main = do
211211
ide <- initialise def mainRule (pure $ IdInt 0) (showEvent lock) (logger Info) debouncer (defaultIdeOptions $ loadSession dir) vfs
212212

213213
putStrLn "\nStep 4/6: Type checking the files"
214-
setFilesOfInterest ide $ HashSet.fromList $ map toNormalizedFilePath files
215-
_ <- runActionSync ide $ uses TypeCheck (map toNormalizedFilePath files)
216-
-- results <- runActionSync ide $ use TypeCheck $ toNormalizedFilePath "src/Development/IDE/Core/Rules.hs"
217-
-- results <- runActionSync ide $ use TypeCheck $ toNormalizedFilePath "exe/Main.hs"
214+
setFilesOfInterest ide $ HashSet.fromList $ map toNormalizedFilePath' files
215+
_ <- runActionSync ide $ uses TypeCheck (map toNormalizedFilePath' files)
216+
-- results <- runActionSync ide $ use TypeCheck $ toNormalizedFilePath' "src/Development/IDE/Core/Rules.hs"
217+
-- results <- runActionSync ide $ use TypeCheck $ toNormalizedFilePath' "exe/Main.hs"
218218
return ()
219219

220220
expandFiles :: [FilePath] -> IO [FilePath]
@@ -238,7 +238,7 @@ kick = do
238238
-- | Print an LSP event.
239239
showEvent :: Lock -> FromServerMessage -> IO ()
240240
showEvent _ (EventFileDiagnostics _ []) = return ()
241-
showEvent lock (EventFileDiagnostics (toNormalizedFilePath -> file) diags) =
241+
showEvent lock (EventFileDiagnostics (toNormalizedFilePath' -> file) diags) =
242242
withLock lock $ T.putStrLn $ showDiagnosticsColored $ map (file,ShowDiag,) diags
243243
showEvent lock e = withLock lock $ print e
244244

@@ -271,10 +271,10 @@ targetToFile :: [FilePath] -> TargetId -> IO [NormalizedFilePath]
271271
targetToFile is (TargetModule mod) = do
272272
let fps = [i </> (moduleNameSlashes mod) -<.> ext | ext <- exts, i <- is ]
273273
exts = ["hs", "hs-boot", "lhs"]
274-
mapM (fmap (toNormalizedFilePath) . canonicalizePath) fps
274+
mapM (fmap (toNormalizedFilePath') . canonicalizePath) fps
275275
targetToFile _ (TargetFile f _) = do
276276
f' <- canonicalizePath f
277-
return [(toNormalizedFilePath f')]
277+
return [(toNormalizedFilePath' f')]
278278

279279
setNameCache :: IORef NameCache -> HscEnv -> HscEnv
280280
setNameCache nc hsc = hsc { hsc_NC = nc }
@@ -395,7 +395,7 @@ loadSession dir = liftIO $ do
395395
let v = fromMaybe HM.empty mv
396396
cfp <- liftIO $ canonicalizePath file
397397
-- We sort so exact matches come first.
398-
case HM.lookup (toNormalizedFilePath cfp) v of
398+
case HM.lookup (toNormalizedFilePath' cfp) v of
399399
Just opts -> do
400400
--putStrLn $ "Cached component of " <> show file
401401
pure opts

haskell-language-server.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ library
6262
, ghcide >= 0.1
6363
, gitrev
6464
, hashable
65-
, haskell-lsp == 0.20.*
65+
, haskell-lsp == 0.21.*
6666
, hie-bios >= 0.4
6767
, hslogger
6868
, lens

src/Ide/Plugin/Example.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ mkDiag file diagSource sev loc msg = (file, D.ShowDiag,)
9999
, _source = Just diagSource
100100
, _message = msg
101101
, _code = Nothing
102+
, _tags = Nothing
102103
, _relatedInformation = Nothing
103104
}
104105

@@ -212,12 +213,13 @@ completion :: CompletionProvider
212213
completion _ide (CompletionParams _doc _pos _mctxt _mt)
213214
= pure $ Right $ Completions $ List [r]
214215
where
215-
r = CompletionItem label kind detail documentation deprecated preselect
216+
r = CompletionItem label kind tags detail documentation deprecated preselect
216217
sortText filterText insertText insertTextFormat
217218
textEdit additionalTextEdits commitCharacters
218219
command xd
219220
label = "Example completion"
220221
kind = Nothing
222+
tags = List []
221223
detail = Nothing
222224
documentation = Nothing
223225
deprecated = Nothing

src/Ide/Plugin/Example2.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ mkDiag file diagSource sev loc msg = (file, D.ShowDiag,)
9999
, _source = Just diagSource
100100
, _message = msg
101101
, _code = Nothing
102+
, _tags = Nothing
102103
, _relatedInformation = Nothing
103104
}
104105

@@ -209,12 +210,13 @@ completion :: CompletionProvider
209210
completion _ide (CompletionParams _doc _pos _mctxt _mt)
210211
= pure $ Right $ Completions $ List [r]
211212
where
212-
r = CompletionItem label kind detail documentation deprecated preselect
213+
r = CompletionItem label kind tags detail documentation deprecated preselect
213214
sortText filterText insertText insertTextFormat
214215
textEdit additionalTextEdits commitCharacters
215216
command xd
216217
label = "Example2 completion"
217218
kind = Nothing
219+
tags = List []
218220
detail = Nothing
219221
documentation = Nothing
220222
deprecated = Nothing

0 commit comments

Comments
 (0)