0 | module Language.LSP.Message.DocumentColor
 1 |
 2 | import Language.JSON
 3 | import Language.LSP.Message.Derive
 4 | import Language.LSP.Message.Location
 5 | import Language.LSP.Message.Progress
 6 | import Language.LSP.Message.TextDocument
 7 | import Language.LSP.Message.Utils
 8 | import Language.LSP.Message.Workspace
 9 | import Language.Reflection
10 |
11 | %language ElabReflection
12 | %default total
13 |
14 | ||| Refer to https://microsoft.github.io/language-server-protocol/specification.html#textDocument_documentColor
15 | public export
16 | record DocumentColorClientCapabilities where
17 |   constructor MkDocumentColorClientCapabilities
18 |   dynamicRegistration : Maybe Bool
19 | %runElab deriveJSON defaultOpts `{DocumentColorClientCapabilities}
20 |
21 | ||| Refer to https://microsoft.github.io/language-server-protocol/specification.html#textDocument_documentColor
22 | public export
23 | record DocumentColorOptions where
24 |   constructor MkDocumentColorOptions
25 |   workDoneProgress : Maybe Bool
26 | %runElab deriveJSON defaultOpts `{DocumentColorOptions}
27 |
28 | ||| Refer to https://microsoft.github.io/language-server-protocol/specification.html#textDocument_documentColor
29 | public export
30 | record DocumentColorRegistrationOptions where
31 |   constructor MkDocumentColorRegistrationOptions
32 |   workDoneProgress : Maybe Bool
33 |   documentSelector : OneOf [DocumentSelector, Null]
34 |   id               : Maybe String
35 | %runElab deriveJSON defaultOpts `{DocumentColorRegistrationOptions}
36 |
37 | ||| Refer to https://microsoft.github.io/language-server-protocol/specification.html#textDocument_documentColor
38 | public export
39 | record DocumentColorParams where
40 |   constructor MkDocumentColorParams
41 |   workDoneToken      : Maybe ProgressToken
42 |   partialResultToken : Maybe ProgressToken
43 |   textDocument       : TextDocumentIdentifier
44 | %runElab deriveJSON defaultOpts `{DocumentColorParams}
45 |
46 | ||| Refer to https://microsoft.github.io/language-server-protocol/specification.html#textDocument_documentColor
47 | public export
48 | record Color where
49 |   constructor MkColor
50 |   red   : Double
51 |   green : Double
52 |   blue  : Double
53 |   alpha : Double
54 | %runElab deriveJSON defaultOpts `{Color}
55 |
56 | ||| Refer to https://microsoft.github.io/language-server-protocol/specification.html#textDocument_documentColor
57 | public export
58 | record ColorInformation where
59 |   constructor MkColorInformation
60 |   range : Range
61 |   color : Color
62 | %runElab deriveJSON defaultOpts `{ColorInformation}
63 |
64 | ||| Refer to https://microsoft.github.io/language-server-protocol/specification.html#textDocument_colorPresentation
65 | public export
66 | record ColorPresentationParams where
67 |   constructor MkColorPresentationParams
68 |   workDoneToken      : Maybe ProgressToken
69 |   partialResultToken : Maybe ProgressToken
70 |   color              : Color
71 |   range              : Range
72 | %runElab deriveJSON defaultOpts `{ColorPresentationParams}
73 |
74 | ||| Refer to https://microsoft.github.io/language-server-protocol/specification.html#textDocument_colorPresentation
75 | public export
76 | record ColorPresentation where
77 |   constructor MkColorPresentation
78 |   label               : String
79 |   textEdit            : Maybe TextEdit
80 |   additionalTextEdits : Maybe (List TextEdit)
81 | %runElab deriveJSON defaultOpts `{ColorPresentation}
82 |