diff --git a/semantic-source/src/Source/Source.hs b/semantic-source/src/Source/Source.hs index 9724a8f5f..52fde3510 100644 --- a/semantic-source/src/Source/Source.hs +++ b/semantic-source/src/Source/Source.hs @@ -75,7 +75,7 @@ totalRange = Range 0 . B.length . bytes -- | Return a 'Span' that covers the entire text. totalSpan :: Source -> Span -totalSpan source = Span lowerBound (Pos (Prelude.length ranges) (succ (end lastRange - start lastRange))) where +totalSpan source = Span (Pos 1 1) (Pos (Prelude.length ranges) (succ (end lastRange - start lastRange))) where ranges = lineRanges source lastRange = fromMaybe lowerBound (getLast (foldMap (Last . Just) ranges)) diff --git a/semantic-source/src/Source/Span.hs b/semantic-source/src/Source/Span.hs index d71553af6..7d15bce87 100644 --- a/semantic-source/src/Source/Span.hs +++ b/semantic-source/src/Source/Span.hs @@ -18,7 +18,6 @@ import Control.DeepSeq (NFData) import Data.Aeson ((.:), (.=)) import qualified Data.Aeson as A import Data.Hashable (Hashable) -import Data.Semilattice.Lower (Lower (..)) import GHC.Generics (Generic) import GHC.Stack (SrcLoc (..)) @@ -46,10 +45,6 @@ instance A.FromJSON Span where <$> o .: "start" <*> o .: "end" -instance Lower Span where - lowerBound = Span lowerBound lowerBound - - -- | Construct a Span with a given value for both its start and end positions. point :: Pos -> Span point p = Span p p @@ -83,10 +78,6 @@ instance A.FromJSON Pos where [ line, col ] <- A.parseJSON arr pure $ Pos line col -instance Lower Pos where - lowerBound = Pos 1 1 - - line_, column_ :: Lens' Pos Int line_ = lens line (\p l -> p { line = l }) column_ = lens column (\p l -> p { column = l })