packages feed

haskell-lsp-types 0.12.1.0 → 0.13.0.0

raw patch · 3 files changed

+17/−8 lines, 3 files

Files

haskell-lsp-types.cabal view
@@ -1,5 +1,5 @@ name:                haskell-lsp-types-version:             0.12.1.0+version:             0.13.0.0 synopsis:            Haskell library for the Microsoft Language Server Protocol, data types  description:         An implementation of the types to allow language implementors to
src/Language/Haskell/LSP/Types/MarkupContent.hs view
@@ -128,7 +128,7 @@ -- | Create a 'MarkupContent' containing a quoted language string only. markedUpContent :: Text -> Text -> MarkupContent markedUpContent lang quote- = MarkupContent MkMarkdown ("```" <> lang <> "\n" <> quote <> "\n```\n")+ = MarkupContent MkMarkdown ("\n```" <> lang <> "\n" <> quote <> "\n```\n")  -- --------------------------------------------------------------------- 
src/Language/Haskell/LSP/Types/Uri.hs view
@@ -1,5 +1,6 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE RecordWildCards #-} module Language.Haskell.LSP.Types.Uri where  import           Control.DeepSeq@@ -8,7 +9,7 @@ import           Data.Text                                  (Text) import qualified Data.Text                                  as T import           GHC.Generics-import           Network.URI+import           Network.URI hiding (authority) import qualified System.FilePath.Posix                      as FPP import qualified System.FilePath.Windows                    as FPW import qualified System.Info@@ -31,13 +32,21 @@  platformAwareUriToFilePath :: String -> Uri -> Maybe FilePath platformAwareUriToFilePath systemOS (Uri uri) = do-  parsedUri <- parseURI $ T.unpack uri-  if uriScheme parsedUri == fileScheme-    then return $ (platformAdjustFromUriPath systemOS . unEscapeString . uriPath) parsedUri+  URI{..} <- parseURI $ T.unpack uri+  if uriScheme == fileScheme+    then return $+      platformAdjustFromUriPath systemOS (uriRegName <$> uriAuthority) $ unEscapeString uriPath     else Nothing -platformAdjustFromUriPath :: SystemOS -> String -> FilePath-platformAdjustFromUriPath systemOS srcPath =+-- | We pull in the authority because in relative file paths the Uri likes to put everything before the slash+--   into the authority field+platformAdjustFromUriPath ::+    SystemOS ->+    Maybe String -> -- ^ authority+    String -> -- ^ path+    FilePath+platformAdjustFromUriPath systemOS authority srcPath =+  (maybe id (++) authority) $   if systemOS /= windowsOS || null srcPath then srcPath     else let       firstSegment:rest = (FPP.splitDirectories . tail) srcPath  -- Drop leading '/' for absolute Windows paths