{- ORMOLU_DISABLE -}
{- HLINT ignore -}
-- THIS IS A GENERATED FILE, DO NOT EDIT

{-# OPTIONS_GHC -Wno-unused-imports #-}
{-# OPTIONS_GHC -Wno-unused-matches #-}
{-# OPTIONS_GHC -Wno-deprecations #-}
module Language.LSP.Protocol.Internal.Types.TextDocumentFilter where

import Control.DeepSeq
import Data.Hashable
import GHC.Generics
import Language.LSP.Protocol.Utils.Misc
import Prettyprinter
import qualified Data.Aeson as Aeson
import qualified Data.Row.Aeson as Aeson
import qualified Data.Row.Hashable as Hashable
import qualified Language.LSP.Protocol.Internal.Types.TextDocumentFilterLanguage
import qualified Language.LSP.Protocol.Internal.Types.TextDocumentFilterPattern
import qualified Language.LSP.Protocol.Internal.Types.TextDocumentFilterScheme
import qualified Language.LSP.Protocol.Types.Common

{-|
A document filter denotes a document by different properties like
the `TextDocument.languageId` of
its resource, or a glob-pattern that is applied to the `TextDocument.fileName`.

Glob patterns can have the following syntax:
- `*` to match one or more characters in a path segment
- `?` to match on one character in a path segment
- `**` to match any number of path segments, including none
- `{}` to group sub patterns into an OR expression. (e.g. `**​/*.{ts,js}` matches all TypeScript and JavaScript files)
- `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)
- `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)

@sample A language filter that applies to typescript files on disk: `{ language: 'typescript', scheme: 'file' }`
@sample A language filter that applies to all package.json paths: `{ language: 'json', pattern: '**package.json' }`

@since 3.17.0
-}
newtype TextDocumentFilter = TextDocumentFilter (Language.LSP.Protocol.Internal.Types.TextDocumentFilterLanguage.TextDocumentFilterLanguage Language.LSP.Protocol.Types.Common.|? (Language.LSP.Protocol.Internal.Types.TextDocumentFilterScheme.TextDocumentFilterScheme Language.LSP.Protocol.Types.Common.|? Language.LSP.Protocol.Internal.Types.TextDocumentFilterPattern.TextDocumentFilterPattern))
  deriving newtype ([TextDocumentFilter] -> Value
[TextDocumentFilter] -> Encoding
TextDocumentFilter -> Bool
TextDocumentFilter -> Value
TextDocumentFilter -> Encoding
(TextDocumentFilter -> Value)
-> (TextDocumentFilter -> Encoding)
-> ([TextDocumentFilter] -> Value)
-> ([TextDocumentFilter] -> Encoding)
-> (TextDocumentFilter -> Bool)
-> ToJSON TextDocumentFilter
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
$ctoJSON :: TextDocumentFilter -> Value
toJSON :: TextDocumentFilter -> Value
$ctoEncoding :: TextDocumentFilter -> Encoding
toEncoding :: TextDocumentFilter -> Encoding
$ctoJSONList :: [TextDocumentFilter] -> Value
toJSONList :: [TextDocumentFilter] -> Value
$ctoEncodingList :: [TextDocumentFilter] -> Encoding
toEncodingList :: [TextDocumentFilter] -> Encoding
$comitField :: TextDocumentFilter -> Bool
omitField :: TextDocumentFilter -> Bool
Aeson.ToJSON, Maybe TextDocumentFilter
Value -> Parser [TextDocumentFilter]
Value -> Parser TextDocumentFilter
(Value -> Parser TextDocumentFilter)
-> (Value -> Parser [TextDocumentFilter])
-> Maybe TextDocumentFilter
-> FromJSON TextDocumentFilter
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: Value -> Parser TextDocumentFilter
parseJSON :: Value -> Parser TextDocumentFilter
$cparseJSONList :: Value -> Parser [TextDocumentFilter]
parseJSONList :: Value -> Parser [TextDocumentFilter]
$comittedField :: Maybe TextDocumentFilter
omittedField :: Maybe TextDocumentFilter
Aeson.FromJSON)
  deriving stock (Int -> TextDocumentFilter -> ShowS
[TextDocumentFilter] -> ShowS
TextDocumentFilter -> String
(Int -> TextDocumentFilter -> ShowS)
-> (TextDocumentFilter -> String)
-> ([TextDocumentFilter] -> ShowS)
-> Show TextDocumentFilter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TextDocumentFilter -> ShowS
showsPrec :: Int -> TextDocumentFilter -> ShowS
$cshow :: TextDocumentFilter -> String
show :: TextDocumentFilter -> String
$cshowList :: [TextDocumentFilter] -> ShowS
showList :: [TextDocumentFilter] -> ShowS
Show, TextDocumentFilter -> TextDocumentFilter -> Bool
(TextDocumentFilter -> TextDocumentFilter -> Bool)
-> (TextDocumentFilter -> TextDocumentFilter -> Bool)
-> Eq TextDocumentFilter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TextDocumentFilter -> TextDocumentFilter -> Bool
== :: TextDocumentFilter -> TextDocumentFilter -> Bool
$c/= :: TextDocumentFilter -> TextDocumentFilter -> Bool
/= :: TextDocumentFilter -> TextDocumentFilter -> Bool
Eq, Eq TextDocumentFilter
Eq TextDocumentFilter =>
(TextDocumentFilter -> TextDocumentFilter -> Ordering)
-> (TextDocumentFilter -> TextDocumentFilter -> Bool)
-> (TextDocumentFilter -> TextDocumentFilter -> Bool)
-> (TextDocumentFilter -> TextDocumentFilter -> Bool)
-> (TextDocumentFilter -> TextDocumentFilter -> Bool)
-> (TextDocumentFilter -> TextDocumentFilter -> TextDocumentFilter)
-> (TextDocumentFilter -> TextDocumentFilter -> TextDocumentFilter)
-> Ord TextDocumentFilter
TextDocumentFilter -> TextDocumentFilter -> Bool
TextDocumentFilter -> TextDocumentFilter -> Ordering
TextDocumentFilter -> TextDocumentFilter -> TextDocumentFilter
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: TextDocumentFilter -> TextDocumentFilter -> Ordering
compare :: TextDocumentFilter -> TextDocumentFilter -> Ordering
$c< :: TextDocumentFilter -> TextDocumentFilter -> Bool
< :: TextDocumentFilter -> TextDocumentFilter -> Bool
$c<= :: TextDocumentFilter -> TextDocumentFilter -> Bool
<= :: TextDocumentFilter -> TextDocumentFilter -> Bool
$c> :: TextDocumentFilter -> TextDocumentFilter -> Bool
> :: TextDocumentFilter -> TextDocumentFilter -> Bool
$c>= :: TextDocumentFilter -> TextDocumentFilter -> Bool
>= :: TextDocumentFilter -> TextDocumentFilter -> Bool
$cmax :: TextDocumentFilter -> TextDocumentFilter -> TextDocumentFilter
max :: TextDocumentFilter -> TextDocumentFilter -> TextDocumentFilter
$cmin :: TextDocumentFilter -> TextDocumentFilter -> TextDocumentFilter
min :: TextDocumentFilter -> TextDocumentFilter -> TextDocumentFilter
Ord, (forall x. TextDocumentFilter -> Rep TextDocumentFilter x)
-> (forall x. Rep TextDocumentFilter x -> TextDocumentFilter)
-> Generic TextDocumentFilter
forall x. Rep TextDocumentFilter x -> TextDocumentFilter
forall x. TextDocumentFilter -> Rep TextDocumentFilter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. TextDocumentFilter -> Rep TextDocumentFilter x
from :: forall x. TextDocumentFilter -> Rep TextDocumentFilter x
$cto :: forall x. Rep TextDocumentFilter x -> TextDocumentFilter
to :: forall x. Rep TextDocumentFilter x -> TextDocumentFilter
Generic)
  deriving anyclass (TextDocumentFilter -> ()
(TextDocumentFilter -> ()) -> NFData TextDocumentFilter
forall a. (a -> ()) -> NFData a
$crnf :: TextDocumentFilter -> ()
rnf :: TextDocumentFilter -> ()
NFData, Eq TextDocumentFilter
Eq TextDocumentFilter =>
(Int -> TextDocumentFilter -> Int)
-> (TextDocumentFilter -> Int) -> Hashable TextDocumentFilter
Int -> TextDocumentFilter -> Int
TextDocumentFilter -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
$chashWithSalt :: Int -> TextDocumentFilter -> Int
hashWithSalt :: Int -> TextDocumentFilter -> Int
$chash :: TextDocumentFilter -> Int
hash :: TextDocumentFilter -> Int
Hashable)
  deriving (forall ann. TextDocumentFilter -> Doc ann)
-> (forall ann. [TextDocumentFilter] -> Doc ann)
-> Pretty TextDocumentFilter
forall ann. [TextDocumentFilter] -> Doc ann
forall ann. TextDocumentFilter -> Doc ann
forall a.
(forall ann. a -> Doc ann)
-> (forall ann. [a] -> Doc ann) -> Pretty a
$cpretty :: forall ann. TextDocumentFilter -> Doc ann
pretty :: forall ann. TextDocumentFilter -> Doc ann
$cprettyList :: forall ann. [TextDocumentFilter] -> Doc ann
prettyList :: forall ann. [TextDocumentFilter] -> Doc ann
Pretty via (ViaJSON TextDocumentFilter)