packages feed

hsdev 0.1.5.5 → 0.1.5.6

raw patch · 3 files changed

+15/−11 lines, 3 filesdep ~ghc-moddep ~hlintdep ~simple-log

Dependency ranges changed: ghc-mod, hlint, simple-log

Files

hsdev.cabal view
@@ -2,7 +2,7 @@ --  see http://haskell.org/cabal/users-guide/
 
 name:                hsdev
-version:             0.1.5.5
+version:             0.1.5.6
 synopsis:            Haskell development library and tool with support of autocompletion, symbol info, go to declaration, find references etc.
 description:
   Haskell development library and tool with support of autocompletion, symbol info, go to declaration, find references, hayoo search etc.
@@ -109,7 +109,7 @@     filepath >= 1.4.0,
     fsnotify >= 0.2.1,
     ghc >= 7.10.0 && < 7.11.0,
-    ghc-mod >= 5.4.0.0 && < 5.5.0.0,
+    ghc-mod >= 5.5.0.0 && < 5.6.0.0,
     ghc-paths >= 0.1.0,
     ghc-syb-utils >= 0.2.3,
     haddock-api >= 2.16.0 && < 2.17.0,
@@ -129,7 +129,7 @@     process >= 1.2.0,
     regex-pcre-builtin >= 0.94,
     scientific >= 0.3,
-    simple-log >= 0.3.3,
+    simple-log >= 0.3.4,
     syb >= 0.5.1,
     template-haskell,
     text >= 1.2.0,
src/HsDev/Tools/GhcMod.hs view
@@ -63,7 +63,7 @@ 
 list :: [String] -> Cabal -> ExceptT String IO [ModuleLocation]
 list opts cabal = runGhcMod (GhcMod.defaultOptions { GhcMod.optGhcUserOptions = opts }) $ do
-	ms <- (map splitPackage . lines) <$> GhcMod.modules
+	ms <- (map splitPackage . lines) <$> GhcMod.modules True
 	return [CabalModule cabal (readMaybe p) m | (m, p) <- ms]
 	where
 		splitPackage :: String -> (String, String)
@@ -71,8 +71,12 @@ 
 browse :: [String] -> Cabal -> String -> Maybe ModulePackage -> ExceptT String IO InspectedModule
 browse opts cabal mname mpackage = inspect thisLoc (return $ browseInspection opts) $ runGhcMod
-	(GhcMod.defaultOptions { GhcMod.optDetailed = True, GhcMod.optQualified = True, GhcMod.optGhcUserOptions = packageOpt mpackage ++ opts }) $ do
-		ds <- (mapMaybe parseDecl . lines) <$> GhcMod.browse mpkgname
+	(GhcMod.defaultOptions { GhcMod.optGhcUserOptions = packageOpt mpackage ++ opts }) $ do
+		ds <- (mapMaybe parseDecl . lines) <$> GhcMod.browse
+			(GhcMod.defaultBrowseOpts {
+				GhcMod.optBrowseDetailed = True,
+				GhcMod.optBrowseQualified = True })
+			mpkgname
 		return Module {
 			_moduleName = fromString mname,
 			_moduleDocs = Nothing,
@@ -226,9 +230,8 @@ lint :: [String] -> FilePath -> GhcModT IO [Note OutputMessage]
 lint opts file = do
 	cts <- liftIO $ readFileUtf8 file
-	withOptions (\o -> o { GhcMod.optHlintOpts = opts }) $ do
-		res <- GhcMod.lint file
-		return $ map (recalcOutputMessageTabs [(file, cts)]) $ parseOutputMessages res
+	res <- GhcMod.lint (GhcMod.defaultLintOpts { GhcMod.optLintHlintOpts = opts }) file
+	return $ map (recalcOutputMessageTabs [(file, cts)]) $ parseOutputMessages res
 
 gmOut :: IO GhcMod.GhcModOut
 gmOut = do
@@ -246,7 +249,7 @@ 	out <- liftIO gmOut
 	cur <- liftIO getCurrentDirectory
 	liftIOErrors $ ExceptT $ liftM (left show . right fst . fst) $ flip runReaderT out $ GhcMod.unGmOutT $
-		GhcMod.withGhcModEnv cur opts $ \env ->
+		GhcMod.withGhcModEnv cur opts $ \(env, _) ->
 			GhcMod.runGhcModT' env GhcMod.defaultGhcModState act
 
 locateGhcModEnv :: FilePath -> IO (Either Project Cabal)
@@ -268,7 +271,7 @@ 			out <- gmOut
 			flip runReaderT out $
 				GhcMod.unGmOutT $
-				GhcMod.withGhcModEnv cur GhcMod.defaultOptions $ \env ->
+				GhcMod.withGhcModEnv cur GhcMod.defaultOptions $ \(env, _) ->
 					GhcMod.runGhcModT' env GhcMod.defaultGhcModState (act `catchError` (void . return))
 
 type WorkerMap = MVar (M.Map FilePath (Worker (GhcModT IO)))
src/HsDev/Tools/HLint.hs view
@@ -41,6 +41,7 @@ 	_noteRegion = Region (Position (srcSpanStartLine src) (srcSpanStartColumn src)) (Position (srcSpanEndLine src) (srcSpanEndColumn src)),
 	_noteLevel = Just $ case ideaSeverity idea of
 		HL.Ignore -> Hint
+		HL.Suggestion -> Hint
 		HL.Warning -> Warning
 		HL.Error -> Error,
 	_note = OutputMessage {