[racket] DrRacket feature request: colored contracts

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Sun Nov 11 10:30:33 EST 2012

Actually, the documentation blue boxes thing in the upper-right corner
(is that also what you're referring to by the identifier information
rectangle) does this. I did it as kind of an experiment to see how
well that approach would work. It seems to be going okay so far, and
it could be generalized to handle colors or other such information
that is probably not invalidated by an edit, while we wait for latest
online check syntax information to come back. Right now, when you edit
the buffer, it only invalidates the blue boxes for the editor ranges
that were actually edited. For example, if you have

(define x (list 1 2 3))

and you change the program to

(define x (liPQRst 1 2 3))

then the "define" blue box sticks around (until the check syntax
results come back saying the entire buffer is bogus).

Robby

On Sun, Nov 11, 2012 at 9:21 AM, Laurent <laurent.orseau at gmail.com> wrote:
>
>
>>
>> I'm not sure if that's the best thing, but
>> the reason I did it that was was to avoid colors flashing around, as
>> the check syntax information comes and goes as you edit the buffer.
>
>
> Ah yes, there might be this problem indeed.
> Maybe it could be possible to keep a "partial" state of the syntax checker,
> and only discard the parts that are being edited, until the document can be
> checked entirely, possibly with a warning at the bottom right saying that
> the syntax checker is not currently in sync.
> That would help for the contract coloring as well as for the identifier
> information rectangle, but I'm not sure this is easy to implement.
>
> Laurent
>
>>
>> Robby
>>
>> On Sun, Nov 11, 2012 at 8:57 AM, Laurent <laurent.orseau at gmail.com> wrote:
>> > Hi,
>> >
>> > Starting my Xmas wish list:
>> > In case some developer doesn't know what to do (sure...), I think it
>> > would
>> > be visually quite helpful if contracts could be syntax-colored, for
>> > example
>> > in lighter blue. That would help quickly distinguish between the actual
>> > code
>> > and the debugging code.
>> >
>> > Thanks :)
>> > Laurent
>> >
>> > ____________________
>> >   Racket Users list:
>> >   http://lists.racket-lang.org/users
>> >
>
>

Posted on the users mailing list.