0 | module Language.LSP.Message.CallHierarchy
 1 |
 2 | import Language.JSON
 3 | import Language.LSP.Message.Derive
 4 | import Language.LSP.Message.DocumentSymbols
 5 | import Language.LSP.Message.Location
 6 | import Language.LSP.Message.Progress
 7 | import Language.LSP.Message.TextDocument
 8 | import Language.LSP.Message.URI
 9 | import Language.LSP.Message.Utils
10 | import Language.Reflection
11 |
12 | %language ElabReflection
13 | %default total
14 |
15 | ||| Refer to https://microsoft.github.io/language-server-protocol/specification.html#textDocument_prepareCallHierarchy
16 | public export
17 | record CallHierarchyClientCapabilities where
18 |   constructor MkCallHierarchyClientCapabilities
19 |   dynamicRegistration : Maybe Bool
20 | %runElab deriveJSON defaultOpts `{CallHierarchyClientCapabilities}
21 |
22 | ||| Refer to https://microsoft.github.io/language-server-protocol/specification.html#textDocument_prepareCallHierarchy
23 | public export
24 | record CallHierarchyOptions where
25 |   constructor MkCallHierarchyOptions
26 |   workDoneProgress : Maybe Bool
27 | %runElab deriveJSON defaultOpts `{CallHierarchyOptions}
28 |
29 | ||| Refer to https://microsoft.github.io/language-server-protocol/specification.html#textDocument_prepareCallHierarchy
30 | public export
31 | record CallHierarchyRegistrationOptions where
32 |   constructor MkCallHierarchyRegistrationOptions
33 |   workDoneProgress : Maybe Bool
34 |   documentSelector : OneOf [DocumentSelector, Null]
35 |   id               : Maybe String
36 | %runElab deriveJSON defaultOpts `{CallHierarchyRegistrationOptions}
37 |
38 | ||| Refer to https://microsoft.github.io/language-server-protocol/specification.html#textDocument_prepareCallHierarchy
39 | public export
40 | record CallHierarchyParams where
41 |   constructor MkCallHierarchyParams
42 |   workDoneToken : Maybe ProgressToken
43 |   textDocument  : TextDocumentIdentifier
44 | %runElab deriveJSON defaultOpts `{CallHierarchyParams}
45 |
46 | ||| Refer to https://microsoft.github.io/language-server-protocol/specification.html#textDocument_prepareCallHierarchy
47 | public export
48 | record CallHierarchyItem where
49 |   constructor MkCallHierarchyItem
50 |   name           : String
51 |   kind           : SymbolKind
52 |   tags           : Maybe (List SymbolTag)
53 |   detail         : Maybe String
54 |   uri            : DocumentURI
55 |   range          : Range
56 |   selectionRange : Range
57 |   data_          : Maybe JSON
58 | %runElab deriveJSON ({renames := [("data_", "data")]} defaultOpts) `{CallHierarchyItem}
59 |
60 | ||| Refer to https://microsoft.github.io/language-server-protocol/specification.html#callHierarchy_incomingCalls
61 | public export
62 | record CallHierarchyIncomingCallsParams where
63 |   constructor MkCallHierarchyIncomingCallsParams
64 |   workDoneToken      : Maybe ProgressToken
65 |   partialResultToken : Maybe ProgressToken
66 |   item               : CallHierarchyItem
67 | %runElab deriveJSON defaultOpts `{CallHierarchyIncomingCallsParams}
68 |
69 | ||| Refer to https://microsoft.github.io/language-server-protocol/specification.html#callHierarchy_incomingCalls
70 | public export
71 | record CallHierarchyIncomingCall where
72 |   constructor MkCallHierarchyIncomingCall
73 |   from       : CallHierarchyItem
74 |   fromRanges : List Range
75 | %runElab deriveJSON defaultOpts `{CallHierarchyIncomingCall}
76 |
77 | ||| Refer to https://microsoft.github.io/language-server-protocol/specification.html#callHierarchy_outgoingCalls
78 | public export
79 | record CallHierarchyOutgoingCallsParams where
80 |   constructor MkCallHierarchyOutgoingCallsParams
81 |   workDoneToken      : Maybe ProgressToken
82 |   partialResultToken : Maybe ProgressToken
83 |   item               : CallHierarchyItem
84 | %runElab deriveJSON defaultOpts `{CallHierarchyOutgoingCallsParams}
85 |
86 | ||| Refer to https://microsoft.github.io/language-server-protocol/specification.html#callHierarchy_outgoingCalls
87 | public export
88 | record CallHierarchyOutgoingCall where
89 |   constructor MkCallHierarchyOutgoingCall
90 |   to         : CallHierarchyItem
91 |   fromRanges : List Range
92 | %runElab deriveJSON defaultOpts `{CallHierarchyOutgoingCall}
93 |