1
1
mirror of https://github.com/github/semantic.git synced 2024-11-29 11:02:26 +03:00

Use sets instead of lists for inclusion.

This commit is contained in:
Rob Rix 2019-09-18 18:45:55 -04:00
parent 56cd54f98f
commit 1ff74600ce
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7
2 changed files with 6 additions and 4 deletions

View File

@ -33,6 +33,7 @@ library
aeson ^>= 1.4.2.0
, base >= 4.12 && < 5
, bytestring ^>= 0.10.8.2
, containers ^>= 0.6.0.1
, fused-effects ^>= 0.5
, text ^>= 1.2.3.1
, tree-sitter == 0.3.0.0

View File

@ -10,6 +10,7 @@ import Data.Aeson as A
import Data.Blob
import Data.Monoid (Endo(..))
import Data.Location
import qualified Data.Set as Set
import Data.Text (Text)
import GHC.Generics
import qualified TreeSitter.Python.AST as Python
@ -32,7 +33,7 @@ newtype Python a = Python { getPython :: Python.Module a }
type ContextToken = (Text, Maybe Range)
runTagging :: Blob -> [Text] -> Python Location -> [Tag]
runTagging :: Blob -> Set.Set Text -> Python Location -> [Tag]
runTagging blob symbolsToSummarize
= ($ [])
. appEndo
@ -48,7 +49,7 @@ class ToTag t where
:: ( Carrier sig m
, Member (Reader Blob) sig
, Member (Reader [ContextToken]) sig
, Member (Reader [Text]) sig
, Member (Reader (Set.Set Text)) sig
)
=> t Location
-> m (Endo [Tag])
@ -62,7 +63,7 @@ class ToTagBy (strategy :: Strategy) t where
:: ( Carrier sig m
, Member (Reader Blob) sig
, Member (Reader [ContextToken]) sig
, Member (Reader [Text]) sig
, Member (Reader (Set.Set Text)) sig
)
=> t Location
-> m (Endo [Tag])
@ -87,7 +88,7 @@ class GToTag t where
:: ( Carrier sig m
, Member (Reader Blob) sig
, Member (Reader [ContextToken]) sig
, Member (Reader [Text]) sig
, Member (Reader (Set.Set Text)) sig
)
=> t Location
-> m (Endo [Tag])