# Imports as completion candidates for hash-langs

**URL:** <https://racket.discourse.group/t/imports-as-completion-candidates-for-hash-langs/2511>\
**Category:** General\
**Created:** [November 17, 2023, 2:19pm UTC](https://racket.discourse.group/t/imports-as-completion-candidates-for-hash-langs/2511 "2023-11-17T14:19:04Z")\
**Posts on this page:** 1\
**Showing post:** 27

<div class="post-metadata">

**Author:** ![samth](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/samth/32/3_2.png) [@samth](https://racket.discourse.group/u/samth)\
**Post date:** [November 22, 2023, 10:04pm UTC](https://racket.discourse.group/t/imports-as-completion-candidates-for-hash-langs/2511/27 "2023-11-22T22:04:00Z")

</div>

Here's probably a better example to start from. This highlights/links to documentation for both `sqr` and `pi`, and shows arrows for `math`, but doesn't show arrows or offer to go to the definition of either `sqr` or `pi`. I think if that can be fixed then Rhombus can be adjusted pretty easily.

```scheme
#lang racket

(define-syntax math (syntax-rules ()))

(require racket/math)

(define-for-syntax tbl (hash 'pi #'pi
			     'sqr #'sqr))

(define-syntax (scope stx)
  (syntax-case stx ()
    [(_ mth id)
     (free-identifier=? #'mth #'math)
     (syntax-property (hash-ref tbl (syntax-e #'id))
                      'disappeared-use
                      (cons
                       (datum->syntax #'here
                                      'math
                                      #'mth
                                      #'mth)
                       (datum->syntax #'here
                                      (syntax-e #'id)
                                      #'id
                                      #'id)))]))
(provide scope math)

```

```scheme
#lang racket/base

(require "a.rkt")

(scope math sqr)

(scope math pi) 

```

---

_[View the full topic](https://racket.discourse.group/t/imports-as-completion-candidates-for-hash-langs/2511)._
