File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
compiler/src/language_server Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -182,7 +182,7 @@ let process =
182182 ~range= Utils . loc_to_range(loc),
183183 exception_declaration_lens(ident, ext),
184184 )
185- | [Module ({path , decl, loc}), ... _ ] =>
185+ | [Module ({decl, loc}), ... _ ] =>
186186 send_hover(~id, ~range= Utils . loc_to_range(loc), module_lens(decl))
187187 | [Include ({env, path, loc}), ... _ ] =>
188188 send_hover(
Original file line number Diff line number Diff line change @@ -509,6 +509,26 @@ module Sourcetree: Sourcetree = {
509509 };
510510 let enter_toplevel_stmt = stmt => {
511511 switch (stmt. ttop_desc) {
512+ | TTopModule (decl ) =>
513+ let path = Path . PIdent (decl. tmod_id);
514+ try ({
515+ let mod_decl = Env . find_module(path, None , stmt. ttop_env);
516+ segments :=
517+ [
518+ (
519+ loc_to_interval(stmt. ttop_loc),
520+ Module ({
521+ path,
522+ decl: mod_decl,
523+ loc: stmt. ttop_loc,
524+ definition: None ,
525+ }),
526+ ),
527+ ... segments^,
528+ ] ;
529+ }) {
530+ | Not_found => ()
531+ };
512532 | TTopInclude (inc ) =>
513533 segments :=
514534 [
You can’t perform that action at this time.
0 commit comments