code: def display_hook(prompt, session, context, matches, longest_match_len):
          # type: (str, ShellSession, BundleContext, List[str], int) -> None
          
          try:
              # Prepare a line pattern for each match
              match_pattern = "{{0: >{}}}: {{1}}".format(longest_match_len)
  
              # Sort matching IDs
              matches = sorted(int(match) for match in matches)
  
              # Print the match and the associated name
              session.write_line()
              for svc_id in matches:
                  svc_ref = context.get_service_reference(
                      None, "({}={})".format(SERVICE_ID, svc_id)
                  )
                  session.write_line(match_pattern, svc_id, str(svc_ref))
  
              # Print the prompt, then current line
              session.write(prompt)
              session.write_line_no_feed(readline.get_line_buffer())
              readline.redisplay()
          except Exception as ex:
              session.write_line("\n{}\n\n", ex)
docs: Displays the available services matches and the service details
  
          :param prompt: Shell prompt string
          :param session: Current shell session (for display)
          :param context: BundleContext of the shell
          :param matches: List of words matching the substitution
          :param longest_match_len: Length of the largest match