1
1
mirror of https://github.com/github/semantic.git synced 2024-11-22 23:29:37 +03:00

Clean up semantic-tags cabal file

This commit is contained in:
Timothy Clem 2020-07-07 07:27:16 -07:00
parent f8d2a2d617
commit b5c810aff5
3 changed files with 7 additions and 12 deletions

View File

@ -48,8 +48,7 @@ library
, semantic-source ^>= 0.1.0
, semantic-proto ^>= 0
, text ^>= 1.2.3.1
, containers
, deepseq
, containers ^>= 0.6.0.1
hs-source-dirs: src
test-suite test
@ -58,11 +57,11 @@ test-suite test
hs-source-dirs: test
main-is: Test.hs
build-depends:
base
base >= 4.13 && < 5
, hedgehog ^>= 1
, semantic-source ^>= 0.1.0
, semantic-tags
, semantic-source
, tasty >= 1.2 && <2
, tasty-hedgehog ^>= 1.0.0.1
, tasty-hunit >= 0.10 && <1
, text
, text ^>= 1.2.3.1

View File

@ -4,16 +4,15 @@ module Tags.Tag (Tag (..), UTF16CodeUnitSpan(..), OneIndexedSpan(..)) where
import Data.Text (Text)
import qualified Proto.Semantic as P
import Source.Loc
import Control.DeepSeq
-- | A 0-indxed Span where the column offset units are utf-16 code units (2
-- bytes), suitable for the LSP (Language Server Protocol) specification.
newtype UTF16CodeUnitSpan = UTF16CodeUnitSpan { unUTF16CodeUnitSpan :: Span }
deriving (Eq, Show, NFData)
deriving (Eq, Show)
-- A 1-indexed Span where the units are bytes.
newtype OneIndexedSpan = OneIndexedSpan { unOneIndexedSpan :: Span }
deriving (Eq, Show, NFData)
deriving (Eq, Show)
data Tag
= Tag

View File

@ -1,7 +1,5 @@
{-# LANGUAGE GeneralisedNewtypeDeriving #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE TypeApplications #-}
module Tags.Tagging.Precise
( Tags
@ -29,7 +27,6 @@ import Data.Text (Text)
import qualified Data.Text as Text
import qualified Proto.Semantic as P
import Source.Loc
import Control.DeepSeq
import Source.Source as Source
import Source.Span (Pos (..), end, start)
import Tags.Tag
@ -76,7 +73,7 @@ type LineCache = (Source, IntMap.IntMap UTF16CUCount)
-- | LineIndices is a cache of row to LineCache
newtype LineIndices = LineIndices { unLineIndices :: Map.Map Int LineCache }
deriving (Eq, Show, NFData)
deriving (Eq, Show)
-- | Takes a Loc (where the span's column offset is measured in bytes) and
-- returns two Spans: A 1-indexed span LSP friendly span (where column offset is