1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 08:54:07 +03:00

Define a ToTags instance for JSON.

There’s no tags to generate for JSON (without e.g. a schema or something for the data), but implementing the instance allows us to avoid having to customize the list of parsers for tagging.
This commit is contained in:
Rob Rix 2019-10-07 11:04:37 -04:00
parent ed17dcbeea
commit 2d74113a9d
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7
2 changed files with 5 additions and 0 deletions

View File

@ -23,6 +23,7 @@ library
Language.JSON
build-depends:
base >= 4.12 && < 5
, semantic-tags ^>= 0.0
, tree-sitter ^>= 0.4
, tree-sitter-json ^>= 0.3
hs-source-dirs: src

View File

@ -3,6 +3,7 @@ module Language.JSON
( Term(..)
) where
import qualified Tags.Tagging.Precise as Tags
import qualified TreeSitter.JSON.AST as JSON
import qualified TreeSitter.Unmarshal as TS
@ -10,3 +11,6 @@ newtype Term a = Term { getTerm :: JSON.Document a }
instance TS.Unmarshal Term where
unmarshalNode node = Term <$> TS.unmarshalNode node
instance Tags.ToTags Term where
tags _ _ = []