racket / racket/drracket

Recent snapshot produces unexpected annotations with empty intervals

Open
#445 34 comments 2 reactions 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

Within the last 6 days, I started having an automated test for Racket Mode fail, only on Racket snapshot.

The test is getting surprised by a new syncheck:add-docs-menu for #%datum, arising from 42 in this little program:

#lang racket/base
(define foobar 42)
foobar

Given the time frame, I glanced at the commit history and it looks like this is related to commit 45fb5f5 (and/or the "upstream" commits its message mentions)?

  1. I don't know if this is intentional, or, a side-effect you just hadn't noticed yet. Maybe it's not obvious in the DrR UI or caught by its tests?

    I'm guessing it's unintentional. A literal 42 offering documentation for #%datum, seems... maybe noisy and not helpful.

    OTOH if in fact intentional, I can adjust some test cases to expect these to appear. Even so, I think there's still a problem...

  2. The syncheck:add-docs-menu values for beg and end are both 33. This is unprecedented, in my experience using check-syntax, beg and end have always meant a half-open interval. Never an empty span. (e.g. In the Racket back end, I collect these annotations in an interval-map; these new annotations raise an error I've not seen before.)

    • I'm not sure what it means to annotate an empty span for an identifier (unlike say an arrow position).

    • Ideally it seems it should be [33 35) to cover all of the text 42. (Less ideally, [33 34) to cover the first character would probably be OK.)

    So I mean, I could force end to be at least 1+ beg, but rather than me paper that over I wanted to see if it made sense to do that within check-syntax.

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

Reproduce the reported check-syntax behavior with the small Racket program and inspect commit 45fb5f5 plus the upstream commits it mentions. Examine the syncheck:add-docs-menu annotation for #%datum, especially its beg and end values, alongside the Racket Mode automated test. Done means the behavior is resolved or intentionally documented, with the test and annotation interval agreeing on the expected result.

Written by the indexing model from the issue text.

Assessment

Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.