racket / racket/drracket

require arrows, sub-range-binders, and add-definition-target

Open
#484 17 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Racket
Stars
516
Forks
103
PR merge metrics
No merged PRs in 30d

Description

This is for discussion, not yet a specific proposal.

Status quo

; define.rkt
(struct s (a))
s-a
(provide (struct-out s))

s-a is treated as two "sub-range binders", s and a. There are two lexical arrows (require-arrow = #f) between s and a. This is nice.

; require.rkt
(require "define.rkt")
s-a

s-a is treated as a single identifier. There's one require arrow (require-arrow = #t) between s-a and "the-above.rkt". This seems less nice.

Instead?

Should there instead be two require arrows in require.rkt?

Should add-definition-target be called for s-a with the srcloc for the a within the struct form, for define.rkt? (It might be already, I haven't yet checked.)

Should add-jump-to-definition be called for the a in s-a in require.rkt? (It might be already, I haven't yet checked.)

In other words, the sub-range binders idea would apply to imported as well as local definitions.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining the define.rkt and require.rkt examples, then trace the existing require-arrow handling and the add-definition-target and add-jump-to-definition entry points. Determine the current behavior for imported sub-range binders and document an agreed proposal for how arrows, definition targets, and jumps should work before implementing anything.

Written by the indexing model from the issue text.

Assessment

Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.