mirror of
https://github.com/haskell/haskell-language-server.git
synced 2024-11-10 15:14:48 +03:00
Move 'normalize' function to utils
This commit is contained in:
parent
460b4554f5
commit
bab2de6ca9
@ -12,6 +12,7 @@ import Language.Haskell.Brittany
|
||||
import Language.Haskell.LSP.Types as J
|
||||
import qualified Language.Haskell.LSP.Types.Lens as J
|
||||
import Ide.Plugin.Formatter
|
||||
import Ide.PluginUtils
|
||||
import Ide.Types
|
||||
|
||||
import System.FilePath
|
||||
@ -61,11 +62,6 @@ formatText confFile opts text =
|
||||
liftIO $ runBrittany tabSize confFile text
|
||||
where tabSize = opts ^. J.tabSize
|
||||
|
||||
-- | Extend to the line below and above to replace newline character.
|
||||
normalize :: Range -> Range
|
||||
normalize (Range (Position sl _) (Position el _)) =
|
||||
Range (Position sl 0) (Position (el + 1) 0)
|
||||
|
||||
-- | Recursively search in every directory of the given filepath for brittany.yaml.
|
||||
-- If no such file has been found, return Nothing.
|
||||
getConfFile :: NormalizedFilePath -> IO (Maybe FilePath)
|
||||
|
@ -90,8 +90,3 @@ provider _lf ideState typ contents fp _ = do
|
||||
#else
|
||||
provider _ _ _ _ = return $ Right [] -- NOP formatter
|
||||
#endif
|
||||
|
||||
-- | Extend to the line below and above to replace newline character.
|
||||
normalize :: Range -> Range
|
||||
normalize (Range (Position sl _) (Position el _)) =
|
||||
Range (Position sl 0) (Position (el + 1) 0)
|
||||
|
@ -10,6 +10,15 @@ import Language.Haskell.LSP.Types.Capabilities
|
||||
import qualified Language.Haskell.LSP.Types as J
|
||||
import Language.Haskell.LSP.Types
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
-- | Extend to the line below and above to replace newline character.
|
||||
normalize :: Range -> Range
|
||||
normalize (Range (Position sl _) (Position el _)) =
|
||||
Range (Position sl 0) (Position (el + 1) 0)
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
data WithDeletions = IncludeDeletions | SkipDeletions
|
||||
deriving Eq
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user