@@ -18,7 +18,6 @@ let codeBlock = code => {
18
18
19
19
let showModuleTopLevel =
20
20
(
21
- ~deprecated,
22
21
~docstring,
23
22
~name,
24
23
topLevel: list (SharedTypes . declared (SharedTypes . moduleItem )),
@@ -42,27 +41,20 @@ let showModuleTopLevel =
42
41
| None => ""
43
42
| Some (s ) => "\n " ++ s ++ "\n "
44
43
};
45
- let depr =
46
- switch (deprecated) {
47
- | None => ""
48
- | Some (s ) => "\n Deprecated: " ++ s ++ "\n "
49
- };
50
- Some (depr ++ doc ++ codeBlock(full));
44
+ Some (doc ++ codeBlock(full));
51
45
};
52
46
53
47
let showModule =
54
48
(
55
- ~deprecated,
56
49
~docstring,
57
50
~file: SharedTypes . file ,
58
51
~name,
59
52
declared: option (SharedTypes . declared (SharedTypes . moduleKind )),
60
53
) => {
61
54
switch (declared) {
62
- | None =>
63
- showModuleTopLevel(~deprecated, ~docstring, ~name, file. contents. topLevel)
55
+ | None => showModuleTopLevel(~docstring, ~name, file. contents. topLevel)
64
56
| Some ({item: Structure ({topLevel})}) =>
65
- showModuleTopLevel(~deprecated , ~ docstring, ~name, topLevel)
57
+ showModuleTopLevel(~docstring, ~name, topLevel)
66
58
| Some ({item: Ident (_ )}) => Some ("Unable to resolve module reference" )
67
59
};
68
60
};
@@ -78,12 +70,12 @@ let newHover = (~rootUri, ~file: SharedTypes.file, ~getModule, loc) => {
78
70
let %opt md = Hashtbl.find_opt(file.stamps.modules, stamp);
79
71
let %opt (file, declared) =
80
72
References . resolveModuleReference (~file , ~getModule , md );
81
- let (name , deprecated , docstring ) =
73
+ let (name , docstring ) =
82
74
switch (declared) {
83
- | Some (d ) => (d. name. txt, d. deprecated , d . docstring)
84
- | None => (file. moduleName, None , file. contents. docstring)
75
+ | Some (d ) => (d. name. txt, d. docstring)
76
+ | None => (file. moduleName, file. contents. docstring)
85
77
};
86
- showModule(~deprecated , ~ docstring, ~name, ~file, declared);
78
+ showModule(~docstring, ~name, ~file, declared);
87
79
| LModule (GlobalReference (moduleName , path , tip )) =>
88
80
let %opt file = getModule(moduleName);
89
81
let env = Query . fileEnv(file);
@@ -92,17 +84,16 @@ let newHover = (~rootUri, ~file: SharedTypes.file, ~getModule, loc) => {
92
84
let %opt md = Hashtbl.find_opt(file.stamps.modules, stamp);
93
85
let %opt (file, declared) =
94
86
References . resolveModuleReference (~file , ~getModule , md );
95
- let (name , deprecated , docstring ) =
87
+ let (name , docstring ) =
96
88
switch (declared) {
97
- | Some (d ) => (d. name. txt, d. deprecated , d . docstring)
98
- | None => (file. moduleName, None , file. contents. docstring)
89
+ | Some (d ) => (d. name. txt, d. docstring)
90
+ | None => (file. moduleName, file. contents. docstring)
99
91
};
100
- showModule(~deprecated , ~ docstring, ~name, ~file, declared);
92
+ showModule(~docstring, ~name, ~file, declared);
101
93
| LModule (NotFound ) => None
102
94
| TopLevelModule (name ) =>
103
95
let %opt file = getModule(name);
104
96
showModule (
105
- ~deprecated =None ,
106
97
~docstring =file .contents .docstring ,
107
98
~name =file .moduleName ,
108
99
~file ,
@@ -122,7 +113,7 @@ let newHover = (~rootUri, ~file: SharedTypes.file, ~getModule, loc) => {
122
113
},
123
114
)
124
115
| Typed (t , locKind ) =>
125
- let fromType = (~deprecated , ~ docstring, typ) => {
116
+ let fromType = (~docstring, typ) => {
126
117
let typeString = codeBlock(typ |> Shared . typeToString);
127
118
let extraTypeInfo = {
128
119
let env = Query . fileEnv(file);
@@ -134,44 +125,35 @@ let newHover = (~rootUri, ~file: SharedTypes.file, ~getModule, loc) => {
134
125
if (isUncurriedInternal) {
135
126
None ;
136
127
} else {
137
- Some ((decl |> Shared . declToString(txt), deprecated , docstring));
128
+ Some ((decl |> Shared . declToString(txt), docstring));
138
129
};
139
130
};
140
- let (typeString , deprecated , docstring ) =
131
+ let (typeString , docstring ) =
141
132
switch (extraTypeInfo) {
142
- | None => (typeString, deprecated , docstring)
143
- | Some ((extra , extraDeprecated , extraDocstring )) => (
133
+ | None => (typeString, docstring)
134
+ | Some ((extra , extraDocstring )) => (
144
135
typeString ++ "\n\n " ++ codeBlock(extra),
145
- extraDeprecated,
146
136
extraDocstring,
147
137
)
148
138
};
149
- let deprecatedMsg =
150
- switch (deprecated) {
151
- | None => None
152
- | Some (s ) => Some ("Deprecated: " ++ s)
153
- };
154
- (Some (typeString), deprecatedMsg, docstring);
139
+ (Some (typeString), docstring);
155
140
};
156
141
157
142
let parts =
158
143
switch (References . definedForLoc(~file, ~getModule, locKind)) {
159
144
| None =>
160
- let (typeString , deprecatedMsg , docstring ) =
161
- t |> fromType(~deprecated= None , ~docstring= None );
162
- [ typeString, deprecatedMsg, docstring] ;
163
- | Some ((deprecated , docstring , {uri}, res )) =>
145
+ let (typeString , docstring ) = t |> fromType(~docstring= None );
146
+ [ typeString, docstring] ;
147
+ | Some ((docstring , {uri}, res )) =>
164
148
let pathFromRoot = uri |> Uri2 . pathFromRoot(~rootUri);
165
149
166
150
let parts =
167
151
switch (res) {
168
152
| ` Declared =>
169
- let (typeString , deprecatedMsg , docstring ) =
170
- t |> fromType(~deprecated, ~docstring);
171
- [ typeString, deprecatedMsg, docstring] ;
153
+ let (typeString , docstring ) = t |> fromType(~docstring);
154
+ [ typeString, docstring] ;
172
155
| ` Constructor ({cname: {txt}, args}) =>
173
- let (typeString , deprecatedMsg , docstring ) =
174
- t |> fromType(~deprecated, ~docstring);
156
+ let (typeString , docstring ) = t |> fromType(~docstring);
175
157
176
158
let argsString =
177
159
switch (args) {
@@ -183,16 +165,10 @@ let newHover = (~rootUri, ~file: SharedTypes.file, ~getModule, loc) => {
183
165
|> Printf . sprintf("(% s )" )
184
166
};
185
167
186
- [
187
- typeString,
188
- Some (codeBlock(txt ++ argsString)),
189
- deprecatedMsg,
190
- docstring,
191
- ] ;
168
+ [ typeString, Some (codeBlock(txt ++ argsString)), docstring] ;
192
169
| ` Field ({typ}) =>
193
- let (typeString , deprecatedMsg , docstring ) =
194
- typ |> fromType(~deprecated, ~docstring);
195
- [ typeString, deprecatedMsg, docstring] ;
170
+ let (typeString , docstring ) = typ |> fromType(~docstring);
171
+ [ typeString, docstring] ;
196
172
};
197
173
198
174
parts @ [ Some (pathFromRoot)] ;
0 commit comments